23 #include <QtCore/QDebug>
28 quint64 Event::timestamp()
const
30 return object<GstEvent>()->timestamp;
33 EventType Event::type()
const
35 return static_cast<EventType
>(GST_EVENT_TYPE(object<GstEvent>()));
38 QString Event::typeName()
const
40 return QString::fromUtf8(GST_EVENT_TYPE_NAME(object<GstEvent>()));
43 StructureConstPtr Event::internalStructure()
45 const GstStructure *structure = gst_event_get_structure(object<GstEvent>());
46 return SharedStructure::fromMiniObject(const_cast<GstStructure *>(structure), MiniObjectPtr(
this));
49 bool Event::hasName(
const char *name)
const
51 return gst_event_has_name(object<GstEvent>(), name);
54 quint32 Event::sequenceNumber()
const
56 return gst_event_get_seqnum(object<GstEvent>());
59 void Event::setSequenceNumber(quint32 num)
61 gst_event_set_seqnum(object<GstEvent>(), num);
64 EventPtr Event::copy()
const
71 FlushStartEventPtr FlushStartEvent::create()
78 FlushStopEventPtr FlushStopEvent::create(
bool reset_time)
83 bool FlushStopEvent::resetTime()
const
86 gst_event_parse_flush_stop(object<GstEvent>(), &r);
92 EosEventPtr EosEvent::create()
98 CapsEventPtr CapsEvent::create(
const CapsPtr &caps)
103 CapsPtr CapsEvent::caps()
const
106 gst_event_parse_caps (object<GstEvent>(), &c);
112 SegmentEventPtr SegmentEvent::create(
const Segment & segment)
117 Segment SegmentEvent::segment()
const
120 gst_event_parse_segment(object<GstEvent>(), &s);
126 TagEventPtr TagEvent::create(
const TagList & taglist)
128 GstEvent * e = gst_event_new_tag(gst_tag_list_copy(taglist));
132 TagList TagEvent::taglist()
const
135 gst_event_parse_tag(object<GstEvent>(), &t);
142 BufferSizeEventPtr BufferSizeEvent::create(Format format, qint64 minSize, qint64 maxSize,
145 GstEvent * e = gst_event_new_buffer_size(static_cast<GstFormat>(format), minSize, maxSize,
151 Format BufferSizeEvent::format()
const
154 gst_event_parse_buffer_size(object<GstEvent>(), &f, NULL, NULL, NULL);
155 return static_cast<Format
>(f);
158 qint64 BufferSizeEvent::minSize()
const
161 gst_event_parse_buffer_size(object<GstEvent>(), NULL, &s, NULL, NULL);
165 qint64 BufferSizeEvent::maxSize()
const
168 gst_event_parse_buffer_size(object<GstEvent>(), NULL, NULL, &s, NULL);
172 bool BufferSizeEvent::isAsync()
const
175 gst_event_parse_buffer_size(object<GstEvent>(), NULL, NULL, NULL, &u);
181 SinkMessageEventPtr SinkMessageEvent::create(
const QString &name,
const MessagePtr & msg)
183 GstEvent * e = gst_event_new_sink_message(name.toUtf8().constData(), msg);
187 MessagePtr SinkMessageEvent::message()
const
190 gst_event_parse_sink_message(object<GstEvent>(), &msg);
197 QosEventPtr QosEvent::create(QosType qos,
double proportion, ClockTimeDiff diff, ClockTime timeStamp)
199 GstEvent * e = gst_event_new_qos(static_cast<GstQOSType>(qos), proportion, diff, static_cast<GstClockTime>(timeStamp));
203 QosType QosEvent::qosType()
const
206 gst_event_parse_qos(object<GstEvent>(), &t, NULL, NULL, NULL);
207 return static_cast<QosType
>(t);
210 double QosEvent::proportion()
const
213 gst_event_parse_qos(object<GstEvent>(), NULL, &d, NULL, NULL);
217 ClockTimeDiff QosEvent::diff()
const
220 gst_event_parse_qos(object<GstEvent>(), NULL, NULL, &c, NULL);
224 ClockTime QosEvent::timestamp()
const
227 gst_event_parse_qos(object<GstEvent>(), NULL, NULL, NULL, &c);
233 SeekEventPtr SeekEvent::create(
double rate, Format format, SeekFlags flags, SeekType startType,
234 qint64 start, SeekType stopType, qint64 stop)
236 GstEvent * e = gst_event_new_seek(rate, static_cast<GstFormat>(format),
237 static_cast<GstSeekFlags>(static_cast<int>(flags)),
238 static_cast<GstSeekType>(startType), start,
239 static_cast<GstSeekType>(stopType), stop );
243 double SeekEvent::rate()
const
246 gst_event_parse_seek(object<GstEvent>(), &d, NULL, NULL, NULL, NULL, NULL, NULL);
250 Format SeekEvent::format()
const
253 gst_event_parse_seek(object<GstEvent>(), NULL, &f, NULL, NULL, NULL, NULL, NULL);
254 return static_cast<Format
>(f);
257 SeekFlags SeekEvent::flags()
const
260 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, &f, NULL, NULL, NULL, NULL);
261 return static_cast<SeekFlags
>(f);
264 SeekType SeekEvent::startType()
const
267 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, &t, NULL, NULL, NULL);
268 return static_cast<SeekType
>(t);
271 qint64 SeekEvent::start()
const
274 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, NULL, &s, NULL, NULL);
278 SeekType SeekEvent::stopType()
const
281 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, NULL, NULL, &t, NULL);
282 return static_cast<SeekType
>(t);
285 qint64 SeekEvent::stop()
const
288 gst_event_parse_seek(object<GstEvent>(), NULL, NULL, NULL, NULL, NULL, NULL, &s);
294 NavigationEventPtr NavigationEvent::create(
const Structure & structure)
296 GstStructure * s = structure.isValid() ? gst_structure_copy(structure) : NULL;
297 GstEvent * e = gst_event_new_navigation(s);
303 LatencyEventPtr LatencyEvent::create(ClockTime latency)
305 GstEvent * e = gst_event_new_latency(latency);
309 ClockTime LatencyEvent::latency()
const
312 gst_event_parse_latency(object<GstEvent>(), &c);
318 StepEventPtr StepEvent::create(Format format, quint64 amount,
double rate,
bool flush,
321 GstEvent * e = gst_event_new_step(static_cast<GstFormat>(format), amount, rate, flush,
326 Format StepEvent::format()
const
329 gst_event_parse_step(object<GstEvent>(), &f, NULL, NULL, NULL, NULL);
330 return static_cast<Format
>(f);
333 quint64 StepEvent::amount()
const
336 gst_event_parse_step(object<GstEvent>(), NULL, &a, NULL, NULL, NULL);
340 double StepEvent::rate()
const
343 gst_event_parse_step(object<GstEvent>(), NULL, NULL, &d, NULL, NULL);
348 bool StepEvent::flush()
const
351 gst_event_parse_step(object<GstEvent>(), NULL, NULL, NULL, &f, NULL);
355 bool StepEvent::intermediate()
const
358 gst_event_parse_step(object<GstEvent>(), NULL, NULL, NULL, NULL, &i);
static RefPointer< T > wrap(typename T::CType *nativePtr, bool increaseRef=true)