gstevent.sgml 8.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<!-- ##### SECTION Title ##### -->
GstEvent

<!-- ##### SECTION Short_Description ##### -->
Event definitions.

<!-- ##### SECTION Long_Description ##### -->
<para>
The event classes are used to construct and query events.
</para>

<para>
Events are usually created with gst_event_new() which takes the event type as an argument.
properties specific to the event can be set afterwards with the provided macros. 
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
15
The event should be unreferenced with gst_event_unref().
16 17 18 19 20 21 22 23 24 25 26
</para>
<para>
gst_event_new_seek() is a usually used to create a seek event and it takes the 
needed parameters for a seek event. 
</para>
<para>
gst_event_new_flush() creates a new flush event.
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
27
#GstPad, #GstElement
28 29 30 31 32 33 34 35 36 37 38 39
</para>

<!-- ##### ENUM GstEventType ##### -->
<para>
The different major types of events.
</para>

@GST_EVENT_UNKNOWN: unknown event.
@GST_EVENT_EOS: an end-of-stream event.
@GST_EVENT_FLUSH: a flush event.
@GST_EVENT_EMPTY: an empty event.
@GST_EVENT_DISCONTINUOUS: a discontinuous event to indicate the stream has a discontinuity.
Wim Taymans's avatar
Wim Taymans committed
40 41
@GST_EVENT_QOS: a quality of service event
@GST_EVENT_SEEK: a seek event.
Wim Taymans's avatar
Wim Taymans committed
42 43 44 45
@GST_EVENT_SEEK_SEGMENT: a segment seek with start and stop position
@GST_EVENT_SEGMENT_DONE: the event that will be emited when the segment seek has ended
@GST_EVENT_SIZE: a size suggestion for a peer element
@GST_EVENT_RATE: adjust the output rate of an element
Wim Taymans's avatar
Wim Taymans committed
46 47
@GST_EVENT_FILLER: a dummy event that should be ignored by plugins
@GST_EVENT_TS_OFFSET: an event to set the time offset on buffers
Wim Taymans's avatar
Wim Taymans committed
48 49
@GST_EVENT_INTERRUPT: mainly used by _get based elements when they were interrupted
                      while waiting for a buffer.
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
50
@GST_EVENT_NAVIGATION: 
Benjamin Otte's avatar
Benjamin Otte committed
51
@GST_EVENT_TAG: 
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

<!-- ##### MACRO GST_EVENT_TYPE ##### -->
<para>
Get the event type.
</para>

@event: The event to query.


<!-- ##### MACRO GST_EVENT_SRC ##### -->
<para>
The source object that generated this event
</para>

@event: The event to query


<!-- ##### MACRO GST_EVENT_TIMESTAMP ##### -->
<para>
Get the timestamp of the event.
</para>

@event: The event to query.


Wim Taymans's avatar
Wim Taymans committed
77 78 79 80 81 82 83 84
<!-- ##### ENUM GstEventFlag ##### -->
<para>
Event flags are used when querying for supported events
</para>

@GST_EVENT_FLAG_NONE: no value
@GST_RATE_FLAG_NEGATIVE: indicates negative rates are supported

85 86
<!-- ##### ENUM GstSeekType ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
The different types of seek events. When constructing a seek event a format,
a seek method and optional flags are OR-ed together. The seek event is then
inserted into the graph with #gst_pad_send_event() or #gst_element_send_event().

 <informalexample>
  Following example illustrates how to insert a seek event (1 second in the stream)
  in a pipeline.
 
  <programlisting>
  gboolean res;
  GstEvent *event;

  event = gst_event_new_seek (
            GST_FORMAT_TIME |		/* seek on time */
	    GST_SEEK_METHOD_SET |	/* set the absolute position */
	    GST_SEEK_FLAG_FLUSH,	/* flush any pending data */
	    1 * GST_SECOND);		/* the seek offset (1 second) */

  res = gst_element_send_event (GST_ELEMENT (osssink), event);
  if (!res) {
    g_warning ("seek failed");
  }
  </programlisting>
 </informalexample>
111 112
</para>

Wim Taymans's avatar
Wim Taymans committed
113 114 115 116 117 118
@GST_SEEK_METHOD_CUR: Seek to an relative position
@GST_SEEK_METHOD_SET: Seek to an absolute position
@GST_SEEK_METHOD_END: Seek relative to the end of the stream
@GST_SEEK_FLAG_FLUSH: Flush any pending data while seeking
@GST_SEEK_FLAG_ACCURATE: Seek as accuratly as possible
@GST_SEEK_FLAG_KEY_UNIT: Seek to a nearby key unit
Wim Taymans's avatar
Wim Taymans committed
119
@GST_SEEK_FLAG_SEGMENT_LOOP: Loop between start and stop in a segmented seek
Wim Taymans's avatar
Wim Taymans committed
120 121 122 123 124 125 126

<!-- ##### ENUM GstSeekAccuracy ##### -->
<para>
The seekaccuracy gives more information of how the seek was performed,
if the seek was accurate or fuzzy.
</para>

Wim Taymans's avatar
Wim Taymans committed
127 128
@GST_SEEK_CERTAIN: The seek was exact
@GST_SEEK_FUZZY: The seek was fuzzy, exact position can not be guaranteed
129 130 131 132 133 134 135 136 137

<!-- ##### MACRO GST_EVENT_SEEK_TYPE ##### -->
<para>
Get the seektype of the GST_EVENT_SEEK.
</para>

@event: The event to query.


Wim Taymans's avatar
Wim Taymans committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
<!-- ##### MACRO GST_EVENT_SEEK_FORMAT ##### -->
<para>
The format of the seek value
</para>

@event: The event operate on


<!-- ##### MACRO GST_EVENT_SEEK_METHOD ##### -->
<para>
The seek method to use as one of #GstSeekType
</para>

@event: The event operate on


<!-- ##### MACRO GST_EVENT_SEEK_FLAGS ##### -->
<para>
The optional seek flags
</para>

@event: The event operate on


162 163 164 165 166 167 168 169
<!-- ##### MACRO GST_EVENT_SEEK_OFFSET ##### -->
<para>
Get the offset of the seek event.
</para>

@event: The event to query.


Wim Taymans's avatar
Wim Taymans committed
170
<!-- ##### MACRO GST_EVENT_SEEK_ACCURACY ##### -->
171
<para>
Wim Taymans's avatar
Wim Taymans committed
172
Indicates how accurate the event was performed.
173 174
</para>

Wim Taymans's avatar
Wim Taymans committed
175 176
@event: The event to query

177

Wim Taymans's avatar
Wim Taymans committed
178 179
<!-- ##### MACRO GST_SEEK_FLAGS_MASK ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
180
Mask for the flags in the GstSeekType
Wim Taymans's avatar
Wim Taymans committed
181 182 183 184 185 186
</para>



<!-- ##### MACRO GST_SEEK_FLAGS_SHIFT ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
187
Shift for the flags in the GstSeekType
Wim Taymans's avatar
Wim Taymans committed
188 189 190 191 192 193
</para>



<!-- ##### MACRO GST_SEEK_FORMAT_MASK ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
194
Mask for the format in the GstSeekType
Wim Taymans's avatar
Wim Taymans committed
195 196 197 198 199 200
</para>



<!-- ##### MACRO GST_SEEK_FORMAT_SHIFT ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
201
Shift for the format in the GstSeekType
Wim Taymans's avatar
Wim Taymans committed
202
</para>
203

Wim Taymans's avatar
Wim Taymans committed
204 205 206


<!-- ##### MACRO GST_SEEK_METHOD_MASK ##### -->
207
<para>
Wim Taymans's avatar
Wim Taymans committed
208
Mask for the method in the GstSeekType
Wim Taymans's avatar
Wim Taymans committed
209 210 211 212 213 214
</para>



<!-- ##### MACRO GST_SEEK_METHOD_SHIFT ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
215
Shift for the method in the GstSeekType
Wim Taymans's avatar
Wim Taymans committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
</para>



<!-- ##### MACRO GST_EVENT_DISCONT_NEW_MEDIA ##### -->
<para>
Flag that indicates the discont event was because of a new media
type.
</para>

@event: The event to operate on


<!-- ##### MACRO GST_EVENT_DISCONT_OFFSET ##### -->
<para>
The offset of the discont event. A discont evetn can hold up to 8 different
format/value pairs.
233 234 235
</para>

@event: The event to query
Wim Taymans's avatar
Wim Taymans committed
236 237 238 239 240 241 242 243 244
@i: The offset/value pair.


<!-- ##### MACRO GST_EVENT_DISCONT_OFFSET_LEN ##### -->
<para>
Get the number of offset/value pairs this event has.
</para>

@event: The event to query.
245 246


Wim Taymans's avatar
Wim Taymans committed
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
<!-- ##### MACRO GST_EVENT_RATE_VALUE ##### -->
<para>
Get access to the rate vale field
</para>

@event: The event to query


<!-- ##### MACRO GST_EVENT_SEEK_ENDOFFSET ##### -->
<para>
The event stop position for a segment seek
</para>

@event: The event to query


<!-- ##### MACRO GST_EVENT_SIZE_FORMAT ##### -->
<para>
The format of the size event.
</para>

@event: The event to query


<!-- ##### MACRO GST_EVENT_SIZE_VALUE ##### -->
<para>
The value of the size event
</para>

@event: The event to query


Wim Taymans's avatar
Wim Taymans committed
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
<!-- ##### MACRO GST_EVENT_IS_INTERRUPT ##### -->
<para>
Check if the event is an interrupt event
</para>

@event: The event to check


<!-- ##### MACRO GST_EVENT_TRACE_NAME ##### -->
<para>
The name used for memory allocation tracing
</para>



294 295
<!-- ##### STRUCT GstEvent ##### -->
<para>
Wim Taymans's avatar
Wim Taymans committed
296
The event structure
297 298
</para>

299 300 301 302
@data: 
@type: 
@timestamp: 
@src: 
303 304 305 306 307 308 309 310 311 312

<!-- ##### FUNCTION gst_event_new ##### -->
<para>

</para>

@type: 
@Returns: 


Andy Wingo Wingo's avatar
Andy Wingo Wingo committed
313
<!-- ##### MACRO gst_event_copy ##### -->
314
<para>
Wim Taymans's avatar
Wim Taymans committed
315 316
Copy the event using the event specific copy function
</para>
317

Wim Taymans's avatar
Wim Taymans committed
318 319 320 321 322 323 324
@ev: The event to copy
@Returns: A new event that is a copy of the given input event


<!-- ##### MACRO gst_event_ref ##### -->
<para>
Increase the refcount of this event
325 326
</para>

Wim Taymans's avatar
Wim Taymans committed
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
@ev: The event to refcount


<!-- ##### MACRO gst_event_ref_by_count ##### -->
<para>
Increase the refcount of the event with the given value
</para>

@ev: The event to refcount
@c: The value to add to the refcount


<!-- ##### MACRO gst_event_unref ##### -->
<para>
Decrease the refcount of an event, freeing it if the refcount reaches 0
</para>

@ev: The event to unref
Wim Taymans's avatar
Wim Taymans committed
345 346


347 348 349 350 351 352 353 354 355 356
<!-- ##### FUNCTION gst_event_new_seek ##### -->
<para>

</para>

@type: 
@offset: 
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
<!-- ##### FUNCTION gst_event_new_segment_seek ##### -->
<para>

</para>

@type: 
@start: 
@stop: 
@Returns: 


<!-- ##### FUNCTION gst_event_new_size ##### -->
<para>

</para>

@format: 
@value: 
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
378
<!-- ##### FUNCTION gst_event_new_discontinuous ##### -->
379
<para>
Wim Taymans's avatar
Wim Taymans committed
380

381 382
</para>

Wim Taymans's avatar
Wim Taymans committed
383 384 385 386
@new_media: 
@format1: 
@Varargs: 
@Returns: 
387 388


Wim Taymans's avatar
Wim Taymans committed
389
<!-- ##### FUNCTION gst_event_discont_get_value ##### -->
390 391 392 393
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
394 395 396
@event: 
@format: 
@value: 
397 398 399
@Returns: 


Wim Taymans's avatar
Wim Taymans committed
400 401 402 403 404 405 406 407 408 409 410 411 412 413
<!-- ##### MACRO gst_event_new_filler ##### -->
<para>
Create a new dummy event that should be ignored
</para>



<!-- ##### MACRO gst_event_new_flush ##### -->
<para>
Create a new flush event.
</para>



Wim Taymans's avatar
Wim Taymans committed
414
<!-- ##### FUNCTION gst_event_masks_contains ##### -->
Wim Taymans's avatar
Wim Taymans committed
415 416 417 418
<para>

</para>

Wim Taymans's avatar
Wim Taymans committed
419 420 421
@masks: 
@mask: 
@Returns: 
Wim Taymans's avatar
Wim Taymans committed
422 423


Wim Taymans's avatar
Wim Taymans committed
424 425 426 427 428
<!-- ##### MACRO GST_EVENT_MASK_FUNCTION ##### -->
<para>
A convenience macro to create event mask functions
</para>

Wim Taymans's avatar
Wim Taymans committed
429
@type: The type of the first argument of the function
Wim Taymans's avatar
Wim Taymans committed
430 431 432 433
@functionname: the name of the function
@...: event masks, the last element is marked with 0