QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
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 
26 namespace QGst {
27 
55 class QTGSTREAMER_EXPORT Event : public MiniObject
56 {
57  QGST_WRAPPER(Event)
58 public:
59  ObjectPtr source() const;
60  quint64 timestamp() const;
61  EventType type() const;
62  QString typeName() const;
63 
64  StructurePtr internalStructure();
65 
66  quint32 sequenceNumber() const;
67  void setSequenceNumber(quint32 num);
68 
69  EventPtr copy() const;
70 
71 };
72 
76 class QTGSTREAMER_EXPORT FlushStartEvent : public Event
77 {
78  QGST_WRAPPER_FAKE_SUBCLASS(FlushStart, Event)
79 public:
80  static FlushStartEventPtr create();
81 };
82 
86 class QTGSTREAMER_EXPORT FlushStopEvent : public Event
87 {
88  QGST_WRAPPER_FAKE_SUBCLASS(FlushStop, Event)
89 public:
90  static FlushStopEventPtr create();
91 };
92 
96 class QTGSTREAMER_EXPORT EosEvent : public Event
97 {
98  QGST_WRAPPER_FAKE_SUBCLASS(Eos, Event)
99 public:
100  static EosEventPtr create();
101 };
102 
106 class QTGSTREAMER_EXPORT NewSegmentEvent : public Event
107 {
108  QGST_WRAPPER_FAKE_SUBCLASS(NewSegment, Event)
109 public:
110  static NewSegmentEventPtr create(bool update, double rate, double appliedRate, Format format,
111  qint64 start, qint64 stop, qint64 position);
112 
113  bool isUpdate() const;
114  double rate() const;
115  double appliedRate() const;
116  Format format() const;
117  qint64 start() const;
118  qint64 stop() const;
119  qint64 position() const;
120 };
121 
125 class QTGSTREAMER_EXPORT TagEvent : public Event
126 {
127  QGST_WRAPPER_FAKE_SUBCLASS(Tag, Event)
128 public:
129  static TagEventPtr create(const TagList & taglist);
130 
131  TagList taglist() const;
132 };
133 
137 class QTGSTREAMER_EXPORT BufferSizeEvent : public Event
138 {
139  QGST_WRAPPER_FAKE_SUBCLASS(BufferSize, Event)
140 public:
141  static BufferSizeEventPtr create(Format format, qint64 minSize, qint64 maxSize, bool isAsync);
142 
143  Format format() const;
144  qint64 minSize() const;
145  qint64 maxSize() const;
146  bool isAsync() const;
147 };
148 
152 class QTGSTREAMER_EXPORT SinkMessageEvent : public Event
153 {
154  QGST_WRAPPER_FAKE_SUBCLASS(SinkMessage, Event)
155 public:
156  static SinkMessageEventPtr create(const MessagePtr & msg);
157 
158  MessagePtr message() const;
159 };
160 
164 class QTGSTREAMER_EXPORT QosEvent : public Event
165 {
166  QGST_WRAPPER_FAKE_SUBCLASS(Qos, Event)
167 public:
168  static QosEventPtr create(double proportion, ClockTimeDiff diff, ClockTime timestamp);
169 
170  double proportion() const;
171  ClockTimeDiff diff() const;
172  ClockTime timestamp() const;
173 };
174 
178 class QTGSTREAMER_EXPORT SeekEvent : public Event
179 {
180  QGST_WRAPPER_FAKE_SUBCLASS(Seek, Event)
181 public:
182  static SeekEventPtr create(double rate, Format format, SeekFlags flags, SeekType startType,
183  qint64 start, SeekType stopType, qint64 stop);
184 
185  double rate() const;
186  Format format() const;
187  SeekFlags flags() const;
188  SeekType startType() const;
189  qint64 start() const;
190  SeekType stopType() const;
191  qint64 stop() const;
192 };
193 
197 class QTGSTREAMER_EXPORT NavigationEvent : public Event
198 {
199  QGST_WRAPPER_FAKE_SUBCLASS(Navigation, Event)
200 public:
201  static NavigationEventPtr create(const Structure & structure = Structure());
202 };
203 
207 class QTGSTREAMER_EXPORT LatencyEvent : public Event
208 {
209  QGST_WRAPPER_FAKE_SUBCLASS(Latency, Event)
210 public:
211  static LatencyEventPtr create(ClockTime latency);
212 
213  ClockTime latency() const;
214 };
215 
219 class QTGSTREAMER_EXPORT StepEvent : public Event
220 {
221  QGST_WRAPPER_FAKE_SUBCLASS(Step, Event)
222 public:
223  static StepEventPtr create(Format format, quint64 amount, double rate,
224  bool flush, bool intermediate);
225 
226  Format format() const;
227  quint64 amount() const;
228  double rate() const;
229  bool flush() const;
230  bool intermediate() const;
231 };
232 
233 } //namespace QGst
234 
235 QGST_REGISTER_TYPE(QGst::Event)
236 QGST_REGISTER_SUBCLASS(Event, FlushStart)
237 QGST_REGISTER_SUBCLASS(Event, FlushStop)
238 QGST_REGISTER_SUBCLASS(Event, Eos)
239 QGST_REGISTER_SUBCLASS(Event, NewSegment)
240 QGST_REGISTER_SUBCLASS(Event, Tag)
241 QGST_REGISTER_SUBCLASS(Event, BufferSize)
242 QGST_REGISTER_SUBCLASS(Event, SinkMessage)
243 QGST_REGISTER_SUBCLASS(Event, Qos)
244 QGST_REGISTER_SUBCLASS(Event, Seek)
245 QGST_REGISTER_SUBCLASS(Event, Navigation)
246 QGST_REGISTER_SUBCLASS(Event, Latency)
247 QGST_REGISTER_SUBCLASS(Event, Step)
248 
249 #endif