1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD 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 gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gstreamer.Event; 26 27 private import glib.ConstructionException; 28 private import glib.ListG; 29 private import glib.Str; 30 private import glib.c.functions; 31 private import gobject.ObjectG; 32 private import gstreamer.Buffer; 33 private import gstreamer.Caps; 34 private import gstreamer.Message; 35 private import gstreamer.Segment; 36 private import gstreamer.Stream; 37 private import gstreamer.StreamCollection; 38 private import gstreamer.Structure; 39 private import gstreamer.TagList; 40 private import gstreamer.Toc; 41 private import gstreamer.c.functions; 42 public import gstreamer.c.types; 43 44 45 /** 46 * The event class provides factory methods to construct events for sending 47 * and functions to query (parse) received events. 48 * 49 * Events are usually created with gst_event_new_*() which takes event-type 50 * specific parameters as arguments. 51 * To send an event application will usually use gst_element_send_event() and 52 * elements will use gst_pad_send_event() or gst_pad_push_event(). 53 * The event should be unreffed with gst_event_unref() if it has not been sent. 54 * 55 * Events that have been received can be parsed with their respective 56 * gst_event_parse_*() functions. It is valid to pass %NULL for unwanted details. 57 * 58 * Events are passed between elements in parallel to the data stream. Some events 59 * are serialized with buffers, others are not. Some events only travel downstream, 60 * others only upstream. Some events can travel both upstream and downstream. 61 * 62 * The events are used to signal special conditions in the datastream such as 63 * EOS (end of stream) or the start of a new stream-segment. 64 * Events are also used to flush the pipeline of any pending data. 65 * 66 * Most of the event API is used inside plugins. Applications usually only 67 * construct and use seek events. 68 * To do that gst_event_new_seek() is used to create a seek event. It takes 69 * the needed parameters to specify seeking time and mode. 70 * |[<!-- language="C" --> 71 * GstEvent *event; 72 * gboolean result; 73 * ... 74 * // construct a seek event to play the media from second 2 to 5, flush 75 * // the pipeline to decrease latency. 76 * event = gst_event_new_seek (1.0, 77 * GST_FORMAT_TIME, 78 * GST_SEEK_FLAG_FLUSH, 79 * GST_SEEK_TYPE_SET, 2 * GST_SECOND, 80 * GST_SEEK_TYPE_SET, 5 * GST_SECOND); 81 * ... 82 * result = gst_element_send_event (pipeline, event); 83 * if (!result) 84 * g_warning ("seek failed"); 85 * ... 86 * ]| 87 */ 88 public class Event 89 { 90 /** the main Gtk struct */ 91 protected GstEvent* gstEvent; 92 protected bool ownedRef; 93 94 /** Get the main Gtk struct */ 95 public GstEvent* getEventStruct(bool transferOwnership = false) 96 { 97 if (transferOwnership) 98 ownedRef = false; 99 return gstEvent; 100 } 101 102 /** the main Gtk struct as a void* */ 103 protected void* getStruct() 104 { 105 return cast(void*)gstEvent; 106 } 107 108 /** 109 * Sets our main struct and passes it to the parent class. 110 */ 111 public this (GstEvent* gstEvent, bool ownedRef = false) 112 { 113 this.gstEvent = gstEvent; 114 this.ownedRef = ownedRef; 115 } 116 117 /** 118 * Create a new EOS event. The eos event can only travel downstream 119 * synchronized with the buffer flow. Elements that receive the EOS 120 * event on a pad can return UNEXPECTED as a GstFlowReturn when data 121 * after the EOS event arrives. 122 * The EOS event will travel down to the sink elements in the pipeline 123 * which will then post the GST_MESSAGE_EOS on the bus after they have 124 * finished playing any buffered data. 125 * When all sinks have posted an EOS message, the EOS message is 126 * forwarded to the application. 127 * Returns: 128 * The new EOS event. 129 */ 130 public static Event newEOS() 131 { 132 // GstEvent* gst_event_new_eos (void); 133 auto p = gst_event_new_eos(); 134 135 if(p is null) 136 { 137 throw new ConstructionException("null returned by gst_event_new_eos"); 138 } 139 140 return new Event(cast(GstEvent*)p ); 141 } 142 143 /** 144 * Allocate a new flush start event. The flush start event can be send 145 * upstream and downstream and travels out-of-bounds with the dataflow. 146 * It marks pads as being in a WRONG_STATE to process more data. 147 * Elements unlock and blocking functions and exit their streaming functions 148 * as fast as possible. 149 * This event is typically generated after a seek to minimize the latency 150 * after the seek. 151 * Returns: 152 * A new flush start event. 153 */ 154 public static Event newFlushStart() 155 { 156 // GstEvent* gst_event_new_flush_start (void); 157 auto p = gst_event_new_flush_start(); 158 159 if(p is null) 160 { 161 throw new ConstructionException("null returned by gst_event_new_flush_start"); 162 } 163 164 return new Event(cast(GstEvent*)p ); 165 } 166 167 /** 168 * Generate a TOC select event with the given uid. The purpose of the 169 * TOC select event is to start playback based on the TOC's entry with 170 * the given uid. 171 */ 172 public static Event newTocSelect(string uid) 173 { 174 // GstEvent* gst_event_new_toc_select (const gchar *uid); 175 auto p = gst_event_new_toc_select(cast(char*)uid.ptr); 176 177 if(p is null) 178 { 179 throw new ConstructionException("null returned by gst_event_new_toc_select"); 180 } 181 182 return new Event(cast(GstEvent*)p ); 183 } 184 185 /** 186 */ 187 188 /** */ 189 public static GType getType() 190 { 191 return gst_event_get_type(); 192 } 193 194 /** 195 * Create a new buffersize event. The event is sent downstream and notifies 196 * elements that they should provide a buffer of the specified dimensions. 197 * 198 * When the @async flag is set, a thread boundary is preferred. 199 * 200 * Params: 201 * format = buffer format 202 * minsize = minimum buffer size 203 * maxsize = maximum buffer size 204 * async = thread behavior 205 * 206 * Returns: a new #GstEvent 207 * 208 * Throws: ConstructionException GTK+ fails to create the object. 209 */ 210 public this(GstFormat format, long minsize, long maxsize, bool async) 211 { 212 auto __p = gst_event_new_buffer_size(format, minsize, maxsize, async); 213 214 if(__p is null) 215 { 216 throw new ConstructionException("null returned by new_buffer_size"); 217 } 218 219 this(cast(GstEvent*) __p); 220 } 221 222 /** 223 * Create a new CAPS event for @caps. The caps event can only travel downstream 224 * synchronized with the buffer flow and contains the format of the buffers 225 * that will follow after the event. 226 * 227 * Params: 228 * caps = a #GstCaps 229 * 230 * Returns: the new CAPS event. 231 * 232 * Throws: ConstructionException GTK+ fails to create the object. 233 */ 234 public this(Caps caps) 235 { 236 auto __p = gst_event_new_caps((caps is null) ? null : caps.getCapsStruct()); 237 238 if(__p is null) 239 { 240 throw new ConstructionException("null returned by new_caps"); 241 } 242 243 this(cast(GstEvent*) __p); 244 } 245 246 /** 247 * Create a new custom-typed event. This can be used for anything not 248 * handled by other event-specific functions to pass an event to another 249 * element. 250 * 251 * Make sure to allocate an event type with the #GST_EVENT_MAKE_TYPE macro, 252 * assigning a free number and filling in the correct direction and 253 * serialization flags. 254 * 255 * New custom events can also be created by subclassing the event type if 256 * needed. 257 * 258 * Params: 259 * type = The type of the new event 260 * structure = the structure for the event. The event will 261 * take ownership of the structure. 262 * 263 * Returns: the new custom event. 264 * 265 * Throws: ConstructionException GTK+ fails to create the object. 266 */ 267 public this(GstEventType type, Structure structure) 268 { 269 auto __p = gst_event_new_custom(type, (structure is null) ? null : structure.getStructureStruct(true)); 270 271 if(__p is null) 272 { 273 throw new ConstructionException("null returned by new_custom"); 274 } 275 276 this(cast(GstEvent*) __p); 277 } 278 279 /** 280 * Allocate a new flush stop event. The flush stop event can be sent 281 * upstream and downstream and travels serialized with the dataflow. 282 * It is typically sent after sending a FLUSH_START event to make the 283 * pads accept data again. 284 * 285 * Elements can process this event synchronized with the dataflow since 286 * the preceding FLUSH_START event stopped the dataflow. 287 * 288 * This event is typically generated to complete a seek and to resume 289 * dataflow. 290 * 291 * Params: 292 * resetTime = if time should be reset 293 * 294 * Returns: a new flush stop event. 295 * 296 * Throws: ConstructionException GTK+ fails to create the object. 297 */ 298 public this(bool resetTime) 299 { 300 auto __p = gst_event_new_flush_stop(resetTime); 301 302 if(__p is null) 303 { 304 throw new ConstructionException("null returned by new_flush_stop"); 305 } 306 307 this(cast(GstEvent*) __p); 308 } 309 310 /** 311 * Create a new GAP event. A gap event can be thought of as conceptually 312 * equivalent to a buffer to signal that there is no data for a certain 313 * amount of time. This is useful to signal a gap to downstream elements 314 * which may wait for data, such as muxers or mixers or overlays, especially 315 * for sparse streams such as subtitle streams. 316 * 317 * Params: 318 * timestamp = the start time (pts) of the gap 319 * duration = the duration of the gap 320 * 321 * Returns: the new GAP event. 322 * 323 * Throws: ConstructionException GTK+ fails to create the object. 324 */ 325 public this(GstClockTime timestamp, GstClockTime duration) 326 { 327 auto __p = gst_event_new_gap(timestamp, duration); 328 329 if(__p is null) 330 { 331 throw new ConstructionException("null returned by new_gap"); 332 } 333 334 this(cast(GstEvent*) __p); 335 } 336 337 /** 338 * Create a new instant-rate-change event. This event is sent by seek 339 * handlers (e.g. demuxers) when receiving a seek with the 340 * %GST_SEEK_FLAG_INSTANT_RATE_CHANGE and signals to downstream elements that 341 * the playback rate in the existing segment should be immediately multiplied 342 * by the @rate_multiplier factor. 343 * 344 * The flags provided replace any flags in the existing segment, for the 345 * flags within the %GST_SEGMENT_INSTANT_FLAGS set. Other GstSegmentFlags 346 * are ignored and not transferred in the event. 347 * 348 * Params: 349 * rateMultiplier = the multiplier to be applied to the playback rate 350 * newFlags = A new subset of segment flags to replace in segments 351 * 352 * Returns: the new instant-rate-change event. 353 * 354 * Since: 1.18 355 * 356 * Throws: ConstructionException GTK+ fails to create the object. 357 */ 358 public this(double rateMultiplier, GstSegmentFlags newFlags) 359 { 360 auto __p = gst_event_new_instant_rate_change(rateMultiplier, newFlags); 361 362 if(__p is null) 363 { 364 throw new ConstructionException("null returned by new_instant_rate_change"); 365 } 366 367 this(cast(GstEvent*) __p); 368 } 369 370 /** 371 * Create a new instant-rate-sync-time event. This event is sent by the 372 * pipeline to notify elements handling the instant-rate-change event about 373 * the running-time when the new rate should be applied. The running time 374 * may be in the past when elements handle this event, which can lead to 375 * switching artifacts. The magnitude of those depends on the exact timing 376 * of event delivery to each element and the magnitude of the change in 377 * playback rate being applied. 378 * 379 * The @running_time and @upstream_running_time are the same if this 380 * is the first instant-rate adjustment, but will differ for later ones 381 * to compensate for the accumulated offset due to playing at a rate 382 * different to the one indicated in the playback segments. 383 * 384 * Params: 385 * rateMultiplier = the new playback rate multiplier to be applied 386 * runningTime = Running time when the rate change should be applied 387 * upstreamRunningTime = The upstream-centric running-time when the 388 * rate change should be applied. 389 * 390 * Returns: the new instant-rate-sync-time event. 391 * 392 * Since: 1.18 393 * 394 * Throws: ConstructionException GTK+ fails to create the object. 395 */ 396 public this(double rateMultiplier, GstClockTime runningTime, GstClockTime upstreamRunningTime) 397 { 398 auto __p = gst_event_new_instant_rate_sync_time(rateMultiplier, runningTime, upstreamRunningTime); 399 400 if(__p is null) 401 { 402 throw new ConstructionException("null returned by new_instant_rate_sync_time"); 403 } 404 405 this(cast(GstEvent*) __p); 406 } 407 408 /** 409 * Create a new latency event. The event is sent upstream from the sinks and 410 * notifies elements that they should add an additional @latency to the 411 * running time before synchronising against the clock. 412 * 413 * The latency is mostly used in live sinks and is always expressed in 414 * the time format. 415 * 416 * Params: 417 * latency = the new latency value 418 * 419 * Returns: a new #GstEvent 420 * 421 * Throws: ConstructionException GTK+ fails to create the object. 422 */ 423 public this(GstClockTime latency) 424 { 425 auto __p = gst_event_new_latency(latency); 426 427 if(__p is null) 428 { 429 throw new ConstructionException("null returned by new_latency"); 430 } 431 432 this(cast(GstEvent*) __p); 433 } 434 435 /** 436 * Create a new navigation event from the given description. 437 * 438 * Params: 439 * structure = description of the event. The event will take 440 * ownership of the structure. 441 * 442 * Returns: a new #GstEvent 443 * 444 * Throws: ConstructionException GTK+ fails to create the object. 445 */ 446 public this(Structure structure) 447 { 448 auto __p = gst_event_new_navigation((structure is null) ? null : structure.getStructureStruct(true)); 449 450 if(__p is null) 451 { 452 throw new ConstructionException("null returned by new_navigation"); 453 } 454 455 this(cast(GstEvent*) __p); 456 } 457 458 /** 459 * Creates a new event containing information specific to a particular 460 * protection system (uniquely identified by @system_id), by which that 461 * protection system can acquire key(s) to decrypt a protected stream. 462 * 463 * In order for a decryption element to decrypt media 464 * protected using a specific system, it first needs all the 465 * protection system specific information necessary to acquire the decryption 466 * key(s) for that stream. The functions defined here enable this information 467 * to be passed in events from elements that extract it 468 * (e.g., ISOBMFF demuxers, MPEG DASH demuxers) to protection decrypter 469 * elements that use it. 470 * 471 * Events containing protection system specific information are created using 472 * #gst_event_new_protection, and they can be parsed by downstream elements 473 * using #gst_event_parse_protection. 474 * 475 * In Common Encryption, protection system specific information may be located 476 * within ISOBMFF files, both in movie (moov) boxes and movie fragment (moof) 477 * boxes; it may also be contained in ContentProtection elements within MPEG 478 * DASH MPDs. The events created by #gst_event_new_protection contain data 479 * identifying from which of these locations the encapsulated protection system 480 * specific information originated. This origin information is required as 481 * some protection systems use different encodings depending upon where the 482 * information originates. 483 * 484 * The events returned by gst_event_new_protection() are implemented 485 * in such a way as to ensure that the most recently-pushed protection info 486 * event of a particular @origin and @system_id will 487 * be stuck to the output pad of the sending element. 488 * 489 * Params: 490 * systemId = a string holding a UUID that uniquely 491 * identifies a protection system. 492 * data = a #GstBuffer holding protection system specific 493 * information. The reference count of the buffer will be incremented by one. 494 * origin = a string indicating where the protection 495 * information carried in the event was extracted from. The allowed values 496 * of this string will depend upon the protection scheme. 497 * 498 * Returns: a #GST_EVENT_PROTECTION event, if successful; %NULL 499 * if unsuccessful. 500 * 501 * Since: 1.6 502 * 503 * Throws: ConstructionException GTK+ fails to create the object. 504 */ 505 public this(string systemId, Buffer data, string origin) 506 { 507 auto __p = gst_event_new_protection(Str.toStringz(systemId), (data is null) ? null : data.getBufferStruct(), Str.toStringz(origin)); 508 509 if(__p is null) 510 { 511 throw new ConstructionException("null returned by new_protection"); 512 } 513 514 this(cast(GstEvent*) __p); 515 } 516 517 /** 518 * Allocate a new qos event with the given values. 519 * The QOS event is generated in an element that wants an upstream 520 * element to either reduce or increase its rate because of 521 * high/low CPU load or other resource usage such as network performance or 522 * throttling. Typically sinks generate these events for each buffer 523 * they receive. 524 * 525 * @type indicates the reason for the QoS event. #GST_QOS_TYPE_OVERFLOW is 526 * used when a buffer arrived in time or when the sink cannot keep up with 527 * the upstream datarate. #GST_QOS_TYPE_UNDERFLOW is when the sink is not 528 * receiving buffers fast enough and thus has to drop late buffers. 529 * #GST_QOS_TYPE_THROTTLE is used when the datarate is artificially limited 530 * by the application, for example to reduce power consumption. 531 * 532 * @proportion indicates the real-time performance of the streaming in the 533 * element that generated the QoS event (usually the sink). The value is 534 * generally computed based on more long term statistics about the streams 535 * timestamps compared to the clock. 536 * A value < 1.0 indicates that the upstream element is producing data faster 537 * than real-time. A value > 1.0 indicates that the upstream element is not 538 * producing data fast enough. 1.0 is the ideal @proportion value. The 539 * proportion value can safely be used to lower or increase the quality of 540 * the element. 541 * 542 * @diff is the difference against the clock in running time of the last 543 * buffer that caused the element to generate the QOS event. A negative value 544 * means that the buffer with @timestamp arrived in time. A positive value 545 * indicates how late the buffer with @timestamp was. When throttling is 546 * enabled, @diff will be set to the requested throttling interval. 547 * 548 * @timestamp is the timestamp of the last buffer that cause the element 549 * to generate the QOS event. It is expressed in running time and thus an ever 550 * increasing value. 551 * 552 * The upstream element can use the @diff and @timestamp values to decide 553 * whether to process more buffers. For positive @diff, all buffers with 554 * timestamp <= @timestamp + @diff will certainly arrive late in the sink 555 * as well. A (negative) @diff value so that @timestamp + @diff would yield a 556 * result smaller than 0 is not allowed. 557 * 558 * The application can use general event probes to intercept the QoS 559 * event and implement custom application specific QoS handling. 560 * 561 * Params: 562 * type = the QoS type 563 * proportion = the proportion of the qos message 564 * diff = The time difference of the last Clock sync 565 * timestamp = The timestamp of the buffer 566 * 567 * Returns: a new QOS event. 568 * 569 * Throws: ConstructionException GTK+ fails to create the object. 570 */ 571 public this(GstQOSType type, double proportion, GstClockTimeDiff diff, GstClockTime timestamp) 572 { 573 auto __p = gst_event_new_qos(type, proportion, diff, timestamp); 574 575 if(__p is null) 576 { 577 throw new ConstructionException("null returned by new_qos"); 578 } 579 580 this(cast(GstEvent*) __p); 581 } 582 583 /** 584 * Create a new reconfigure event. The purpose of the reconfigure event is 585 * to travel upstream and make elements renegotiate their caps or reconfigure 586 * their buffer pools. This is useful when changing properties on elements 587 * or changing the topology of the pipeline. 588 * 589 * Returns: a new #GstEvent 590 * 591 * Throws: ConstructionException GTK+ fails to create the object. 592 */ 593 public this() 594 { 595 auto __p = gst_event_new_reconfigure(); 596 597 if(__p is null) 598 { 599 throw new ConstructionException("null returned by new_reconfigure"); 600 } 601 602 this(cast(GstEvent*) __p); 603 } 604 605 /** 606 * Allocate a new seek event with the given parameters. 607 * 608 * The seek event configures playback of the pipeline between @start to @stop 609 * at the speed given in @rate, also called a playback segment. 610 * The @start and @stop values are expressed in @format. 611 * 612 * A @rate of 1.0 means normal playback rate, 2.0 means double speed. 613 * Negatives values means backwards playback. A value of 0.0 for the 614 * rate is not allowed and should be accomplished instead by PAUSING the 615 * pipeline. 616 * 617 * A pipeline has a default playback segment configured with a start 618 * position of 0, a stop position of -1 and a rate of 1.0. The currently 619 * configured playback segment can be queried with #GST_QUERY_SEGMENT. 620 * 621 * @start_type and @stop_type specify how to adjust the currently configured 622 * start and stop fields in playback segment. Adjustments can be made relative 623 * or absolute to the last configured values. A type of #GST_SEEK_TYPE_NONE 624 * means that the position should not be updated. 625 * 626 * When the rate is positive and @start has been updated, playback will start 627 * from the newly configured start position. 628 * 629 * For negative rates, playback will start from the newly configured stop 630 * position (if any). If the stop position is updated, it must be different from 631 * -1 (#GST_CLOCK_TIME_NONE) for negative rates. 632 * 633 * It is not possible to seek relative to the current playback position, to do 634 * this, PAUSE the pipeline, query the current playback position with 635 * #GST_QUERY_POSITION and update the playback segment current position with a 636 * #GST_SEEK_TYPE_SET to the desired position. 637 * 638 * Params: 639 * rate = The new playback rate 640 * format = The format of the seek values 641 * flags = The optional seek flags 642 * startType = The type and flags for the new start position 643 * start = The value of the new start position 644 * stopType = The type and flags for the new stop position 645 * stop = The value of the new stop position 646 * 647 * Returns: a new seek event. 648 * 649 * Throws: ConstructionException GTK+ fails to create the object. 650 */ 651 public this(double rate, GstFormat format, GstSeekFlags flags, GstSeekType startType, long start, GstSeekType stopType, long stop) 652 { 653 auto __p = gst_event_new_seek(rate, format, flags, startType, start, stopType, stop); 654 655 if(__p is null) 656 { 657 throw new ConstructionException("null returned by new_seek"); 658 } 659 660 this(cast(GstEvent*) __p); 661 } 662 663 /** 664 * Create a new SEGMENT event for @segment. The segment event can only travel 665 * downstream synchronized with the buffer flow and contains timing information 666 * and playback properties for the buffers that will follow. 667 * 668 * The segment event marks the range of buffers to be processed. All 669 * data not within the segment range is not to be processed. This can be 670 * used intelligently by plugins to apply more efficient methods of skipping 671 * unneeded data. The valid range is expressed with the @start and @stop 672 * values. 673 * 674 * The time value of the segment is used in conjunction with the start 675 * value to convert the buffer timestamps into the stream time. This is 676 * usually done in sinks to report the current stream_time. 677 * @time represents the stream_time of a buffer carrying a timestamp of 678 * @start. @time cannot be -1. 679 * 680 * @start cannot be -1, @stop can be -1. If there 681 * is a valid @stop given, it must be greater or equal the @start, including 682 * when the indicated playback @rate is < 0. 683 * 684 * The @applied_rate value provides information about any rate adjustment that 685 * has already been made to the timestamps and content on the buffers of the 686 * stream. (@rate * @applied_rate) should always equal the rate that has been 687 * requested for playback. For example, if an element has an input segment 688 * with intended playback @rate of 2.0 and applied_rate of 1.0, it can adjust 689 * incoming timestamps and buffer content by half and output a segment event 690 * with @rate of 1.0 and @applied_rate of 2.0 691 * 692 * After a segment event, the buffer stream time is calculated with: 693 * 694 * time + (TIMESTAMP(buf) - start) * ABS (rate * applied_rate) 695 * 696 * Params: 697 * segment = a #GstSegment 698 * 699 * Returns: the new SEGMENT event. 700 * 701 * Throws: ConstructionException GTK+ fails to create the object. 702 */ 703 public this(Segment segment) 704 { 705 auto __p = gst_event_new_segment((segment is null) ? null : segment.getSegmentStruct()); 706 707 if(__p is null) 708 { 709 throw new ConstructionException("null returned by new_segment"); 710 } 711 712 this(cast(GstEvent*) __p); 713 } 714 715 /** 716 * Create a new segment-done event. This event is sent by elements that 717 * finish playback of a segment as a result of a segment seek. 718 * 719 * Params: 720 * format = The format of the position being done 721 * position = The position of the segment being done 722 * 723 * Returns: a new #GstEvent 724 * 725 * Throws: ConstructionException GTK+ fails to create the object. 726 */ 727 public this(GstFormat format, long position) 728 { 729 auto __p = gst_event_new_segment_done(format, position); 730 731 if(__p is null) 732 { 733 throw new ConstructionException("null returned by new_segment_done"); 734 } 735 736 this(cast(GstEvent*) __p); 737 } 738 739 /** 740 * Allocate a new select-streams event. 741 * 742 * The select-streams event requests the specified @streams to be activated. 743 * 744 * The list of @streams corresponds to the "Stream ID" of each stream to be 745 * activated. Those ID can be obtained via the #GstStream objects present 746 * in #GST_EVENT_STREAM_START, #GST_EVENT_STREAM_COLLECTION or 747 * #GST_MESSAGE_STREAM_COLLECTION. 748 * 749 * Note: The list of @streams can not be empty. 750 * 751 * Params: 752 * streams = the list of streams to 753 * activate 754 * 755 * Returns: a new select-streams event or %NULL in case of 756 * an error (like an empty streams list). 757 * 758 * Since: 1.10 759 * 760 * Throws: ConstructionException GTK+ fails to create the object. 761 */ 762 public this(ListG streams) 763 { 764 auto __p = gst_event_new_select_streams((streams is null) ? null : streams.getListGStruct()); 765 766 if(__p is null) 767 { 768 throw new ConstructionException("null returned by new_select_streams"); 769 } 770 771 this(cast(GstEvent*) __p); 772 } 773 774 /** 775 * Create a new sink-message event. The purpose of the sink-message event is 776 * to instruct a sink to post the message contained in the event synchronized 777 * with the stream. 778 * 779 * @name is used to store multiple sticky events on one pad. 780 * 781 * Params: 782 * name = a name for the event 783 * msg = the #GstMessage to be posted 784 * 785 * Returns: a new #GstEvent 786 * 787 * Throws: ConstructionException GTK+ fails to create the object. 788 */ 789 public this(string name, Message msg) 790 { 791 auto __p = gst_event_new_sink_message(Str.toStringz(name), (msg is null) ? null : msg.getMessageStruct()); 792 793 if(__p is null) 794 { 795 throw new ConstructionException("null returned by new_sink_message"); 796 } 797 798 this(cast(GstEvent*) __p); 799 } 800 801 /** 802 * Create a new step event. The purpose of the step event is to instruct a sink 803 * to skip @amount (expressed in @format) of media. It can be used to implement 804 * stepping through the video frame by frame or for doing fast trick modes. 805 * 806 * A rate of <= 0.0 is not allowed. Pause the pipeline, for the effect of rate 807 * = 0.0 or first reverse the direction of playback using a seek event to get 808 * the same effect as rate < 0.0. 809 * 810 * The @flush flag will clear any pending data in the pipeline before starting 811 * the step operation. 812 * 813 * The @intermediate flag instructs the pipeline that this step operation is 814 * part of a larger step operation. 815 * 816 * Params: 817 * format = the format of @amount 818 * amount = the amount of data to step 819 * rate = the step rate 820 * flush = flushing steps 821 * intermediate = intermediate steps 822 * 823 * Returns: a new #GstEvent 824 * 825 * Throws: ConstructionException GTK+ fails to create the object. 826 */ 827 public this(GstFormat format, ulong amount, double rate, bool flush, bool intermediate) 828 { 829 auto __p = gst_event_new_step(format, amount, rate, flush, intermediate); 830 831 if(__p is null) 832 { 833 throw new ConstructionException("null returned by new_step"); 834 } 835 836 this(cast(GstEvent*) __p); 837 } 838 839 /** 840 * Create a new STREAM_COLLECTION event. The stream collection event can only 841 * travel downstream synchronized with the buffer flow. 842 * 843 * Source elements, demuxers and other elements that manage collections 844 * of streams and post #GstStreamCollection messages on the bus also send 845 * this event downstream on each pad involved in the collection, so that 846 * activation of a new collection can be tracked through the downstream 847 * data flow. 848 * 849 * Params: 850 * collection = Active collection for this data flow 851 * 852 * Returns: the new STREAM_COLLECTION event. 853 * 854 * Since: 1.10 855 * 856 * Throws: ConstructionException GTK+ fails to create the object. 857 */ 858 public this(StreamCollection collection) 859 { 860 auto __p = gst_event_new_stream_collection((collection is null) ? null : collection.getStreamCollectionStruct()); 861 862 if(__p is null) 863 { 864 throw new ConstructionException("null returned by new_stream_collection"); 865 } 866 867 this(cast(GstEvent*) __p); 868 } 869 870 /** 871 * Create a new Stream Group Done event. The stream-group-done event can 872 * only travel downstream synchronized with the buffer flow. Elements 873 * that receive the event on a pad should handle it mostly like EOS, 874 * and emit any data or pending buffers that would depend on more data 875 * arriving and unblock, since there won't be any more data. 876 * 877 * This event is followed by EOS at some point in the future, and is 878 * generally used when switching pads - to unblock downstream so that 879 * new pads can be exposed before sending EOS on the existing pads. 880 * 881 * Params: 882 * groupId = the group id of the stream group which is ending 883 * 884 * Returns: the new stream-group-done event. 885 * 886 * Since: 1.10 887 * 888 * Throws: ConstructionException GTK+ fails to create the object. 889 */ 890 public this(uint groupId) 891 { 892 auto __p = gst_event_new_stream_group_done(groupId); 893 894 if(__p is null) 895 { 896 throw new ConstructionException("null returned by new_stream_group_done"); 897 } 898 899 this(cast(GstEvent*) __p); 900 } 901 902 /** 903 * Create a new STREAM_START event. The stream start event can only 904 * travel downstream synchronized with the buffer flow. It is expected 905 * to be the first event that is sent for a new stream. 906 * 907 * Source elements, demuxers and other elements that create new streams 908 * are supposed to send this event as the first event of a new stream. It 909 * should not be sent after a flushing seek or in similar situations 910 * and is used to mark the beginning of a new logical stream. Elements 911 * combining multiple streams must ensure that this event is only forwarded 912 * downstream once and not for every single input stream. 913 * 914 * The @stream_id should be a unique string that consists of the upstream 915 * stream-id, / as separator and a unique stream-id for this specific 916 * stream. A new stream-id should only be created for a stream if the upstream 917 * stream is split into (potentially) multiple new streams, e.g. in a demuxer, 918 * but not for every single element in the pipeline. 919 * gst_pad_create_stream_id() or gst_pad_create_stream_id_printf() can be 920 * used to create a stream-id. There are no particular semantics for the 921 * stream-id, though it should be deterministic (to support stream matching) 922 * and it might be used to order streams (besides any information conveyed by 923 * stream flags). 924 * 925 * Params: 926 * streamId = Identifier for this stream 927 * 928 * Returns: the new STREAM_START event. 929 * 930 * Throws: ConstructionException GTK+ fails to create the object. 931 */ 932 public this(string streamId) 933 { 934 auto __p = gst_event_new_stream_start(Str.toStringz(streamId)); 935 936 if(__p is null) 937 { 938 throw new ConstructionException("null returned by new_stream_start"); 939 } 940 941 this(cast(GstEvent*) __p); 942 } 943 944 /** 945 * Generates a metadata tag event from the given @taglist. 946 * 947 * The scope of the taglist specifies if the taglist applies to the 948 * complete medium or only to this specific stream. As the tag event 949 * is a sticky event, elements should merge tags received from 950 * upstream with a given scope with their own tags with the same 951 * scope and create a new tag event from it. 952 * 953 * Params: 954 * taglist = metadata list. The event will take ownership 955 * of the taglist. 956 * 957 * Returns: a new #GstEvent 958 * 959 * Throws: ConstructionException GTK+ fails to create the object. 960 */ 961 public this(TagList taglist) 962 { 963 auto __p = gst_event_new_tag((taglist is null) ? null : taglist.getTagListStruct()); 964 965 if(__p is null) 966 { 967 throw new ConstructionException("null returned by new_tag"); 968 } 969 970 this(cast(GstEvent*) __p); 971 } 972 973 /** 974 * Generate a TOC event from the given @toc. The purpose of the TOC event is to 975 * inform elements that some kind of the TOC was found. 976 * 977 * Params: 978 * toc = #GstToc structure. 979 * updated = whether @toc was updated or not. 980 * 981 * Returns: a new #GstEvent. 982 * 983 * Throws: ConstructionException GTK+ fails to create the object. 984 */ 985 public this(Toc toc, bool updated) 986 { 987 auto __p = gst_event_new_toc((toc is null) ? null : toc.getTocStruct(), updated); 988 989 if(__p is null) 990 { 991 throw new ConstructionException("null returned by new_toc"); 992 } 993 994 this(cast(GstEvent*) __p); 995 } 996 997 /** 998 * Parses a segment @event and copies the #GstSegment into the location 999 * given by @segment. 1000 * 1001 * Params: 1002 * segment = a pointer to a #GstSegment 1003 */ 1004 public void copySegment(Segment segment) 1005 { 1006 gst_event_copy_segment(gstEvent, (segment is null) ? null : segment.getSegmentStruct()); 1007 } 1008 1009 /** 1010 * Retrieve the accumulated running time offset of the event. 1011 * 1012 * Events passing through #GstPads that have a running time 1013 * offset set via gst_pad_set_offset() will get their offset 1014 * adjusted according to the pad's offset. 1015 * 1016 * If the event contains any information that related to the 1017 * running time, this information will need to be updated 1018 * before usage with this offset. 1019 * 1020 * Returns: The event's running time offset 1021 * 1022 * MT safe. 1023 * 1024 * Since: 1.4 1025 */ 1026 public long getRunningTimeOffset() 1027 { 1028 return gst_event_get_running_time_offset(gstEvent); 1029 } 1030 1031 /** 1032 * Retrieve the sequence number of a event. 1033 * 1034 * Events have ever-incrementing sequence numbers, which may also be set 1035 * explicitly via gst_event_set_seqnum(). Sequence numbers are typically used to 1036 * indicate that a event corresponds to some other set of events or messages, 1037 * for example an EOS event corresponding to a SEEK event. It is considered good 1038 * practice to make this correspondence when possible, though it is not 1039 * required. 1040 * 1041 * Note that events and messages share the same sequence number incrementor; 1042 * two events or messages will never have the same sequence number unless 1043 * that correspondence was made explicitly. 1044 * 1045 * Returns: The event's sequence number. 1046 * 1047 * MT safe. 1048 */ 1049 public uint getSeqnum() 1050 { 1051 return gst_event_get_seqnum(gstEvent); 1052 } 1053 1054 /** 1055 * Access the structure of the event. 1056 * 1057 * Returns: The structure of the event. The 1058 * structure is still owned by the event, which means that you should not free 1059 * it and that the pointer becomes invalid when you free the event. 1060 * 1061 * MT safe. 1062 */ 1063 public Structure getStructure() 1064 { 1065 auto __p = gst_event_get_structure(gstEvent); 1066 1067 if(__p is null) 1068 { 1069 return null; 1070 } 1071 1072 return ObjectG.getDObject!(Structure)(cast(GstStructure*) __p); 1073 } 1074 1075 /** 1076 * Checks if @event has the given @name. This function is usually used to 1077 * check the name of a custom event. 1078 * 1079 * Params: 1080 * name = name to check 1081 * 1082 * Returns: %TRUE if @name matches the name of the event structure. 1083 */ 1084 public bool hasName(string name) 1085 { 1086 return gst_event_has_name(gstEvent, Str.toStringz(name)) != 0; 1087 } 1088 1089 /** 1090 * Checks if @event has the given @name. This function is usually used to 1091 * check the name of a custom event. 1092 * 1093 * Params: 1094 * name = name to check as a GQuark 1095 * 1096 * Returns: %TRUE if @name matches the name of the event structure. 1097 * 1098 * Since: 1.18 1099 */ 1100 public bool hasNameId(GQuark name) 1101 { 1102 return gst_event_has_name_id(gstEvent, name) != 0; 1103 } 1104 1105 /** 1106 * Get the format, minsize, maxsize and async-flag in the buffersize event. 1107 * 1108 * Params: 1109 * format = A pointer to store the format in 1110 * minsize = A pointer to store the minsize in 1111 * maxsize = A pointer to store the maxsize in 1112 * async = A pointer to store the async-flag in 1113 */ 1114 public void parseBufferSize(out GstFormat format, out long minsize, out long maxsize, out bool async) 1115 { 1116 int outasync; 1117 1118 gst_event_parse_buffer_size(gstEvent, &format, &minsize, &maxsize, &outasync); 1119 1120 async = (outasync == 1); 1121 } 1122 1123 /** 1124 * Get the caps from @event. The caps remains valid as long as @event remains 1125 * valid. 1126 * 1127 * Params: 1128 * caps = A pointer to the caps 1129 */ 1130 public void parseCaps(out Caps caps) 1131 { 1132 GstCaps* outcaps = null; 1133 1134 gst_event_parse_caps(gstEvent, &outcaps); 1135 1136 caps = ObjectG.getDObject!(Caps)(outcaps); 1137 } 1138 1139 /** 1140 * Parse the FLUSH_STOP event and retrieve the @reset_time member. 1141 * 1142 * Params: 1143 * resetTime = if time should be reset 1144 */ 1145 public void parseFlushStop(out bool resetTime) 1146 { 1147 int outresetTime; 1148 1149 gst_event_parse_flush_stop(gstEvent, &outresetTime); 1150 1151 resetTime = (outresetTime == 1); 1152 } 1153 1154 /** 1155 * Extract timestamp and duration from a new GAP event. 1156 * 1157 * Params: 1158 * timestamp = location where to store the 1159 * start time (pts) of the gap, or %NULL 1160 * duration = location where to store the duration of 1161 * the gap, or %NULL 1162 */ 1163 public void parseGap(out GstClockTime timestamp, out GstClockTime duration) 1164 { 1165 gst_event_parse_gap(gstEvent, ×tamp, &duration); 1166 } 1167 1168 /** 1169 * 1170 * Params: 1171 * groupId = address of variable where to store the group id 1172 * Returns: %TRUE if a group id was set on the event and could be parsed, 1173 * %FALSE otherwise. 1174 * 1175 * Since: 1.2 1176 */ 1177 public bool parseGroupId(out uint groupId) 1178 { 1179 return gst_event_parse_group_id(gstEvent, &groupId) != 0; 1180 } 1181 1182 /** 1183 * Extract rate and flags from an instant-rate-change event. 1184 * 1185 * Params: 1186 * rateMultiplier = location in which to store the rate 1187 * multiplier of the instant-rate-change event, or %NULL 1188 * newFlags = location in which to store the new 1189 * segment flags of the instant-rate-change event, or %NULL 1190 * 1191 * Since: 1.18 1192 */ 1193 public void parseInstantRateChange(out double rateMultiplier, out GstSegmentFlags newFlags) 1194 { 1195 gst_event_parse_instant_rate_change(gstEvent, &rateMultiplier, &newFlags); 1196 } 1197 1198 /** 1199 * Extract the rate multiplier and running times from an instant-rate-sync-time event. 1200 * 1201 * Params: 1202 * rateMultiplier = location where to store the rate of 1203 * the instant-rate-sync-time event, or %NULL 1204 * runningTime = location in which to store the running time 1205 * of the instant-rate-sync-time event, or %NULL 1206 * upstreamRunningTime = location in which to store the 1207 * upstream running time of the instant-rate-sync-time event, or %NULL 1208 * 1209 * Since: 1.18 1210 */ 1211 public void parseInstantRateSyncTime(out double rateMultiplier, out GstClockTime runningTime, out GstClockTime upstreamRunningTime) 1212 { 1213 gst_event_parse_instant_rate_sync_time(gstEvent, &rateMultiplier, &runningTime, &upstreamRunningTime); 1214 } 1215 1216 /** 1217 * Get the latency in the latency event. 1218 * 1219 * Params: 1220 * latency = A pointer to store the latency in. 1221 */ 1222 public void parseLatency(out GstClockTime latency) 1223 { 1224 gst_event_parse_latency(gstEvent, &latency); 1225 } 1226 1227 /** 1228 * Parses an event containing protection system specific information and stores 1229 * the results in @system_id, @data and @origin. The data stored in @system_id, 1230 * @origin and @data are valid until @event is released. 1231 * 1232 * Params: 1233 * systemId = pointer to store the UUID 1234 * string uniquely identifying a content protection system. 1235 * data = pointer to store a #GstBuffer 1236 * holding protection system specific information. 1237 * origin = pointer to store a value that 1238 * indicates where the protection information carried by @event was extracted 1239 * from. 1240 * 1241 * Since: 1.6 1242 */ 1243 public void parseProtection(out string systemId, out Buffer data, out string origin) 1244 { 1245 char* outsystemId = null; 1246 GstBuffer* outdata = null; 1247 char* outorigin = null; 1248 1249 gst_event_parse_protection(gstEvent, &outsystemId, &outdata, &outorigin); 1250 1251 systemId = Str.toString(outsystemId); 1252 data = ObjectG.getDObject!(Buffer)(outdata); 1253 origin = Str.toString(outorigin); 1254 } 1255 1256 /** 1257 * Get the type, proportion, diff and timestamp in the qos event. See 1258 * gst_event_new_qos() for more information about the different QoS values. 1259 * 1260 * @timestamp will be adjusted for any pad offsets of pads it was passing through. 1261 * 1262 * Params: 1263 * type = A pointer to store the QoS type in 1264 * proportion = A pointer to store the proportion in 1265 * diff = A pointer to store the diff in 1266 * timestamp = A pointer to store the timestamp in 1267 */ 1268 public void parseQos(out GstQOSType type, out double proportion, out GstClockTimeDiff diff, out GstClockTime timestamp) 1269 { 1270 gst_event_parse_qos(gstEvent, &type, &proportion, &diff, ×tamp); 1271 } 1272 1273 /** 1274 * Parses a seek @event and stores the results in the given result locations. 1275 * 1276 * Params: 1277 * rate = result location for the rate 1278 * format = result location for the stream format 1279 * flags = result location for the #GstSeekFlags 1280 * startType = result location for the #GstSeekType of the start position 1281 * start = result location for the start position expressed in @format 1282 * stopType = result location for the #GstSeekType of the stop position 1283 * stop = result location for the stop position expressed in @format 1284 */ 1285 public void parseSeek(out double rate, out GstFormat format, out GstSeekFlags flags, out GstSeekType startType, out long start, out GstSeekType stopType, out long stop) 1286 { 1287 gst_event_parse_seek(gstEvent, &rate, &format, &flags, &startType, &start, &stopType, &stop); 1288 } 1289 1290 /** 1291 * Retrieve the trickmode interval that may have been set on a 1292 * seek event with gst_event_set_seek_trickmode_interval(). 1293 * 1294 * Since: 1.16 1295 */ 1296 public void parseSeekTrickmodeInterval(out GstClockTime interval) 1297 { 1298 gst_event_parse_seek_trickmode_interval(gstEvent, &interval); 1299 } 1300 1301 /** 1302 * Parses a segment @event and stores the result in the given @segment location. 1303 * @segment remains valid only until the @event is freed. Don't modify the segment 1304 * and make a copy if you want to modify it or store it for later use. 1305 * 1306 * Params: 1307 * segment = a pointer to a #GstSegment 1308 */ 1309 public void parseSegment(out Segment segment) 1310 { 1311 GstSegment* outsegment = null; 1312 1313 gst_event_parse_segment(gstEvent, &outsegment); 1314 1315 segment = ObjectG.getDObject!(Segment)(outsegment); 1316 } 1317 1318 /** 1319 * Extracts the position and format from the segment done message. 1320 * 1321 * Params: 1322 * format = Result location for the format, or %NULL 1323 * position = Result location for the position, or %NULL 1324 */ 1325 public void parseSegmentDone(out GstFormat format, out long position) 1326 { 1327 gst_event_parse_segment_done(gstEvent, &format, &position); 1328 } 1329 1330 /** 1331 * Parse the SELECT_STREAMS event and retrieve the contained streams. 1332 * 1333 * Params: 1334 * streams = the streams 1335 * 1336 * Since: 1.10 1337 */ 1338 public void parseSelectStreams(out ListG streams) 1339 { 1340 GList* outstreams = null; 1341 1342 gst_event_parse_select_streams(gstEvent, &outstreams); 1343 1344 streams = new ListG(outstreams); 1345 } 1346 1347 /** 1348 * Parse the sink-message event. Unref @msg after usage. 1349 * 1350 * Params: 1351 * msg = a pointer to store the #GstMessage in. 1352 */ 1353 public void parseSinkMessage(out Message msg) 1354 { 1355 GstMessage* outmsg = null; 1356 1357 gst_event_parse_sink_message(gstEvent, &outmsg); 1358 1359 msg = ObjectG.getDObject!(Message)(outmsg); 1360 } 1361 1362 /** 1363 * Parse the step event. 1364 * 1365 * Params: 1366 * format = a pointer to store the format in 1367 * amount = a pointer to store the amount in 1368 * rate = a pointer to store the rate in 1369 * flush = a pointer to store the flush boolean in 1370 * intermediate = a pointer to store the intermediate 1371 * boolean in 1372 */ 1373 public void parseStep(out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate) 1374 { 1375 int outflush; 1376 int outintermediate; 1377 1378 gst_event_parse_step(gstEvent, &format, &amount, &rate, &outflush, &outintermediate); 1379 1380 flush = (outflush == 1); 1381 intermediate = (outintermediate == 1); 1382 } 1383 1384 /** 1385 * Parse a stream-start @event and extract the #GstStream from it. 1386 * 1387 * Params: 1388 * stream = address of variable to store the stream 1389 * 1390 * Since: 1.10 1391 */ 1392 public void parseStream(out Stream stream) 1393 { 1394 GstStream* outstream = null; 1395 1396 gst_event_parse_stream(gstEvent, &outstream); 1397 1398 stream = ObjectG.getDObject!(Stream)(outstream); 1399 } 1400 1401 /** 1402 * Retrieve new #GstStreamCollection from STREAM_COLLECTION event @event. 1403 * 1404 * Params: 1405 * collection = pointer to store the collection 1406 * 1407 * Since: 1.10 1408 */ 1409 public void parseStreamCollection(out StreamCollection collection) 1410 { 1411 GstStreamCollection* outcollection = null; 1412 1413 gst_event_parse_stream_collection(gstEvent, &outcollection); 1414 1415 collection = ObjectG.getDObject!(StreamCollection)(outcollection); 1416 } 1417 1418 /** */ 1419 public void parseStreamFlags(out GstStreamFlags flags) 1420 { 1421 gst_event_parse_stream_flags(gstEvent, &flags); 1422 } 1423 1424 /** 1425 * Parse a stream-group-done @event and store the result in the given 1426 * @group_id location. 1427 * 1428 * Params: 1429 * groupId = address of variable to store the group id into 1430 * 1431 * Since: 1.10 1432 */ 1433 public void parseStreamGroupDone(out uint groupId) 1434 { 1435 gst_event_parse_stream_group_done(gstEvent, &groupId); 1436 } 1437 1438 /** 1439 * Parse a stream-id @event and store the result in the given @stream_id 1440 * location. The string stored in @stream_id must not be modified and will 1441 * remain valid only until @event gets freed. Make a copy if you want to 1442 * modify it or store it for later use. 1443 * 1444 * Params: 1445 * streamId = pointer to store the stream-id 1446 */ 1447 public void parseStreamStart(out string streamId) 1448 { 1449 char* outstreamId = null; 1450 1451 gst_event_parse_stream_start(gstEvent, &outstreamId); 1452 1453 streamId = Str.toString(outstreamId); 1454 } 1455 1456 /** 1457 * Parses a tag @event and stores the results in the given @taglist location. 1458 * No reference to the taglist will be returned, it remains valid only until 1459 * the @event is freed. Don't modify or free the taglist, make a copy if you 1460 * want to modify it or store it for later use. 1461 * 1462 * Params: 1463 * taglist = pointer to metadata list 1464 */ 1465 public void parseTag(out TagList taglist) 1466 { 1467 GstTagList* outtaglist = null; 1468 1469 gst_event_parse_tag(gstEvent, &outtaglist); 1470 1471 taglist = ObjectG.getDObject!(TagList)(outtaglist); 1472 } 1473 1474 /** 1475 * Parse a TOC @event and store the results in the given @toc and @updated locations. 1476 * 1477 * Params: 1478 * toc = pointer to #GstToc structure. 1479 * updated = pointer to store TOC updated flag. 1480 */ 1481 public void parseToc(out Toc toc, out bool updated) 1482 { 1483 GstToc* outtoc = null; 1484 int outupdated; 1485 1486 gst_event_parse_toc(gstEvent, &outtoc, &outupdated); 1487 1488 toc = ObjectG.getDObject!(Toc)(outtoc); 1489 updated = (outupdated == 1); 1490 } 1491 1492 /** 1493 * Parse a TOC select @event and store the results in the given @uid location. 1494 * 1495 * Params: 1496 * uid = storage for the selection UID. 1497 */ 1498 public void parseTocSelect(out string uid) 1499 { 1500 char* outuid = null; 1501 1502 gst_event_parse_toc_select(gstEvent, &outuid); 1503 1504 uid = Str.toString(outuid); 1505 } 1506 1507 /** 1508 * All streams that have the same group id are supposed to be played 1509 * together, i.e. all streams inside a container file should have the 1510 * same group id but different stream ids. The group id should change 1511 * each time the stream is started, resulting in different group ids 1512 * each time a file is played for example. 1513 * 1514 * Use gst_util_group_id_next() to get a new group id. 1515 * 1516 * Params: 1517 * groupId = the group id to set 1518 * 1519 * Since: 1.2 1520 */ 1521 public void setGroupId(uint groupId) 1522 { 1523 gst_event_set_group_id(gstEvent, groupId); 1524 } 1525 1526 /** 1527 * Set the running time offset of a event. See 1528 * gst_event_get_running_time_offset() for more information. 1529 * 1530 * MT safe. 1531 * 1532 * Params: 1533 * offset = A the new running time offset 1534 * 1535 * Since: 1.4 1536 */ 1537 public void setRunningTimeOffset(long offset) 1538 { 1539 gst_event_set_running_time_offset(gstEvent, offset); 1540 } 1541 1542 /** 1543 * Sets a trickmode interval on a (writable) seek event. Elements 1544 * that support TRICKMODE_KEY_UNITS seeks SHOULD use this as the minimal 1545 * interval between each frame they may output. 1546 * 1547 * Since: 1.16 1548 */ 1549 public void setSeekTrickmodeInterval(GstClockTime interval) 1550 { 1551 gst_event_set_seek_trickmode_interval(gstEvent, interval); 1552 } 1553 1554 /** 1555 * Set the sequence number of a event. 1556 * 1557 * This function might be called by the creator of a event to indicate that the 1558 * event relates to other events or messages. See gst_event_get_seqnum() for 1559 * more information. 1560 * 1561 * MT safe. 1562 * 1563 * Params: 1564 * seqnum = A sequence number. 1565 */ 1566 public void setSeqnum(uint seqnum) 1567 { 1568 gst_event_set_seqnum(gstEvent, seqnum); 1569 } 1570 1571 /** 1572 * Set the @stream on the stream-start @event 1573 * 1574 * Params: 1575 * stream = the stream object to set 1576 * 1577 * Since: 1.10 1578 */ 1579 public void setStream(Stream stream) 1580 { 1581 gst_event_set_stream(gstEvent, (stream is null) ? null : stream.getStreamStruct()); 1582 } 1583 1584 /** */ 1585 public void setStreamFlags(GstStreamFlags flags) 1586 { 1587 gst_event_set_stream_flags(gstEvent, flags); 1588 } 1589 1590 /** 1591 * Get a writable version of the structure. 1592 * 1593 * Returns: The structure of the event. The structure 1594 * is still owned by the event, which means that you should not free 1595 * it and that the pointer becomes invalid when you free the event. 1596 * This function checks if @event is writable and will never return 1597 * %NULL. 1598 * 1599 * MT safe. 1600 */ 1601 public Structure writableStructure() 1602 { 1603 auto __p = gst_event_writable_structure(gstEvent); 1604 1605 if(__p is null) 1606 { 1607 return null; 1608 } 1609 1610 return ObjectG.getDObject!(Structure)(cast(GstStructure*) __p); 1611 } 1612 1613 /** 1614 * Gets the #GstEventTypeFlags associated with @type. 1615 * 1616 * Params: 1617 * type = a #GstEventType 1618 * 1619 * Returns: a #GstEventTypeFlags. 1620 */ 1621 public static GstEventTypeFlags typeGetFlags(GstEventType type) 1622 { 1623 return gst_event_type_get_flags(type); 1624 } 1625 1626 /** 1627 * Get a printable name for the given event type. Do not modify or free. 1628 * 1629 * Params: 1630 * type = the event type 1631 * 1632 * Returns: a reference to the static name of the event. 1633 */ 1634 public static string typeGetName(GstEventType type) 1635 { 1636 return Str.toString(gst_event_type_get_name(type)); 1637 } 1638 1639 /** 1640 * Get the unique quark for the given event type. 1641 * 1642 * Params: 1643 * type = the event type 1644 * 1645 * Returns: the quark associated with the event type 1646 */ 1647 public static GQuark typeToQuark(GstEventType type) 1648 { 1649 return gst_event_type_to_quark(type); 1650 } 1651 }