21 #include <QtCore/QDebug>
26 ObjectPtr Event::source()
const
31 quint64 Event::timestamp()
const
33 return object<GstEvent>()->timestamp;
36 EventType Event::type()
const
38 return static_cast<EventType
>(GST_EVENT_TYPE(object<GstEvent>()));
41 QString Event::typeName()
const
43 return QString::fromUtf8(GST_EVENT_TYPE_NAME(object<GstQuery>()));
46 StructurePtr Event::internalStructure()
48 return SharedStructure::fromMiniObject(object<GstEvent>()->structure, MiniObjectPtr(
this));
51 quint32 Event::sequenceNumber()
const
53 return gst_event_get_seqnum(object<GstEvent>());
56 void Event::setSequenceNumber(quint32 num)
58 gst_event_set_seqnum(object<GstEvent>(), num);
61 EventPtr Event::copy()
const
68 FlushStartEventPtr FlushStartEvent::create()
75 FlushStopEventPtr FlushStopEvent::create()
82 EosEventPtr EosEvent::create()
89 NewSegmentEventPtr NewSegmentEvent::create(
bool update,
double rate,
double appliedRate,
90 Format format, qint64 start, qint64 stop, qint64 position)
92 GstEvent * e = gst_event_new_new_segment_full(update, rate, appliedRate,
93 static_cast<GstFormat>(format), start, stop,
99 bool NewSegmentEvent::isUpdate()
const
102 gst_event_parse_new_segment_full(object<GstEvent>(), &u, NULL, NULL, NULL, NULL, NULL, NULL);
106 double NewSegmentEvent::rate()
const
109 gst_event_parse_new_segment_full(object<GstEvent>(), NULL, &r, NULL, NULL, NULL, NULL, NULL);
113 double NewSegmentEvent::appliedRate()
const
116 gst_event_parse_new_segment_full(object<GstEvent>(), NULL, NULL, &r, NULL, NULL, NULL, NULL);
120 Format NewSegmentEvent::format()
const
123 gst_event_parse_new_segment_full(object<GstEvent>(), NULL, NULL, NULL, &f, NULL, NULL, NULL);
124 return static_cast<Format
>(f);
127 qint64 NewSegmentEvent::start()
const
130 gst_event_parse_new_segment_full(object<GstEvent>(), NULL, NULL, NULL, NULL, &s, NULL, NULL);
134 qint64 NewSegmentEvent::stop()
const
137 gst_event_parse_new_segment_full(object<GstEvent>(), NULL, NULL, NULL, NULL, NULL, &s, NULL);
141 qint64 NewSegmentEvent::position()
const
144 gst_event_parse_new_segment_full(object<GstEvent>(), NULL, NULL, NULL, NULL, NULL, NULL, &p);
150 TagEventPtr TagEvent::create(
const TagList & taglist)
152 GstEvent * e = gst_event_new_tag(gst_tag_list_copy(taglist));
156 TagList TagEvent::taglist()
const
159 gst_event_parse_tag(object<GstEvent>(), &t);
166 BufferSizeEventPtr BufferSizeEvent::create(Format format, qint64 minSize, qint64 maxSize,
169 GstEvent * e = gst_event_new_buffer_size(static_cast<GstFormat>(format), minSize, maxSize,
175 Format BufferSizeEvent::format()
const
178 gst_event_parse_buffer_size(object<GstEvent>(), &f, NULL, NULL, NULL);
179 return static_cast<Format
>(f);
182 qint64 BufferSizeEvent::minSize()
const
185 gst_event_parse_buffer_size(object<GstEvent>(), NULL, &s, NULL, NULL);
189 qint64 BufferSizeEvent::maxSize()
const
192 gst_event_parse_buffer_size(object<GstEvent>(), NULL, NULL, &s, NULL);
196 bool BufferSizeEvent::isAsync()
const
199 gst_event_parse_buffer_size(object<GstEvent>(), NULL, NULL, NULL, &u);
205 SinkMessageEventPtr SinkMessageEvent::create(
const MessagePtr & msg)
207 GstEvent * e = gst_event_new_sink_message(msg);
211 MessagePtr SinkMessageEvent::message()
const
214 gst_event_parse_sink_message(object<GstEvent>(), &msg);
221 QosEventPtr QosEvent::create(
double proportion, ClockTimeDiff diff, ClockTime timeStamp)
223 GstEvent * e = gst_event_new_qos(proportion, diff, static_cast<GstClockTime>(timeStamp));
227 double QosEvent::proportion()
const
230 gst_event_parse_qos(object<GstEvent>(), &d, NULL, NULL);
234 ClockTimeDiff QosEvent::diff()
const
237 gst_event_parse_qos(object<GstEvent>(), NULL, &c, NULL);
241 ClockTime QosEvent::timestamp()
const
244 gst_event_parse_qos(object<GstEvent>(), NULL, NULL, &c);
250 SeekEventPtr SeekEvent::create(
double rate, Format format, SeekFlags flags, SeekType startType,
251 qint64 start, SeekType stopType, qint64 stop)
253 GstEvent * e = gst_event_new_seek(rate, static_cast<GstFormat>(format),
254 static_cast<GstSeekFlags>(static_cast<int>(flags)),
255 static_cast<GstSeekType>(startType), start,
256 static_cast<GstSeekType>(stopType), stop );
260 double SeekEvent::rate()
const
263 gst_event_parse_seek(object<GstEvent>(), &d, NULL, NULL, NULL, NULL, NULL, NULL);
267 Format SeekEvent::format()
const
270 gst_event_parse_seek(object<GstEvent>(), NULL, &f, NULL, NULL, NULL, NULL, NULL);
271 return static_cast<Format
>(f);
274 SeekFlags SeekEvent::flags()
const
277 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, &f, NULL, NULL, NULL, NULL);
278 return static_cast<SeekFlags
>(f);
281 SeekType SeekEvent::startType()
const
284 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, &t, NULL, NULL, NULL);
285 return static_cast<SeekType
>(t);
288 qint64 SeekEvent::start()
const
291 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, NULL, &s, NULL, NULL);
295 SeekType SeekEvent::stopType()
const
298 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, NULL, NULL, &t, NULL);
299 return static_cast<SeekType
>(t);
302 qint64 SeekEvent::stop()
const
305 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, NULL, NULL, NULL, &s);
311 NavigationEventPtr NavigationEvent::create(
const Structure & structure)
313 GstStructure * s = structure.isValid() ? gst_structure_copy(structure) : NULL;
314 GstEvent * e = gst_event_new_navigation(s);
320 LatencyEventPtr LatencyEvent::create(ClockTime latency)
322 GstEvent * e = gst_event_new_latency(latency);
326 ClockTime LatencyEvent::latency()
const
329 gst_event_parse_latency(object<GstEvent>(), &c);
335 StepEventPtr StepEvent::create(Format format, quint64 amount,
double rate,
bool flush,
338 GstEvent * e = gst_event_new_step(static_cast<GstFormat>(format), amount, rate, flush,
343 Format StepEvent::format()
const
346 gst_event_parse_step(object<GstEvent>(), &f, NULL, NULL, NULL, NULL);
347 return static_cast<Format
>(f);
350 quint64 StepEvent::amount()
const
353 gst_event_parse_step(object<GstEvent>(), NULL, &a, NULL, NULL, NULL);
357 double StepEvent::rate()
const
360 gst_event_parse_step(object<GstEvent>(), NULL, NULL, &d, NULL, NULL);
365 bool StepEvent::flush()
const
368 gst_event_parse_step(object<GstEvent>(), NULL, NULL, NULL, &f, NULL);
372 bool StepEvent::intermediate()
const
375 gst_event_parse_step(object<GstEvent>(), NULL, NULL, NULL, NULL, &i);