| 1 |
/* gstreamermm - a C++ wrapper for gstreamer |
| 2 |
* |
| 3 |
* Copyright 2008-2016 The gstreamermm Development Team |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library 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 GNU |
| 13 |
* Lesser General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, write to the Free |
| 17 |
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <gst/gst.h> |
| 21 |
#include <gstreamermm/miniobject.h> |
| 22 |
#include <gstreamermm/format.h> |
| 23 |
#include <gstreamermm/clock.h> |
| 24 |
#include <gstreamermm/segment.h> |
| 25 |
#include <gstreamermm/caps.h> |
| 26 |
|
| 27 |
_DEFS(gstreamermm,gst) |
| 28 |
|
| 29 |
namespace Glib |
| 30 |
{ |
| 31 |
template<typename T> |
| 32 |
Glib::RefPtr<T> wrap_event_derived(GstEvent* object, bool take_copy) |
| 33 |
{ |
| 34 |
if(take_copy && object) |
| 35 |
gst_event_ref(object); |
| 36 |
|
| 37 |
// See the comment at the top of this file, if you want to know why the cast works. |
| 38 |
return Glib::RefPtr<T>(reinterpret_cast<T*>(object)); |
| 39 |
} |
| 40 |
|
| 41 |
} |
| 42 |
|
| 43 |
namespace Gst |
| 44 |
{ |
| 45 |
|
| 46 |
#define GST_EVENT_MAKE_TYPE(num,flags) \ |
| 47 |
(((num) << GST_EVENT_NUM_SHIFT) | (flags)) |
| 48 |
|
| 49 |
#define FLAG(name) GST_EVENT_TYPE_##name |
| 50 |
|
| 51 |
_WRAP_ENUM(EventType, GstEventType) |
| 52 |
_WRAP_ENUM(EventTypeFlags, GstEventTypeFlags) |
| 53 |
_WRAP_ENUM(QOSType, GstQOSType) |
| 54 |
_WRAP_ENUM(StreamFlags, GstStreamFlags) |
| 55 |
|
| 56 |
#undef FLAG |
| 57 |
|
| 58 |
class Message; |
| 59 |
class Structure; |
| 60 |
class TagList; |
| 61 |
class Buffer; |
| 62 |
class Toc; |
| 63 |
|
| 64 |
namespace Enums |
| 65 |
{ |
| 66 |
|
| 67 |
/** Gets a printable name for the given event type. |
| 68 |
* |
| 69 |
* @param type The event type. |
| 70 |
* @return A reference to the static name of the event. |
| 71 |
*/ |
| 72 |
Glib::ustring get_name(EventType type); |
| 73 |
|
| 74 |
/** Gets the unique quark for the given event type. |
| 75 |
* |
| 76 |
* @param type The event type. |
| 77 |
* @return The quark associated with the event type. |
| 78 |
*/ |
| 79 |
Glib::QueryQuark get_quark(EventType type); |
| 80 |
|
| 81 |
/** Gets the Gst::EventTypeFlags associated with type. |
| 82 |
* @param type A Gst::EventType. |
| 83 |
* @return A Gst::EventTypeFlags. |
| 84 |
*/ |
| 85 |
EventTypeFlags get_flags(EventType type); |
| 86 |
|
| 87 |
} //namespace Enums |
| 88 |
|
| 89 |
/** A class that represents events that are passed up and down a pipeline. |
| 90 |
* The event class provides factory methods to construct and functions query |
| 91 |
* (parse) events. |
| 92 |
* |
| 93 |
* Events are usually created by using the Gst::Event derrived classes' |
| 94 |
* create() methods. To send an event application will usually use |
| 95 |
* Gst::Element::send_event() and elements will use Gst::Pad::send_event() or |
| 96 |
* Gst::Pad::push_event(). |
| 97 |
* |
| 98 |
* Events that have been received can be parsed with their respective parse() |
| 99 |
* functions. |
| 100 |
* |
| 101 |
* Events are passed between elements in parallel to the data stream. Some |
| 102 |
* events are serialized with buffers, others are not. Some events only travel |
| 103 |
* downstream, others only upstream. Some events can travel both upstream and |
| 104 |
* downstream. |
| 105 |
* |
| 106 |
* The events are used to signal special conditions in the datastream such as |
| 107 |
* EOS (end of stream) or the start of a new stream-segment. Events are also |
| 108 |
* used to flush the pipeline of any pending data. |
| 109 |
* |
| 110 |
* Most of the event API is used inside plugins. Applications usually only |
| 111 |
* construct and use seek events. To do that Gst::EventSeek::create() is used |
| 112 |
* to create a seek event. It takes the needed parameters to specity seeking |
| 113 |
* time and mode. The event is then sent to the element like so: |
| 114 |
* @code |
| 115 |
* pipeline->send_event(event); |
| 116 |
* @endcode |
| 117 |
*/ |
| 118 |
class Event : public MiniObject |
| 119 |
{ |
| 120 |
_CLASS_OPAQUE_REFCOUNTED(Event, GstEvent, NONE, gst_event_ref, gst_event_unref) |
| 121 |
_IGNORE(gst_event_ref, gst_event_unref) |
| 122 |
|
| 123 |
public: |
| 124 |
// A copy is taken so that the original is not freed by the wrapper. |
| 125 |
#m4 _CONVERSION(`const GstStructure*',`Gst::Structure',`Glib::wrap(const_cast<GstStructure*>($3), true)') |
| 126 |
_WRAP_METHOD(Gst::Structure get_structure() const, gst_event_get_structure) |
| 127 |
|
| 128 |
_WRAP_METHOD(bool has_name(const Glib::ustring& name) const, gst_event_has_name) |
| 129 |
|
| 130 |
_WRAP_METHOD(guint32 get_seqnum() const, gst_event_get_seqnum) |
| 131 |
_WRAP_METHOD(void set_seqnum(guint32 seqnum), gst_event_set_seqnum) |
| 132 |
|
| 133 |
_WRAP_METHOD(gint64 get_running_time_offset() const, gst_event_get_running_time_offset) |
| 134 |
_WRAP_METHOD(void set_running_time_offset(gint64 offset), gst_event_set_running_time_offset) |
| 135 |
|
| 136 |
_WRAP_METHOD(Glib::RefPtr<Gst::Event> copy() const, gst_event_copy) |
| 137 |
|
| 138 |
/** |
| 139 |
* Makes a writable event from the given event. If the source event is |
| 140 |
* already writable, this will simply return the same event. |
| 141 |
* @return A Gst::Event (possibly the same reference) that is writable. |
| 142 |
*/ |
| 143 |
Glib::RefPtr<Gst::Event> create_writable(); |
| 144 |
|
| 145 |
/** Check if an event can travel downstream. |
| 146 |
*/ |
| 147 |
bool is_downstream() const; |
| 148 |
|
| 149 |
/** Check if an event is serialized with the data stream. |
| 150 |
*/ |
| 151 |
bool is_serialized() const; |
| 152 |
|
| 153 |
/** Check if an event can travel upstream. |
| 154 |
*/ |
| 155 |
bool is_upstream() const; |
| 156 |
|
| 157 |
/** Get the Gst::EventType of the event. |
| 158 |
*/ |
| 159 |
_MEMBER_GET(event_type, type, EventType, GstEventType) |
| 160 |
|
| 161 |
/** Get the Gst::ClockTime timestamp of the event. This is the time when the |
| 162 |
* event was created. |
| 163 |
*/ |
| 164 |
_MEMBER_GET(timestamp, timestamp, Gst::ClockTime, guint64) |
| 165 |
}; |
| 166 |
|
| 167 |
/** A flush start event. See create() for more details. |
| 168 |
*/ |
| 169 |
class EventFlushStart : public Event |
| 170 |
{ |
| 171 |
_CLASS_GENERIC(EventFlushStart, GstEvent) |
| 172 |
public: |
| 173 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventFlushStart>',`Glib::wrap_event_derived<EventFlushStart>($3, false)') |
| 174 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventFlushStart> create(), gst_event_new_flush_start) |
| 175 |
}; |
| 176 |
|
| 177 |
/** A flush stop event. See create() for more details. |
| 178 |
*/ |
| 179 |
class EventFlushStop : public Event |
| 180 |
{ |
| 181 |
_CLASS_GENERIC(EventFlushStop, GstEvent) |
| 182 |
public: |
| 183 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventFlushStop>',`Glib::wrap_event_derived<EventFlushStop>($3, false)') |
| 184 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventFlushStop> create(bool reset_time), gst_event_new_flush_stop) |
| 185 |
|
| 186 |
/** Retrieve a reset time member. |
| 187 |
* @return TRUE, if time should be reset; FALSE, otherwise. |
| 188 |
*/ |
| 189 |
bool parse_reset_time() const; |
| 190 |
_IGNORE(gst_event_parse_flush_stop) |
| 191 |
}; |
| 192 |
|
| 193 |
/** A stream-start event. See create() for more details. |
| 194 |
*/ |
| 195 |
class EventStreamStart : public Event |
| 196 |
{ |
| 197 |
_CLASS_GENERIC(EventStreamStart, GstEvent) |
| 198 |
public: |
| 199 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventStreamStart>',`Glib::wrap_event_derived<EventStreamStart>($3, false)') |
| 200 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventStreamStart> create(const Glib::ustring& stream_id), gst_event_new_stream_start) |
| 201 |
|
| 202 |
/** Parse a stream-id event. |
| 203 |
* |
| 204 |
* @return A stream id. |
| 205 |
*/ |
| 206 |
Glib::ustring parse_stream_id() const; |
| 207 |
_IGNORE(gst_event_parse_stream_start) |
| 208 |
|
| 209 |
_WRAP_METHOD(void set_stream_flags(Gst::StreamFlags flags), gst_event_set_stream_flags) |
| 210 |
|
| 211 |
/** Parse a stream flag. |
| 212 |
* |
| 213 |
* @return A stream flags. |
| 214 |
*/ |
| 215 |
Gst::StreamFlags parse_stream_flags() const; |
| 216 |
_IGNORE(gst_event_parse_stream_flags) |
| 217 |
|
| 218 |
_WRAP_METHOD(bool parse_group_id(guint& group_id) const, gst_event_parse_group_id) |
| 219 |
_WRAP_METHOD(void set_group_id(guint group_id), gst_event_set_group_id) |
| 220 |
}; |
| 221 |
|
| 222 |
/** A caps event. See create() for more details. |
| 223 |
*/ |
| 224 |
class EventCaps : public Event |
| 225 |
{ |
| 226 |
_CLASS_GENERIC(EventCaps, GstEvent) |
| 227 |
public: |
| 228 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventCaps>',`Glib::wrap_event_derived<EventCaps>($3, false)') |
| 229 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventCaps> create(const Glib::RefPtr<Gst::Caps>& caps), gst_event_new_caps) |
| 230 |
|
| 231 |
/** Get the caps from @a event. The caps remains valid as long as @a event remains |
| 232 |
* valid. |
| 233 |
* |
| 234 |
* @return A caps object. |
| 235 |
*/ |
| 236 |
Glib::RefPtr<Gst::Caps> parse_caps(); |
| 237 |
_IGNORE(gst_event_parse_caps) |
| 238 |
|
| 239 |
/** Get the caps from @a event. The caps remains valid as long as @a event remains |
| 240 |
* valid. |
| 241 |
* |
| 242 |
* @return A caps object. |
| 243 |
*/ |
| 244 |
Glib::RefPtr<const Gst::Caps> parse_caps() const; |
| 245 |
}; |
| 246 |
|
| 247 |
/** A segment event. See create() for more details. |
| 248 |
*/ |
| 249 |
class EventSegment : public Event |
| 250 |
{ |
| 251 |
_CLASS_GENERIC(EventSegment, GstEvent) |
| 252 |
public: |
| 253 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventSegment>',`Glib::wrap_event_derived<EventSegment>($3, false)') |
| 254 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventSegment> create(const Gst::Segment& segment), gst_event_new_segment) |
| 255 |
|
| 256 |
/** Parses a segment event and copies the GstSegment. |
| 257 |
* |
| 258 |
* @return A copy of a Gst::Segment. |
| 259 |
*/ |
| 260 |
Gst::Segment copy_segment() const; |
| 261 |
_IGNORE(gst_event_copy_segment) |
| 262 |
_IGNORE(gst_event_parse_segment) |
| 263 |
}; |
| 264 |
|
| 265 |
/** A tag event. See create() for more details. |
| 266 |
*/ |
| 267 |
class EventTag : public Event |
| 268 |
{ |
| 269 |
_CLASS_GENERIC(EventTag, GstEvent) |
| 270 |
public: |
| 271 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventTag>',`Glib::wrap_event_derived<EventTag>($3, false)') |
| 272 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventTag> create(const Gst::TagList& taglist), gst_event_new_tag) |
| 273 |
|
| 274 |
/** Gets a tag list. |
| 275 |
* @return A Gst::TagList. |
| 276 |
*/ |
| 277 |
Gst::TagList parse_tag_list() const; |
| 278 |
_IGNORE(gst_event_parse_tag) |
| 279 |
}; |
| 280 |
|
| 281 |
/** A buffer size event. See create() for more details. |
| 282 |
*/ |
| 283 |
class EventBufferSize : public Event |
| 284 |
{ |
| 285 |
_CLASS_GENERIC(EventBufferSize, GstEvent) |
| 286 |
public: |
| 287 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventBufferSize>',`Glib::wrap_event_derived<EventBufferSize>($3, false)') |
| 288 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventBufferSize> create(Format format, gint64 minsize, gint64 maxsize, bool async), gst_event_new_buffer_size) |
| 289 |
|
| 290 |
/** Get the format, minsize, maxsize and async-flag in the buffersize event. |
| 291 |
* |
| 292 |
* @param format A reference to store the format in. |
| 293 |
* @param minsize A reference to store the minsize in. |
| 294 |
* @param maxsize A reference to store the maxsize in. |
| 295 |
* @param async A reference to store the async-flag in. |
| 296 |
*/ |
| 297 |
void parse(Format& format, gint64& minsize, gint64& maxsize, bool& async) const; |
| 298 |
_IGNORE(gst_event_parse_buffer_size) |
| 299 |
|
| 300 |
/** Get the minsize in the buffersize event. |
| 301 |
* |
| 302 |
* @return The mininum size. |
| 303 |
*/ |
| 304 |
gint64 parse_min_size() const; |
| 305 |
|
| 306 |
/** Get the format, in the buffersize event. |
| 307 |
* |
| 308 |
* @return The format. |
| 309 |
*/ |
| 310 |
Gst::Format parse_format() const; |
| 311 |
|
| 312 |
/** Get the maxsize in the buffersize event. |
| 313 |
* |
| 314 |
* @return The maximum size. |
| 315 |
*/ |
| 316 |
gint64 parse_max_size() const; |
| 317 |
|
| 318 |
/** Get the async-flag in the buffersize event. |
| 319 |
* |
| 320 |
* @return The async flag. |
| 321 |
*/ |
| 322 |
bool parse_async() const; |
| 323 |
}; |
| 324 |
|
| 325 |
/** A sink-message event. See create() for more details. |
| 326 |
*/ |
| 327 |
class EventSinkMessage : public Event |
| 328 |
{ |
| 329 |
_CLASS_GENERIC(EventSinkMessage, GstEvent) |
| 330 |
public: |
| 331 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventSinkMessage>',`Glib::wrap_event_derived<EventSinkMessage>($3, false)') |
| 332 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventSinkMessage> create(const Glib::ustring& name, const Glib::RefPtr<Gst::Message>& message), gst_event_new_sink_message) |
| 333 |
|
| 334 |
/** Parse the sink-message event. |
| 335 |
* @return the sink-messge's event message. |
| 336 |
*/ |
| 337 |
Glib::RefPtr<Gst::Message> parse_message(); |
| 338 |
_IGNORE(gst_event_parse_sink_message) |
| 339 |
|
| 340 |
/** Parse the sink-message event. |
| 341 |
* @return the sink-messge's event message. |
| 342 |
*/ |
| 343 |
Glib::RefPtr<const Gst::Message> parse_message() const; |
| 344 |
}; |
| 345 |
|
| 346 |
/** An end of stream event. See create() for more details. |
| 347 |
*/ |
| 348 |
class EventEos : public Event |
| 349 |
{ |
| 350 |
_CLASS_GENERIC(EventEos, GstEvent) |
| 351 |
public: |
| 352 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventEos>',`Glib::wrap_event_derived<EventEos>($3, false)') |
| 353 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventEos> create(), gst_event_new_eos) |
| 354 |
}; |
| 355 |
|
| 356 |
/** A new table of content event. See create() for more details. |
| 357 |
*/ |
| 358 |
class EventToc : public Event |
| 359 |
{ |
| 360 |
_CLASS_GENERIC(EventToc, GstEvent) |
| 361 |
public: |
| 362 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventToc>',`Glib::wrap_event_derived<EventToc>($3, false)') |
| 363 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventToc> create(const Glib::RefPtr<Gst::Toc>& toc, bool updated), gst_event_new_toc) |
| 364 |
|
| 365 |
/** Parse a TOC event and store the results in the given toc and updated locations. |
| 366 |
* |
| 367 |
* @param toc A Gst::Toc structure. |
| 368 |
* @param updated A TOC update flag. |
| 369 |
*/ |
| 370 |
void parse(Glib::RefPtr<Gst::Toc>& toc, bool& updated); |
| 371 |
_IGNORE(gst_event_parse_toc) |
| 372 |
|
| 373 |
/** Parse a TOC event and store the results in the given toc and updated locations. |
| 374 |
* |
| 375 |
* @param toc A Gst::Toc structure. |
| 376 |
* @param updated A TOC update flag. |
| 377 |
*/ |
| 378 |
void parse(Glib::RefPtr<const Gst::Toc>& toc, bool& updated) const; |
| 379 |
|
| 380 |
/** Parse a Toc structure. |
| 381 |
* |
| 382 |
* @return A Gst::Toc structure. |
| 383 |
*/ |
| 384 |
Glib::RefPtr<Gst::Toc> parse_toc(); |
| 385 |
|
| 386 |
/** Parse a Toc structure. |
| 387 |
* |
| 388 |
* @return A Gst::Toc structure. |
| 389 |
*/ |
| 390 |
Glib::RefPtr<const Gst::Toc> parse_toc() const; |
| 391 |
|
| 392 |
/** Parse a TOC update flag. |
| 393 |
* |
| 394 |
* @return A TOC update flag. |
| 395 |
*/ |
| 396 |
bool parse_updated() const; |
| 397 |
}; |
| 398 |
|
| 399 |
/** A protection event. See create() for more details. |
| 400 |
*/ |
| 401 |
class EventProtection : public Event |
| 402 |
{ |
| 403 |
_CLASS_GENERIC(EventProtection, GstEvent) |
| 404 |
public: |
| 405 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventProtection>',`Glib::wrap_event_derived<EventProtection>($3, false)') |
| 406 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventProtection> create(const Glib::ustring& system_id, const Glib::RefPtr<Gst::Buffer>& data, |
| 407 |
const Glib::ustring& origin), gst_event_new_protection) |
| 408 |
|
| 409 |
/** |
| 410 |
* Parses an event containing protection system specific information and stores the results in system_id, data and origin. |
| 411 |
* |
| 412 |
* @param system_id Result location for the UUID string uniquely identifying a content protection system. |
| 413 |
* @param data Result location for the Gst::Buffer holding protection system specific information. |
| 414 |
* @param origin Result location for the value that indicates where the protection information carried by event was extracted from. |
| 415 |
*/ |
| 416 |
void parse(Glib::ustring& system_id, Glib::RefPtr<Gst::Buffer>& data, Glib::ustring& origin) const; |
| 417 |
_IGNORE(gst_event_parse_protection) |
| 418 |
|
| 419 |
/** Parse UUID of the protection event. |
| 420 |
* @return The UUID. |
| 421 |
*/ |
| 422 |
Glib::ustring parse_system_id() const; |
| 423 |
|
| 424 |
/** Parse data of the protection event. |
| 425 |
* @return The data. |
| 426 |
*/ |
| 427 |
Glib::RefPtr<Gst::Buffer> parse_data(); |
| 428 |
|
| 429 |
/** Parse data of the protection event. |
| 430 |
* @return The data. |
| 431 |
*/ |
| 432 |
Glib::RefPtr<const Gst::Buffer> parse_data() const; |
| 433 |
|
| 434 |
/** Parse origin of the protection event. |
| 435 |
* @return The origin. |
| 436 |
*/ |
| 437 |
Glib::ustring parse_origin() const; |
| 438 |
}; |
| 439 |
|
| 440 |
/** A segment done event. See create() for more details. |
| 441 |
*/ |
| 442 |
class EventSegmentDone : public Event |
| 443 |
{ |
| 444 |
_CLASS_GENERIC(EventSegmentDone, GstEvent) |
| 445 |
public: |
| 446 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventSegmentDone>',`Glib::wrap_event_derived<EventSegmentDone>($3, false)') |
| 447 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventSegmentDone> create(Gst::Format, gint64 position), gst_event_new_segment_done) |
| 448 |
|
| 449 |
/** |
| 450 |
* Extracts the position and format from the segment done event. |
| 451 |
* |
| 452 |
* @param format Result location for the format. |
| 453 |
* @param position Result location for the position. |
| 454 |
*/ |
| 455 |
void parse(Gst::Format& format, gint64& position) const; |
| 456 |
_IGNORE(gst_event_parse_segment_done) |
| 457 |
|
| 458 |
/** Parse format of the segment done event. |
| 459 |
* @return The format. |
| 460 |
*/ |
| 461 |
Gst::Format parse_format() const; |
| 462 |
|
| 463 |
/** Parse position of the segment done event. |
| 464 |
* @return The position. |
| 465 |
*/ |
| 466 |
gint64 parse_position() const; |
| 467 |
}; |
| 468 |
|
| 469 |
/** A gap in the stream event. See create() for more details. |
| 470 |
*/ |
| 471 |
class EventGap : public Event |
| 472 |
{ |
| 473 |
_CLASS_GENERIC(EventGap, GstEvent) |
| 474 |
public: |
| 475 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventGap>',`Glib::wrap_event_derived<EventGap>($3, false)') |
| 476 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventGap> create(Gst::ClockTime timestamp, Gst::ClockTime duration), gst_event_new_gap) |
| 477 |
|
| 478 |
/** |
| 479 |
* Extract timestamp and duration from a new GAP event. |
| 480 |
* |
| 481 |
* @param timestamp Location where to store the start time (pts) of the gap. |
| 482 |
* @param duration Location where to store the duration of the gap. |
| 483 |
*/ |
| 484 |
void parse(Gst::ClockTime& timestamp, Gst::ClockTime& duration) const; |
| 485 |
_IGNORE(gst_event_parse_gap) |
| 486 |
|
| 487 |
/** Parse timestamp of the gap event. |
| 488 |
* @return The timestamp. |
| 489 |
*/ |
| 490 |
Gst::ClockTime parse_timestamp() const; |
| 491 |
|
| 492 |
/** Parse duration of the gap event. |
| 493 |
* @return The duration. |
| 494 |
*/ |
| 495 |
Gst::ClockTime parse_duration() const; |
| 496 |
}; |
| 497 |
|
| 498 |
/** A QOS event. See create() for more details. |
| 499 |
*/ |
| 500 |
class EventQos : public Event |
| 501 |
{ |
| 502 |
_CLASS_GENERIC(EventQos, GstEvent) |
| 503 |
public: |
| 504 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventQos>',`Glib::wrap_event_derived<EventQos>($3, false)') |
| 505 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventQos> create(QOSType type, double proportion, Gst::ClockTimeDiff diff, Gst::ClockTime timestamp), gst_event_new_qos) |
| 506 |
|
| 507 |
/** |
| 508 |
* Gets the type, proportion, diff and timestamp from the qos event. |
| 509 |
* |
| 510 |
* @param type A pointer to store the QoS type in. |
| 511 |
* @param proportion A pointer to store the proportion in. |
| 512 |
* @param diff A pointer to store the diff in. |
| 513 |
* @param timestamp A pointer to store the timestamp in. |
| 514 |
*/ |
| 515 |
void parse(QOSType& type, double& proportion, Gst::ClockTimeDiff& diff, Gst::ClockTime& timestamp) const; |
| 516 |
_IGNORE(gst_event_parse_qos) |
| 517 |
|
| 518 |
/** Get the QoS type. See create() for more information |
| 519 |
* about the different QoS values. |
| 520 |
* |
| 521 |
* @return The QoS type. |
| 522 |
*/ |
| 523 |
QOSType parse_type() const; |
| 524 |
|
| 525 |
/** Get the proportion in the qos event. See create() for more information |
| 526 |
* about the different QoS values. |
| 527 |
* |
| 528 |
* @return The proportion. |
| 529 |
*/ |
| 530 |
double parse_proportion() const; |
| 531 |
|
| 532 |
/** Get the diff in the qos event. See create() for more information about |
| 533 |
* the different QoS values. |
| 534 |
* |
| 535 |
* @return The difference. |
| 536 |
*/ |
| 537 |
Gst::ClockTimeDiff parse_diff() const; |
| 538 |
|
| 539 |
/** Get the timestamp in the qos event. See create() for more information |
| 540 |
* about the different QoS values. |
| 541 |
* @return The timestamp. |
| 542 |
*/ |
| 543 |
Gst::ClockTime parse_timestamp() const; |
| 544 |
}; |
| 545 |
|
| 546 |
/** A seek event. See create() for more details. |
| 547 |
*/ |
| 548 |
class EventSeek : public Event |
| 549 |
{ |
| 550 |
_CLASS_GENERIC(EventSeek, GstEvent) |
| 551 |
public: |
| 552 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventSeek>',`Glib::wrap_event_derived<EventSeek>($3, false)') |
| 553 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventSeek> create(double rate, Format format, |
| 554 |
SeekFlags flags, SeekType start_type, gint64 start, SeekType stop_type, gint64 stop), gst_event_new_seek) |
| 555 |
|
| 556 |
/** Parses a seek event and stores the results in the given result locations. |
| 557 |
* |
| 558 |
* @param rate Result location for the rate. |
| 559 |
* @param format Result location for the stream format. |
| 560 |
* @param flags Result location for the Gst::SeekFlags. |
| 561 |
* @param start_type Result location for the Gst::SeekType of the start |
| 562 |
* position. |
| 563 |
* @param start Result location for the start postion expressed in format. |
| 564 |
* @param stop_type Result location for the Gst::SeekType of the stop |
| 565 |
* position. |
| 566 |
* @param stop Result location for the stop postion expressed in format. |
| 567 |
*/ |
| 568 |
void parse(double& rate, Format& format, SeekFlags& flags, |
| 569 |
SeekType& start_type, gint64& start, SeekType& stop_type, |
| 570 |
gint64& stop) const; |
| 571 |
_IGNORE(gst_event_parse_seek) |
| 572 |
|
| 573 |
/** Parses the start of a seek event. |
| 574 |
* @return The start. |
| 575 |
*/ |
| 576 |
gint64 parse_start() const; |
| 577 |
|
| 578 |
/** Parses the rate of a seek event. |
| 579 |
* @return The rate. |
| 580 |
*/ |
| 581 |
double parse_rate() const; |
| 582 |
|
| 583 |
/** Parses the format of a seek event. |
| 584 |
* @return The format. |
| 585 |
*/ |
| 586 |
Format parse_format() const; |
| 587 |
|
| 588 |
/** Parses the flags of a seek event. |
| 589 |
* @return The flags. |
| 590 |
*/ |
| 591 |
SeekFlags parse_flags() const; |
| 592 |
|
| 593 |
/** Parses the start type of a seek event. |
| 594 |
* @return The start type. |
| 595 |
*/ |
| 596 |
SeekType parse_start_type() const; |
| 597 |
|
| 598 |
/** Parses the stop type of a seek event. |
| 599 |
* @return The stop type. |
| 600 |
*/ |
| 601 |
SeekType parse_stop_type() const; |
| 602 |
|
| 603 |
/** Parses the stop of a seek event. |
| 604 |
* @return The stop. |
| 605 |
*/ |
| 606 |
gint64 parse_stop() const; |
| 607 |
}; |
| 608 |
|
| 609 |
/** A latency event. See create() for more details. |
| 610 |
*/ |
| 611 |
class EventLatency : public Event |
| 612 |
{ |
| 613 |
_CLASS_GENERIC(EventLatency, GstEvent) |
| 614 |
public: |
| 615 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventLatency>',`Glib::wrap_event_derived<EventLatency>($3, false)') |
| 616 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventLatency> create(Gst::ClockTime latency), gst_event_new_latency) |
| 617 |
|
| 618 |
/** Get the latency in the latency event. |
| 619 |
* |
| 620 |
* @return The latency. |
| 621 |
*/ |
| 622 |
Gst::ClockTime parse_latency() const; |
| 623 |
_IGNORE(gst_event_parse_latency) |
| 624 |
}; |
| 625 |
|
| 626 |
/** A step event. See create() for more details. |
| 627 |
*/ |
| 628 |
class EventStep : public Event |
| 629 |
{ |
| 630 |
_CLASS_GENERIC(EventStep, GstEvent) |
| 631 |
public: |
| 632 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventStep>',`Glib::wrap_event_derived<EventStep>($3, false)') |
| 633 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventStep> create(Gst::Format format, guint64 amount, |
| 634 |
double rate, bool flush, bool intermediate), gst_event_new_step) |
| 635 |
|
| 636 |
/** Parse the step event. |
| 637 |
* |
| 638 |
* @param format A reference to store the format in. |
| 639 |
* @param amount A reference to store the amount in. |
| 640 |
* @param rate A reference to store the rate in. |
| 641 |
* @param flush A reference to store the flush boolean in. |
| 642 |
* @param intermediate A reference to store the intermediate boolean in. |
| 643 |
*/ |
| 644 |
void parse(Gst::Format& format, guint64& amount, double& rate, |
| 645 |
bool& flush, bool& intermediate) const; |
| 646 |
_IGNORE(gst_event_parse_step) |
| 647 |
|
| 648 |
/** Get the amount in a step event. |
| 649 |
* @return The amount. |
| 650 |
*/ |
| 651 |
guint64 parse_amount() const; |
| 652 |
|
| 653 |
/** Get the format in a step event. |
| 654 |
* @return The format. |
| 655 |
*/ |
| 656 |
Gst::Format parse_format() const; |
| 657 |
|
| 658 |
/** Get the rate in a step event. |
| 659 |
* @return The rate. |
| 660 |
*/ |
| 661 |
double parse_rate() const; |
| 662 |
|
| 663 |
/** Get the flush in a step event. |
| 664 |
* @return The flush flag. |
| 665 |
*/ |
| 666 |
bool parse_flush() const; |
| 667 |
|
| 668 |
/** Get the intermediate flag in a step event. |
| 669 |
* @return The intermediate flag. |
| 670 |
*/ |
| 671 |
bool parse_intermediate() const; |
| 672 |
}; |
| 673 |
|
| 674 |
/** A reconfigure event. See create() for more details. |
| 675 |
*/ |
| 676 |
class EventReconfigure : public Event |
| 677 |
{ |
| 678 |
_CLASS_GENERIC(EventReconfigure, GstEvent) |
| 679 |
public: |
| 680 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventReconfigure>',`Glib::wrap_event_derived<EventReconfigure>($3, false)') |
| 681 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventReconfigure> create(), gst_event_new_reconfigure) |
| 682 |
}; |
| 683 |
|
| 684 |
/** A toc select event. See create() for more details. |
| 685 |
*/ |
| 686 |
class EventTocSelect : public Event |
| 687 |
{ |
| 688 |
_CLASS_GENERIC(EventTocSelect, GstEvent) |
| 689 |
public: |
| 690 |
#m4 _CONVERSION(`GstEvent*',`Glib::RefPtr<Gst::EventTocSelect>',`Glib::wrap_event_derived<EventTocSelect>($3, false)') |
| 691 |
_WRAP_METHOD(static Glib::RefPtr<Gst::EventTocSelect> create(const Glib::ustring& uid), gst_event_new_toc_select) |
| 692 |
|
| 693 |
/** Parse the UID in a toc select event. |
| 694 |
* @return The UID. |
| 695 |
*/ |
| 696 |
Glib::ustring parse_uid() const; |
| 697 |
_IGNORE(gst_event_parse_toc_select) |
| 698 |
}; |
| 699 |
|
| 700 |
} //namespace Gst |