QtGStreamer  1.2.0
 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  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 
77 class QTGSTREAMER_EXPORT FlushStartEvent : public Event
78 {
79  QGST_WRAPPER_FAKE_SUBCLASS(FlushStart, Event)
80 public:
81  static FlushStartEventPtr create();
82 };
83 
87 class QTGSTREAMER_EXPORT FlushStopEvent : public Event
88 {
89  QGST_WRAPPER_FAKE_SUBCLASS(FlushStop, Event)
90 public:
91  static FlushStopEventPtr create(bool reset_time=true);
92 
93  bool resetTime() const;
94 };
95 
99 class QTGSTREAMER_EXPORT EosEvent : public Event
100 {
101  QGST_WRAPPER_FAKE_SUBCLASS(Eos, Event)
102 public:
103  static EosEventPtr create();
104 };
105 
109  class QTGSTREAMER_EXPORT CapsEvent : public Event
110  {
111  QGST_WRAPPER_FAKE_SUBCLASS(Caps, Event)
112 public:
113  static CapsEventPtr create(const CapsPtr & caps);
114 
115  CapsPtr caps() const;
116  };
117 
121 class QTGSTREAMER_EXPORT SegmentEvent : public Event
122 {
123  QGST_WRAPPER_FAKE_SUBCLASS(Segment, Event)
124 public:
125  static SegmentEventPtr create(const Segment & segment);
126 
127  Segment segment() const;
128 };
129 
133 class QTGSTREAMER_EXPORT TagEvent : public Event
134 {
135  QGST_WRAPPER_FAKE_SUBCLASS(Tag, Event)
136 public:
137  static TagEventPtr create(const TagList & taglist);
138 
139  TagList taglist() const;
140 };
141 
145 class QTGSTREAMER_EXPORT BufferSizeEvent : public Event
146 {
147  QGST_WRAPPER_FAKE_SUBCLASS(BufferSize, Event)
148 public:
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 
160 class QTGSTREAMER_EXPORT SinkMessageEvent : public Event
161 {
162  QGST_WRAPPER_FAKE_SUBCLASS(SinkMessage, Event)
163 public:
164  static SinkMessageEventPtr create(const QString &name, const MessagePtr & msg);
165 
166  MessagePtr message() const;
167 };
168 
172 class QTGSTREAMER_EXPORT QosEvent : public Event
173 {
174  QGST_WRAPPER_FAKE_SUBCLASS(Qos, Event)
175 public:
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 
187 class QTGSTREAMER_EXPORT SeekEvent : public Event
188 {
189  QGST_WRAPPER_FAKE_SUBCLASS(Seek, Event)
190 public:
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 
206 class QTGSTREAMER_EXPORT NavigationEvent : public Event
207 {
208  QGST_WRAPPER_FAKE_SUBCLASS(Navigation, Event)
209 public:
210  static NavigationEventPtr create(const Structure & structure = Structure());
211 };
212 
216 class QTGSTREAMER_EXPORT LatencyEvent : public Event
217 {
218  QGST_WRAPPER_FAKE_SUBCLASS(Latency, Event)
219 public:
220  static LatencyEventPtr create(ClockTime latency);
221 
222  ClockTime latency() const;
223 };
224 
228 class QTGSTREAMER_EXPORT StepEvent : public Event
229 {
230  QGST_WRAPPER_FAKE_SUBCLASS(Step, Event)
231 public:
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 
244 QGST_REGISTER_TYPE(QGst::Event)
245 QGST_REGISTER_SUBCLASS(Event, FlushStart)
246 QGST_REGISTER_SUBCLASS(Event, FlushStop)
247 QGST_REGISTER_SUBCLASS(Event, Eos)
248 QGST_REGISTER_SUBCLASS(Event, Caps)
249 QGST_REGISTER_SUBCLASS(Event, Segment)
250 QGST_REGISTER_SUBCLASS(Event, Tag)
251 QGST_REGISTER_SUBCLASS(Event, BufferSize)
252 QGST_REGISTER_SUBCLASS(Event, SinkMessage)
253 QGST_REGISTER_SUBCLASS(Event, Qos)
254 QGST_REGISTER_SUBCLASS(Event, Seek)
255 QGST_REGISTER_SUBCLASS(Event, Navigation)
256 QGST_REGISTER_SUBCLASS(Event, Latency)
257 QGST_REGISTER_SUBCLASS(Event, Step)
258 
259 #endif
Wrapper class for events of type QGst::FlushStartEvent.
Definition: event.h:77
Wrapper class for events of type QGst::EosEvent.
Definition: event.h:99
Wrapper class for events of type QGst::SegmentEvent.
Definition: event.h:121
Wrapper class for GstMiniObject.
Definition: miniobject.h:29
Wrapper class for events of type QGst::BufferSizeEvent.
Definition: event.h:145
Smart pointer class for working with wrapper classes that support reference counting.
Definition: global.h:56
Wrapper for GstStructure.
Definition: structure.h:49
A datatype to hold a time, measured in nanoseconds.
Definition: clocktime.h:37
Wrapper class for events of type QGst::QosEvent.
Definition: event.h:172
Wrapper for GstSegment.
Definition: segment.h:27
Wrapper class for GstEvent.
Definition: event.h:55
Wrapper class for events of type QGst::NavigationEvent.
Definition: event.h:206
Wrapper class for GstTagList.
Definition: taglist.h:70
Wrapper class for events of type QGst::TagEvent.
Definition: event.h:133
Wrapper class for events of type QGst::LatencyEvent.
Definition: event.h:216
Wrapper class for events of type QGst::FlushStopEvent.
Definition: event.h:87
Wrapper class for GstCaps.
Definition: caps.h:31
Wrapper class for events of type QGst::StepEvent.
Definition: event.h:228
Wrapper class for events of type QGst::SinkMessageEvent.
Definition: event.h:160
Wrapper class for events of type QGst::EventCaps.
Definition: event.h:109
Wrapper class for events of type QGst::SeekEvent.
Definition: event.h:187