QtGStreamer 1.2.0
Loading...
Searching...
No Matches
event.h
1/*
2 Copyright (C) 2010 Collabora Multimedia.
3 @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef QGST_EVENT_H
19#define QGST_EVENT_H
20
21#include "miniobject.h"
22#include "structure.h"
23#include "clocktime.h"
24#include "taglist.h"
25
26namespace QGst {
27
55class QTGSTREAMER_EXPORT Event : public MiniObject
56{
57 QGST_WRAPPER(Event)
58public:
59 quint64 timestamp() const;
60 EventType type() const;
61 QString typeName() const;
62
63 StructureConstPtr internalStructure();
64
65 bool hasName(const char *name) const;
66
67 quint32 sequenceNumber() const;
68 void setSequenceNumber(quint32 num);
69
70 EventPtr copy() const;
71
72};
73
77class QTGSTREAMER_EXPORT FlushStartEvent : public Event
78{
79 QGST_WRAPPER_FAKE_SUBCLASS(FlushStart, Event)
80public:
81 static FlushStartEventPtr create();
82};
83
87class QTGSTREAMER_EXPORT FlushStopEvent : public Event
88{
89 QGST_WRAPPER_FAKE_SUBCLASS(FlushStop, Event)
90public:
91 static FlushStopEventPtr create(bool reset_time=true);
92
93 bool resetTime() const;
94};
95
99class QTGSTREAMER_EXPORT EosEvent : public Event
100{
101 QGST_WRAPPER_FAKE_SUBCLASS(Eos, Event)
102public:
103 static EosEventPtr create();
104};
105
109 class QTGSTREAMER_EXPORT CapsEvent : public Event
110 {
111 QGST_WRAPPER_FAKE_SUBCLASS(Caps, Event)
112public:
113 static CapsEventPtr create(const CapsPtr & caps);
114
115 CapsPtr caps() const;
116 };
117
121class QTGSTREAMER_EXPORT SegmentEvent : public Event
122{
123 QGST_WRAPPER_FAKE_SUBCLASS(Segment, Event)
124public:
125 static SegmentEventPtr create(const Segment & segment);
126
127 Segment segment() const;
128};
129
133class QTGSTREAMER_EXPORT TagEvent : public Event
134{
135 QGST_WRAPPER_FAKE_SUBCLASS(Tag, Event)
136public:
137 static TagEventPtr create(const TagList & taglist);
138
139 TagList taglist() const;
140};
141
145class QTGSTREAMER_EXPORT BufferSizeEvent : public Event
146{
147 QGST_WRAPPER_FAKE_SUBCLASS(BufferSize, Event)
148public:
149 static BufferSizeEventPtr create(Format format, qint64 minSize, qint64 maxSize, bool isAsync);
150
151 Format format() const;
152 qint64 minSize() const;
153 qint64 maxSize() const;
154 bool isAsync() const;
155};
156
160class QTGSTREAMER_EXPORT SinkMessageEvent : public Event
161{
162 QGST_WRAPPER_FAKE_SUBCLASS(SinkMessage, Event)
163public:
164 static SinkMessageEventPtr create(const QString &name, const MessagePtr & msg);
165
166 MessagePtr message() const;
167};
168
172class QTGSTREAMER_EXPORT QosEvent : public Event
173{
174 QGST_WRAPPER_FAKE_SUBCLASS(Qos, Event)
175public:
176 static QosEventPtr create(QosType qos, double proportion, ClockTimeDiff diff, ClockTime timestamp);
177
178 QosType qosType() const;
179 double proportion() const;
180 ClockTimeDiff diff() const;
181 ClockTime timestamp() const;
182};
183
187class QTGSTREAMER_EXPORT SeekEvent : public Event
188{
189 QGST_WRAPPER_FAKE_SUBCLASS(Seek, Event)
190public:
191 static SeekEventPtr create(double rate, Format format, SeekFlags flags, SeekType startType,
192 qint64 start, SeekType stopType, qint64 stop);
193
194 double rate() const;
195 Format format() const;
196 SeekFlags flags() const;
197 SeekType startType() const;
198 qint64 start() const;
199 SeekType stopType() const;
200 qint64 stop() const;
201};
202
206class QTGSTREAMER_EXPORT NavigationEvent : public Event
207{
208 QGST_WRAPPER_FAKE_SUBCLASS(Navigation, Event)
209public:
210 static NavigationEventPtr create(const Structure & structure = Structure());
211};
212
216class QTGSTREAMER_EXPORT LatencyEvent : public Event
217{
218 QGST_WRAPPER_FAKE_SUBCLASS(Latency, Event)
219public:
220 static LatencyEventPtr create(ClockTime latency);
221
222 ClockTime latency() const;
223};
224
228class QTGSTREAMER_EXPORT StepEvent : public Event
229{
230 QGST_WRAPPER_FAKE_SUBCLASS(Step, Event)
231public:
232 static StepEventPtr create(Format format, quint64 amount, double rate,
233 bool flush, bool intermediate);
234
235 Format format() const;
236 quint64 amount() const;
237 double rate() const;
238 bool flush() const;
239 bool intermediate() const;
240};
241
242} //namespace QGst
243
244QGST_REGISTER_TYPE(QGst::Event)
245QGST_REGISTER_SUBCLASS(Event, FlushStart)
246QGST_REGISTER_SUBCLASS(Event, FlushStop)
247QGST_REGISTER_SUBCLASS(Event, Eos)
248QGST_REGISTER_SUBCLASS(Event, Caps)
249QGST_REGISTER_SUBCLASS(Event, Segment)
250QGST_REGISTER_SUBCLASS(Event, Tag)
251QGST_REGISTER_SUBCLASS(Event, BufferSize)
252QGST_REGISTER_SUBCLASS(Event, SinkMessage)
253QGST_REGISTER_SUBCLASS(Event, Qos)
254QGST_REGISTER_SUBCLASS(Event, Seek)
255QGST_REGISTER_SUBCLASS(Event, Navigation)
256QGST_REGISTER_SUBCLASS(Event, Latency)
257QGST_REGISTER_SUBCLASS(Event, Step)
258
259#endif
Smart pointer class for working with wrapper classes that support reference counting.
Definition refpointer.h:91
Wrapper class for events of type QGst::BufferSizeEvent.
Definition event.h:146
Wrapper class for events of type QGst::EventCaps.
Definition event.h:110
Wrapper class for GstCaps.
Definition caps.h:32
A datatype to hold a time, measured in nanoseconds.
Definition clocktime.h:38
Wrapper class for events of type QGst::EosEvent.
Definition event.h:100
Wrapper class for GstEvent.
Definition event.h:56
Wrapper class for events of type QGst::FlushStartEvent.
Definition event.h:78
Wrapper class for events of type QGst::FlushStopEvent.
Definition event.h:88
Wrapper class for events of type QGst::LatencyEvent.
Definition event.h:217
Wrapper class for GstMiniObject.
Definition miniobject.h:30
Wrapper class for events of type QGst::NavigationEvent.
Definition event.h:207
Wrapper class for events of type QGst::QosEvent.
Definition event.h:173
Wrapper class for events of type QGst::SeekEvent.
Definition event.h:188
Wrapper class for events of type QGst::SegmentEvent.
Definition event.h:122
Wrapper for GstSegment.
Definition segment.h:28
Wrapper class for events of type QGst::SinkMessageEvent.
Definition event.h:161
Wrapper class for events of type QGst::StepEvent.
Definition event.h:229
Wrapper for GstStructure.
Definition structure.h:50
Wrapper class for events of type QGst::TagEvent.
Definition event.h:134
Wrapper class for GstTagList.
Definition taglist.h:71
Wrappers for GStreamer classes.