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.Message; 26 27 private import glib.ConstructionException; 28 private import glib.ErrorG; 29 private import glib.Str; 30 private import gobject.ObjectG; 31 private import gobject.Value; 32 private import gstreamer.Clock; 33 private import gstreamer.Context; 34 private import gstreamer.Device; 35 private import gstreamer.Element; 36 private import gstreamer.ObjectGst; 37 private import gstreamer.Stream; 38 private import gstreamer.StreamCollection; 39 private import gstreamer.Structure; 40 private import gstreamer.TagList; 41 private import gstreamer.Toc; 42 private import gstreamer.c.functions; 43 public import gstreamer.c.types; 44 public import gstreamerc.gstreamertypes; 45 46 47 /** 48 * Messages are implemented as a subclass of #GstMiniObject with a generic 49 * #GstStructure as the content. This allows for writing custom messages without 50 * requiring an API change while allowing a wide range of different types 51 * of messages. 52 * 53 * Messages are posted by objects in the pipeline and are passed to the 54 * application using the #GstBus. 55 * 56 * The basic use pattern of posting a message on a #GstBus is as follows: 57 * |[<!-- language="C" --> 58 * gst_bus_post (bus, gst_message_new_eos()); 59 * ]| 60 * 61 * A #GstElement usually posts messages on the bus provided by the parent 62 * container using gst_element_post_message(). 63 */ 64 public class Message 65 { 66 /** the main Gtk struct */ 67 protected GstMessage* gstMessage; 68 protected bool ownedRef; 69 70 /** Get the main Gtk struct */ 71 public GstMessage* getMessageStruct(bool transferOwnership = false) 72 { 73 if (transferOwnership) 74 ownedRef = false; 75 return gstMessage; 76 } 77 78 /** the main Gtk struct as a void* */ 79 protected void* getStruct() 80 { 81 return cast(void*)gstMessage; 82 } 83 84 /** 85 * Sets our main struct and passes it to the parent class. 86 */ 87 public this (GstMessage* gstMessage, bool ownedRef = false) 88 { 89 this.gstMessage = gstMessage; 90 this.ownedRef = ownedRef; 91 } 92 93 /** 94 * Get the type of the message. 95 */ 96 public GstMessageType type() 97 { 98 return cast(GstMessageType)getMessageStruct().type; 99 } 100 101 /** 102 * Get the src (the element that originated the message) of the message. 103 */ 104 public ObjectGst src() 105 { 106 return new ObjectGst( cast(GstObject*)getMessageStruct().src ); 107 } 108 109 /** 110 * Create a new element-specific message. This is meant as a generic way of 111 * allowing one-way communication from an element to an application, for example 112 * "the firewire cable was unplugged". The format of the message should be 113 * documented in the element's documentation. The structure field can be NULL. 114 * MT safe. 115 * Params: 116 * src = The object originating the message. 117 * structure = The structure for the message. The message will take ownership of 118 * the structure. 119 * Returns: 120 * The new element message. 121 */ 122 public static Message newElement(ObjectGst src, Structure structure) 123 { 124 // GstMessage* gst_message_new_element (GstObject *src, GstStructure *structure); 125 auto p = gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()); 126 127 if(p is null) 128 { 129 throw new ConstructionException("null returned by gst_message_new_element"); 130 } 131 132 return new Message(cast(GstMessage*)p); //, true); 133 } 134 135 /** 136 * Create a new clock message. This message is posted whenever the 137 * pipeline selectes a new clock for the pipeline. 138 * MT safe. 139 * Params: 140 * src = The object originating the message. 141 * clock = the new selected clock 142 * Returns: 143 * The new new clock message. 144 */ 145 public static Message newNewClock(ObjectGst src, Clock clock) 146 { 147 // GstMessage* gst_message_new_new_clock (GstObject *src, GstClock *clock); 148 auto p = gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()); 149 150 if(p is null) 151 { 152 throw new ConstructionException("null returned by gst_message_new_new_clock"); 153 } 154 155 return new Message(cast(GstMessage*)p); //, true); 156 } 157 158 /** 159 * Create a new segment done message. This message is posted by elements that 160 * finish playback of a segment as a result of a segment seek. This message 161 * is received by the application after all elements that posted a segment_start 162 * have posted the segment_done. 163 * MT safe. 164 * Params: 165 * src = The object originating the message. 166 * format = The format of the position being done 167 * position = The position of the segment being done 168 * Returns: 169 * The new segment done message. 170 */ 171 public static Message newSegmentDone(ObjectGst src, GstFormat format, long position) 172 { 173 // GstMessage* gst_message_new_segment_done (GstObject *src, GstFormat format, gint64 position); 174 auto p = gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position); 175 176 if(p is null) 177 { 178 throw new ConstructionException("null returned by gst_message_new_segment_done"); 179 } 180 181 return new Message(cast(GstMessage*)p); //, true); 182 } 183 184 /** 185 * Create a new segment message. This message is posted by elements that 186 * start playback of a segment as a result of a segment seek. This message 187 * is not received by the application but is used for maintenance reasons in 188 * container elements. 189 * MT safe. 190 * Params: 191 * src = The object originating the message. 192 * format = The format of the position being played 193 * position = The position of the segment being played 194 * Returns: 195 * The new segment start message. 196 */ 197 public static Message newSegmentStart(ObjectGst src, GstFormat format, long position) 198 { 199 // GstMessage* gst_message_new_segment_start (GstObject *src, GstFormat format, gint64 position); 200 auto p = gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position); 201 202 if(p is null) 203 { 204 throw new ConstructionException("null returned by gst_message_new_segment_start"); 205 } 206 207 return new Message(cast(GstMessage*)p); //, true); 208 } 209 210 /** 211 * Create a new warning message. The message will make copies of error and 212 * debug. 213 * MT safe. 214 * Params: 215 * src = The object originating the message. 216 * error = The GError for this message. 217 * debug = A debugging string for something or other. 218 * Returns: 219 * The new warning message. 220 */ 221 public static Message newWarning(ObjectGst src, ErrorG error, string dbug) 222 { 223 // GstMessage* gst_message_new_warning (GstObject *src, GError *error, gchar *debug); 224 auto p = gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)); 225 226 if(p is null) 227 { 228 throw new ConstructionException("null returned by gst_message_new_warning"); 229 } 230 231 return new Message(cast(GstMessage*)p); //, true); 232 } 233 234 /** 235 * Create a state dirty message. This message is posted whenever an element 236 * changed its state asynchronously and is used internally to update the 237 * states of container objects. 238 * MT safe. 239 * Params: 240 * src = the object originating the message 241 * Returns: 242 * The new state dirty message. 243 */ 244 public static Message newStateDirty(ObjectGst src) 245 { 246 // GstMessage* gst_message_new_state_dirty (GstObject *src); 247 auto p = gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct()); 248 249 if(p is null) 250 { 251 throw new ConstructionException("null returned by gst_message_new_state_dirty"); 252 } 253 254 return new Message(cast(GstMessage*)p); //, true); 255 } 256 257 /** 258 * Create a new eos message. This message is generated and posted in 259 * the sink elements of a GstBin. The bin will only forward the EOS 260 * message to the application if all sinks have posted an EOS message. 261 * MT safe. 262 * Params: 263 * src = The object originating the message. 264 * Returns: 265 * The new eos message. 266 */ 267 public static Message newEOS(ObjectGst src) 268 { 269 // GstMessage* gst_message_new_eos (GstObject *src); 270 auto p = gst_message_new_eos((src is null) ? null : src.getObjectGstStruct()); 271 272 if(p is null) 273 { 274 throw new ConstructionException("null returned by gst_message_new_eos"); 275 } 276 277 return new Message(cast(GstMessage*)p); //, true); 278 } 279 280 /** 281 * Create a new error message. The message will copy error and 282 * debug. This message is posted by element when a fatal event 283 * occured. The pipeline will probably (partially) stop. The application 284 * receiving this message should stop the pipeline. 285 * MT safe. 286 * Params: 287 * src = The object originating the message. 288 * error = The GError for this message. 289 * debug = A debugging string for something or other. 290 * Returns: 291 * The new error message. 292 */ 293 public static Message newError(ObjectGst src, ErrorG error, string dbug) 294 { 295 // GstMessage* gst_message_new_error (GstObject *src, GError *error, gchar *debug); 296 auto p = gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)); 297 298 if(p is null) 299 { 300 throw new ConstructionException("null returned by gst_message_new_error"); 301 } 302 303 return new Message(cast(GstMessage*)p); //, true); 304 } 305 306 /** 307 * Create a new info message. The message will make copies of error and 308 * debug. 309 * MT safe. 310 * Since 0.10.12 311 * Params: 312 * src = The object originating the message. 313 * error = The GError for this message. 314 * debug = A debugging string for something or other. 315 * Returns: 316 * The new info message. 317 */ 318 public static Message newInfo(ObjectGst src, ErrorG error, string dbug) 319 { 320 // GstMessage* gst_message_new_info (GstObject *src, GError *error, gchar *debug); 321 auto p = gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)); 322 323 if(p is null) 324 { 325 throw new ConstructionException("null returned by gst_message_new_info"); 326 } 327 328 return new Message(cast(GstMessage*)p); //, true); 329 } 330 331 /** 332 * This message can be posted by elements when their latency requirements 333 * have changed. 334 * Params: 335 * src = The object originating the message. 336 * Returns: 337 * The new latency message. MT safe. 338 */ 339 public static Message newLatency(ObjectGst src) 340 { 341 // GstMessage* gst_message_new_latency (GstObject *src); 342 auto p = gst_message_new_latency((src is null) ? null : src.getObjectGstStruct()); 343 344 if(p is null) 345 { 346 throw new ConstructionException("null returned by gst_message_new_latency"); 347 } 348 349 return new Message(cast(GstMessage*)p); //, true); 350 } 351 352 /** 353 * Create a new duration changed message. This message is posted by elements 354 * that know the duration of a stream when the duration changes. This message 355 * is received by bins and is used to calculate the total duration of a 356 * pipeline. Elements may post a duration message with a duration of 357 * GST_CLOCK_TIME_NONE to indicate that the duration has changed and the 358 * cached duration should be discarded. The new duration can then be 359 * retrieved via a query. 360 * Params: 361 * src = The object originating the message. [transfer none] 362 * Throws: ConstructionException GTK+ fails to create the object. 363 */ 364 public static Message newDurationChanged(ObjectGst src) 365 { 366 // GstMessage * gst_message_new_duration_changed (GstObject *src); 367 auto p = gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct()); 368 369 if(p is null) 370 { 371 throw new ConstructionException("null returned by gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct())"); 372 } 373 374 return new Message(cast(GstMessage*)p); //, true); 375 } 376 377 /** 378 * This message is posted by elements when they start an ASYNC state change. 379 * Params: 380 * src = The object originating the message. [transfer none] 381 * Throws: ConstructionException GTK+ fails to create the object. 382 */ 383 public static Message newAsyncStart(ObjectGst src) 384 { 385 // GstMessage * gst_message_new_async_start (GstObject *src); 386 auto p = gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct()); 387 if(p is null) 388 { 389 throw new ConstructionException("null returned by gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct())"); 390 } 391 return new Message(cast(GstMessage*)p); //, true); 392 } 393 394 /** 395 * The message is posted when elements completed an ASYNC state change. 396 * running_time contains the time of the desired running_time when this 397 * elements goes to PLAYING. A value of GST_CLOCK_TIME_NONE for running_time 398 * means that the element has no clock interaction and thus doesn't care about 399 * the running_time of the pipeline. 400 * Params: 401 * src = The object originating the message. [transfer none] 402 * runningTime = the desired running_time 403 * Throws: ConstructionException GTK+ fails to create the object. 404 */ 405 public static Message newAsyncDone(ObjectGst src, GstClockTime runningTime) 406 { 407 // GstMessage * gst_message_new_async_done (GstObject *src, GstClockTime running_time); 408 auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime); 409 if(p is null) 410 { 411 throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime)"); 412 } 413 return new Message(cast(GstMessage*)p); //, true); 414 } 415 416 /** 417 * Creates a new device-added message. The device-added message is produced by 418 * #GstDeviceProvider or a #GstDeviceMonitor. They announce the appearance 419 * of monitored devices. 420 * 421 * Params: 422 * src = The #GstObject that created the message 423 * device = The new #GstDevice 424 * 425 * Return: a newly allocated #GstMessage 426 * 427 * Since: 1.4 428 * 429 * Throws: ConstructionException GTK+ fails to create the object. 430 */ 431 public static Message newDeviceAdded(ObjectGst src, Device device) 432 { 433 auto p = gst_message_new_device_added((src is null) ? null : src.getObjectGstStruct(), (device is null) ? null : device.getDeviceStruct()); 434 435 if(p is null) 436 { 437 throw new ConstructionException("null returned by new_device_added"); 438 } 439 440 return new Message(cast(GstMessage*)p); //, true); 441 } 442 443 /** 444 * Creates a new device-removed message. The device-removed message is produced 445 * by #GstDeviceProvider or a #GstDeviceMonitor. They announce the 446 * disappearance of monitored devices. 447 * 448 * Params: 449 * src = The #GstObject that created the message 450 * device = The removed #GstDevice 451 * 452 * Return: a newly allocated #GstMessage 453 * 454 * Since: 1.4 455 * 456 * Throws: ConstructionException GTK+ fails to create the object. 457 */ 458 public static Message newDeviceRemoved(ObjectGst src, Device device) 459 { 460 auto p = gst_message_new_device_removed((src is null) ? null : src.getObjectGstStruct(), (device is null) ? null : device.getDeviceStruct()); 461 462 if(p is null) 463 { 464 throw new ConstructionException("null returned by new_device_removed"); 465 } 466 467 return new Message(cast(GstMessage*)p); //, true); 468 } 469 470 /** 471 * Create a new error message. The message will copy @error and 472 * @debug. This message is posted by element when a fatal event 473 * occurred. The pipeline will probably (partially) stop. The application 474 * receiving this message should stop the pipeline. 475 * 476 * Params: 477 * src = The object originating the message. 478 * error = The GError for this message. 479 * dbg = A debugging string. 480 * details = (allow-none): A GstStructure with details 481 * 482 * Return: the new error message. 483 * 484 * Since: 1.10 485 * 486 * Throws: ConstructionException GTK+ fails to create the object. 487 */ 488 public static Message newErrorWithDetails(ObjectGst src, ErrorG error, string dbg, Structure details) 489 { 490 auto p = gst_message_new_error_with_details((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbg), (details is null) ? null : details.getStructureStruct()); 491 492 if(p is null) 493 { 494 throw new ConstructionException("null returned by new_error_with_details"); 495 } 496 497 return new Message(cast(GstMessage*)p, true); 498 } 499 500 /** 501 * Create a new info message. The message will make copies of @error and 502 * @debug. 503 * 504 * Params: 505 * src = The object originating the message. 506 * error = The GError for this message. 507 * dbg = A debugging string. 508 * details = (allow-none): A GstStructure with details 509 * 510 * Return: the new warning message. 511 * 512 * Since: 1.10 513 * 514 * Throws: ConstructionException GTK+ fails to create the object. 515 */ 516 public static Message newInfoWithDetails(ObjectGst src, ErrorG error, string dbg, Structure details) 517 { 518 auto p = gst_message_new_info_with_details((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbg), (details is null) ? null : details.getStructureStruct()); 519 520 if(p is null) 521 { 522 throw new ConstructionException("null returned by new_info_with_details"); 523 } 524 525 return new Message(cast(GstMessage*)p, true); 526 } 527 528 /** 529 * Create a new warning message. The message will make copies of @error and 530 * @debug. 531 * 532 * Params: 533 * src = The object originating the message. 534 * error = The GError for this message. 535 * dbg = A debugging string. 536 * details = (allow-none): A GstStructure with details 537 * 538 * Return: the new warning message. 539 * 540 * Since: 1.10 541 * 542 * Throws: ConstructionException GTK+ fails to create the object. 543 */ 544 public static Message newWarningWithDetails(ObjectGst src, ErrorG error, string dbg, Structure details) 545 { 546 auto p = gst_message_new_warning_with_details((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbg), (details is null) ? null : details.getStructureStruct()); 547 548 if(p is null) 549 { 550 throw new ConstructionException("null returned by new_warning_with_details"); 551 } 552 553 return new Message(cast(GstMessage*)p, true); 554 } 555 556 /** 557 * Creates a new stream-collection message. The message is used to announce new 558 * #GstStreamCollection 559 * 560 * Params: 561 * src = The #GstObject that created the message 562 * collection = The #GstStreamCollection 563 * 564 * Return: a newly allocated #GstMessage 565 * 566 * Since: 1.10 567 * 568 * Throws: ConstructionException GTK+ fails to create the object. 569 */ 570 public static Message newStreamCollection(ObjectGst src, StreamCollection collection) 571 { 572 auto p = gst_message_new_stream_collection((src is null) ? null : src.getObjectGstStruct(), (collection is null) ? null : collection.getStreamCollectionStruct()); 573 574 if(p is null) 575 { 576 throw new ConstructionException("null returned by new_stream_collection"); 577 } 578 579 return new Message(cast(GstMessage*)p, true); 580 } 581 582 /** 583 * Creates a new steams-selected message. The message is used to announce 584 * that an array of streams has been selected. This is generally in response 585 * to a #GST_EVENT_SELECT_STREAMS event, or when an element (such as decodebin3) 586 * makes an initial selection of streams. 587 * 588 * The message also contains the #GstStreamCollection to which the various streams 589 * belong to. 590 * 591 * Users of gst_message_new_streams_selected() can add the selected streams with 592 * gst_message_streams_selected_add(). 593 * 594 * Params: 595 * src = The #GstObject that created the message 596 * collection = The #GstStreamCollection 597 * 598 * Return: a newly allocated #GstMessage 599 * 600 * Since: 1.10 601 * 602 * Throws: ConstructionException GTK+ fails to create the object. 603 */ 604 public static Message newStreamsSelected(ObjectGst src, StreamCollection collection) 605 { 606 auto p = gst_message_new_streams_selected((src is null) ? null : src.getObjectGstStruct(), (collection is null) ? null : collection.getStreamCollectionStruct()); 607 608 if(p is null) 609 { 610 throw new ConstructionException("null returned by new_streams_selected"); 611 } 612 613 return new Message(cast(GstMessage*)p, true); 614 } 615 616 /** 617 */ 618 619 /** */ 620 public static GType getType() 621 { 622 return gst_message_get_type(); 623 } 624 625 /** 626 * Create a new application-typed message. GStreamer will never create these 627 * messages; they are a gift from us to you. Enjoy. 628 * 629 * Params: 630 * src = The object originating the message. 631 * structure = the structure for the message. The message 632 * will take ownership of the structure. 633 * 634 * Returns: The new application message. 635 * 636 * MT safe. 637 * 638 * Throws: ConstructionException GTK+ fails to create the object. 639 */ 640 public this(ObjectGst src, Structure structure) 641 { 642 auto p = gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct(true)); 643 644 if(p is null) 645 { 646 throw new ConstructionException("null returned by new_application"); 647 } 648 649 this(cast(GstMessage*) p); 650 } 651 652 /** 653 * The message is posted when elements completed an ASYNC state change. 654 * @running_time contains the time of the desired running_time when this 655 * elements goes to PLAYING. A value of #GST_CLOCK_TIME_NONE for @running_time 656 * means that the element has no clock interaction and thus doesn't care about 657 * the running_time of the pipeline. 658 * 659 * Params: 660 * src = The object originating the message. 661 * runningTime = the desired running_time 662 * 663 * Returns: The new async_done message. 664 * 665 * MT safe. 666 * 667 * Throws: ConstructionException GTK+ fails to create the object. 668 */ 669 public this(ObjectGst src, GstClockTime runningTime) 670 { 671 auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime); 672 673 if(p is null) 674 { 675 throw new ConstructionException("null returned by new_async_done"); 676 } 677 678 this(cast(GstMessage*) p); 679 } 680 681 /** 682 * Create a new buffering message. This message can be posted by an element that 683 * needs to buffer data before it can continue processing. @percent should be a 684 * value between 0 and 100. A value of 100 means that the buffering completed. 685 * 686 * When @percent is < 100 the application should PAUSE a PLAYING pipeline. When 687 * @percent is 100, the application can set the pipeline (back) to PLAYING. 688 * The application must be prepared to receive BUFFERING messages in the 689 * PREROLLING state and may only set the pipeline to PLAYING after receiving a 690 * message with @percent set to 100, which can happen after the pipeline 691 * completed prerolling. 692 * 693 * MT safe. 694 * 695 * Params: 696 * src = The object originating the message. 697 * percent = The buffering percent 698 * 699 * Returns: The new buffering message. 700 * 701 * Throws: ConstructionException GTK+ fails to create the object. 702 */ 703 public this(ObjectGst src, int percent) 704 { 705 auto p = gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent); 706 707 if(p is null) 708 { 709 throw new ConstructionException("null returned by new_buffering"); 710 } 711 712 this(cast(GstMessage*) p); 713 } 714 715 /** 716 * Create a clock lost message. This message is posted whenever the 717 * clock is not valid anymore. 718 * 719 * If this message is posted by the pipeline, the pipeline will 720 * select a new clock again when it goes to PLAYING. It might therefore 721 * be needed to set the pipeline to PAUSED and PLAYING again. 722 * 723 * Params: 724 * src = The object originating the message. 725 * clock = the clock that was lost 726 * 727 * Returns: The new clock lost message. 728 * 729 * MT safe. 730 * 731 * Throws: ConstructionException GTK+ fails to create the object. 732 */ 733 public this(ObjectGst src, Clock clock) 734 { 735 auto p = gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()); 736 737 if(p is null) 738 { 739 throw new ConstructionException("null returned by new_clock_lost"); 740 } 741 742 this(cast(GstMessage*) p); 743 } 744 745 /** 746 * Create a clock provide message. This message is posted whenever an 747 * element is ready to provide a clock or lost its ability to provide 748 * a clock (maybe because it paused or became EOS). 749 * 750 * This message is mainly used internally to manage the clock 751 * selection. 752 * 753 * Params: 754 * src = The object originating the message. 755 * clock = the clock it provides 756 * ready = %TRUE if the sender can provide a clock 757 * 758 * Returns: the new provide clock message. 759 * 760 * MT safe. 761 * 762 * Throws: ConstructionException GTK+ fails to create the object. 763 */ 764 public this(ObjectGst src, Clock clock, bool ready) 765 { 766 auto p = gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready); 767 768 if(p is null) 769 { 770 throw new ConstructionException("null returned by new_clock_provide"); 771 } 772 773 this(cast(GstMessage*) p); 774 } 775 776 /** 777 * Create a new custom-typed message. This can be used for anything not 778 * handled by other message-specific functions to pass a message to the 779 * app. The structure field can be %NULL. 780 * 781 * Params: 782 * type = The #GstMessageType to distinguish messages 783 * src = The object originating the message. 784 * structure = the structure for the 785 * message. The message will take ownership of the structure. 786 * 787 * Returns: The new message. 788 * 789 * MT safe. 790 * 791 * Throws: ConstructionException GTK+ fails to create the object. 792 */ 793 public this(GstMessageType type, ObjectGst src, Structure structure) 794 { 795 auto p = gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct(true)); 796 797 if(p is null) 798 { 799 throw new ConstructionException("null returned by new_custom"); 800 } 801 802 this(cast(GstMessage*) p); 803 } 804 805 /** 806 * This message is posted when an element has a new local #GstContext. 807 * 808 * Params: 809 * src = The object originating the message. 810 * context = the context 811 * 812 * Returns: The new have-context message. 813 * 814 * MT safe. 815 * 816 * Since: 1.2 817 * 818 * Throws: ConstructionException GTK+ fails to create the object. 819 */ 820 public this(ObjectGst src, Context context) 821 { 822 auto p = gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct()); 823 824 if(p is null) 825 { 826 throw new ConstructionException("null returned by new_have_context"); 827 } 828 829 this(cast(GstMessage*) p); 830 } 831 832 /** 833 * This message is posted when an element needs a specific #GstContext. 834 * 835 * Params: 836 * src = The object originating the message. 837 * contextType = The context type that is needed 838 * 839 * Returns: The new need-context message. 840 * 841 * MT safe. 842 * 843 * Since: 1.2 844 * 845 * Throws: ConstructionException GTK+ fails to create the object. 846 */ 847 public this(ObjectGst src, string contextType) 848 { 849 auto p = gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType)); 850 851 if(p is null) 852 { 853 throw new ConstructionException("null returned by new_need_context"); 854 } 855 856 this(cast(GstMessage*) p); 857 } 858 859 /** 860 * Progress messages are posted by elements when they use an asynchronous task 861 * to perform actions triggered by a state change. 862 * 863 * @code contains a well defined string describing the action. 864 * @text should contain a user visible string detailing the current action. 865 * 866 * Params: 867 * src = The object originating the message. 868 * type = a #GstProgressType 869 * code = a progress code 870 * text = free, user visible text describing the progress 871 * 872 * Returns: The new qos message. 873 * 874 * Throws: ConstructionException GTK+ fails to create the object. 875 */ 876 public this(ObjectGst src, GstProgressType type, string code, string text) 877 { 878 auto p = gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text)); 879 880 if(p is null) 881 { 882 throw new ConstructionException("null returned by new_progress"); 883 } 884 885 this(cast(GstMessage*) p); 886 } 887 888 /** 889 * 890 * Params: 891 * src = The #GstObject whose property changed (may or may not be a #GstElement) 892 * propertyName = name of the property that changed 893 * val = new property value, or %NULL 894 * Returns: a newly allocated #GstMessage 895 * 896 * Since: 1.10 897 * 898 * Throws: ConstructionException GTK+ fails to create the object. 899 */ 900 public this(ObjectGst src, string propertyName, Value val) 901 { 902 auto p = gst_message_new_property_notify((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(propertyName), (val is null) ? null : val.getValueStruct()); 903 904 if(p is null) 905 { 906 throw new ConstructionException("null returned by new_property_notify"); 907 } 908 909 this(cast(GstMessage*) p); 910 } 911 912 /** 913 * A QOS message is posted on the bus whenever an element decides to drop a 914 * buffer because of QoS reasons or whenever it changes its processing strategy 915 * because of QoS reasons (quality adjustments such as processing at lower 916 * accuracy). 917 * 918 * This message can be posted by an element that performs synchronisation against the 919 * clock (live) or it could be dropped by an element that performs QoS because of QOS 920 * events received from a downstream element (!live). 921 * 922 * @running_time, @stream_time, @timestamp, @duration should be set to the 923 * respective running-time, stream-time, timestamp and duration of the (dropped) 924 * buffer that generated the QoS event. Values can be left to 925 * GST_CLOCK_TIME_NONE when unknown. 926 * 927 * Params: 928 * src = The object originating the message. 929 * live = if the message was generated by a live element 930 * runningTime = the running time of the buffer that generated the message 931 * streamTime = the stream time of the buffer that generated the message 932 * timestamp = the timestamps of the buffer that generated the message 933 * duration = the duration of the buffer that generated the message 934 * 935 * Returns: The new qos message. 936 * 937 * MT safe. 938 * 939 * Throws: ConstructionException GTK+ fails to create the object. 940 */ 941 public this(ObjectGst src, bool live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration) 942 { 943 auto p = gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration); 944 945 if(p is null) 946 { 947 throw new ConstructionException("null returned by new_qos"); 948 } 949 950 this(cast(GstMessage*) p); 951 } 952 953 /** 954 * Creates a new redirect message and adds a new entry to it. Redirect messages 955 * are posted when an element detects that the actual data has to be retrieved 956 * from a different location. This is useful if such a redirection cannot be 957 * handled inside a source element, for example when HTTP 302/303 redirects 958 * return a non-HTTP URL. 959 * 960 * The redirect message can hold multiple entries. The first one is added 961 * when the redirect message is created, with the given location, tag_list, 962 * entry_struct arguments. Use gst_message_add_redirect_entry() to add more 963 * entries. 964 * 965 * Each entry has a location, a tag list, and a structure. All of these are 966 * optional. The tag list and structure are useful for additional metadata, 967 * such as bitrate statistics for the given location. 968 * 969 * By default, message recipients should treat entries in the order they are 970 * stored. The recipient should therefore try entry #0 first, and if this 971 * entry is not acceptable or working, try entry #1 etc. Senders must make 972 * sure that they add entries in this order. However, recipients are free to 973 * ignore the order and pick an entry that is "best" for them. One example 974 * would be a recipient that scans the entries for the one with the highest 975 * bitrate tag. 976 * 977 * The specified location string is copied. However, ownership over the tag 978 * list and structure are transferred to the message. 979 * 980 * Params: 981 * src = The #GstObject whose property changed (may or may not be a #GstElement) 982 * location = location string for the new entry 983 * tagList = tag list for the new entry 984 * entryStruct = structure for the new entry 985 * 986 * Returns: a newly allocated #GstMessage 987 * 988 * Since: 1.10 989 * 990 * Throws: ConstructionException GTK+ fails to create the object. 991 */ 992 public this(ObjectGst src, string location, TagList tagList, Structure entryStruct) 993 { 994 auto p = gst_message_new_redirect((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(location), (tagList is null) ? null : tagList.getTagListStruct(), (entryStruct is null) ? null : entryStruct.getStructureStruct(true)); 995 996 if(p is null) 997 { 998 throw new ConstructionException("null returned by new_redirect"); 999 } 1000 1001 this(cast(GstMessage*) p); 1002 } 1003 1004 /** 1005 * This message can be posted by elements when they want to have their state 1006 * changed. A typical use case would be an audio server that wants to pause the 1007 * pipeline because a higher priority stream is being played. 1008 * 1009 * Params: 1010 * src = The object originating the message. 1011 * state = The new requested state 1012 * 1013 * Returns: the new request state message. 1014 * 1015 * MT safe. 1016 * 1017 * Throws: ConstructionException GTK+ fails to create the object. 1018 */ 1019 public this(ObjectGst src, GstState state) 1020 { 1021 auto p = gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state); 1022 1023 if(p is null) 1024 { 1025 throw new ConstructionException("null returned by new_request_state"); 1026 } 1027 1028 this(cast(GstMessage*) p); 1029 } 1030 1031 /** 1032 * Create a state change message. This message is posted whenever an element 1033 * changed its state. 1034 * 1035 * Params: 1036 * src = The object originating the message. 1037 * oldstate = the previous state 1038 * newstate = the new (current) state 1039 * pending = the pending (target) state 1040 * 1041 * Returns: the new state change message. 1042 * 1043 * MT safe. 1044 * 1045 * Throws: ConstructionException GTK+ fails to create the object. 1046 */ 1047 public this(ObjectGst src, GstState oldstate, GstState newstate, GstState pending) 1048 { 1049 auto p = gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending); 1050 1051 if(p is null) 1052 { 1053 throw new ConstructionException("null returned by new_state_changed"); 1054 } 1055 1056 this(cast(GstMessage*) p); 1057 } 1058 1059 /** 1060 * This message is posted by elements when they complete a part, when @intermediate set 1061 * to %TRUE, or a complete step operation. 1062 * 1063 * @duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped 1064 * @amount of media in format @format. 1065 * 1066 * Params: 1067 * src = The object originating the message. 1068 * format = the format of @amount 1069 * amount = the amount of stepped data 1070 * rate = the rate of the stepped amount 1071 * flush = is this an flushing step 1072 * intermediate = is this an intermediate step 1073 * duration = the duration of the data 1074 * eos = the step caused EOS 1075 * 1076 * Returns: the new step_done message. 1077 * 1078 * MT safe. 1079 * 1080 * Throws: ConstructionException GTK+ fails to create the object. 1081 */ 1082 public this(ObjectGst src, GstFormat format, ulong amount, double rate, bool flush, bool intermediate, ulong duration, bool eos) 1083 { 1084 auto p = gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos); 1085 1086 if(p is null) 1087 { 1088 throw new ConstructionException("null returned by new_step_done"); 1089 } 1090 1091 this(cast(GstMessage*) p); 1092 } 1093 1094 /** 1095 * This message is posted by elements when they accept or activate a new step 1096 * event for @amount in @format. 1097 * 1098 * @active is set to %FALSE when the element accepted the new step event and has 1099 * queued it for execution in the streaming threads. 1100 * 1101 * @active is set to %TRUE when the element has activated the step operation and 1102 * is now ready to start executing the step in the streaming thread. After this 1103 * message is emitted, the application can queue a new step operation in the 1104 * element. 1105 * 1106 * Params: 1107 * src = The object originating the message. 1108 * active = if the step is active or queued 1109 * format = the format of @amount 1110 * amount = the amount of stepped data 1111 * rate = the rate of the stepped amount 1112 * flush = is this an flushing step 1113 * intermediate = is this an intermediate step 1114 * 1115 * Returns: The new step_start message. 1116 * 1117 * MT safe. 1118 * 1119 * Throws: ConstructionException GTK+ fails to create the object. 1120 */ 1121 public this(ObjectGst src, bool active, GstFormat format, ulong amount, double rate, bool flush, bool intermediate) 1122 { 1123 auto p = gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate); 1124 1125 if(p is null) 1126 { 1127 throw new ConstructionException("null returned by new_step_start"); 1128 } 1129 1130 this(cast(GstMessage*) p); 1131 } 1132 1133 /** 1134 * Create a new stream_start message. This message is generated and posted in 1135 * the sink elements of a GstBin. The bin will only forward the STREAM_START 1136 * message to the application if all sinks have posted an STREAM_START message. 1137 * 1138 * Params: 1139 * src = The object originating the message. 1140 * 1141 * Returns: The new stream_start message. 1142 * 1143 * MT safe. 1144 * 1145 * Throws: ConstructionException GTK+ fails to create the object. 1146 */ 1147 public this(ObjectGst src) 1148 { 1149 auto p = gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct()); 1150 1151 if(p is null) 1152 { 1153 throw new ConstructionException("null returned by new_stream_start"); 1154 } 1155 1156 this(cast(GstMessage*) p); 1157 } 1158 1159 /** 1160 * Create a new stream status message. This message is posted when a streaming 1161 * thread is created/destroyed or when the state changed. 1162 * 1163 * Params: 1164 * src = The object originating the message. 1165 * type = The stream status type. 1166 * owner = the owner element of @src. 1167 * 1168 * Returns: the new stream status message. 1169 * 1170 * MT safe. 1171 * 1172 * Throws: ConstructionException GTK+ fails to create the object. 1173 */ 1174 public this(ObjectGst src, GstStreamStatusType type, Element owner) 1175 { 1176 auto p = gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct()); 1177 1178 if(p is null) 1179 { 1180 throw new ConstructionException("null returned by new_stream_status"); 1181 } 1182 1183 this(cast(GstMessage*) p); 1184 } 1185 1186 /** 1187 * Create a new structure change message. This message is posted when the 1188 * structure of a pipeline is in the process of being changed, for example 1189 * when pads are linked or unlinked. 1190 * 1191 * @src should be the sinkpad that unlinked or linked. 1192 * 1193 * Params: 1194 * src = The object originating the message. 1195 * type = The change type. 1196 * owner = The owner element of @src. 1197 * busy = Whether the structure change is busy. 1198 * 1199 * Returns: the new structure change message. 1200 * 1201 * MT safe. 1202 * 1203 * Throws: ConstructionException GTK+ fails to create the object. 1204 */ 1205 public this(ObjectGst src, GstStructureChangeType type, Element owner, bool busy) 1206 { 1207 auto p = gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy); 1208 1209 if(p is null) 1210 { 1211 throw new ConstructionException("null returned by new_structure_change"); 1212 } 1213 1214 this(cast(GstMessage*) p); 1215 } 1216 1217 /** 1218 * Create a new tag message. The message will take ownership of the tag list. 1219 * The message is posted by elements that discovered a new taglist. 1220 * 1221 * Params: 1222 * src = The object originating the message. 1223 * tagList = the tag list for the message. 1224 * 1225 * Returns: the new tag message. 1226 * 1227 * MT safe. 1228 * 1229 * Throws: ConstructionException GTK+ fails to create the object. 1230 */ 1231 public this(ObjectGst src, TagList tagList) 1232 { 1233 auto p = gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct()); 1234 1235 if(p is null) 1236 { 1237 throw new ConstructionException("null returned by new_tag"); 1238 } 1239 1240 this(cast(GstMessage*) p); 1241 } 1242 1243 /** 1244 * Create a new TOC message. The message is posted by elements 1245 * that discovered or updated a TOC. 1246 * 1247 * Params: 1248 * src = the object originating the message. 1249 * toc = #GstToc structure for the message. 1250 * updated = whether TOC was updated or not. 1251 * 1252 * Returns: a new TOC message. 1253 * 1254 * MT safe. 1255 * 1256 * Throws: ConstructionException GTK+ fails to create the object. 1257 */ 1258 public this(ObjectGst src, Toc toc, bool updated) 1259 { 1260 auto p = gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated); 1261 1262 if(p is null) 1263 { 1264 throw new ConstructionException("null returned by new_toc"); 1265 } 1266 1267 this(cast(GstMessage*) p); 1268 } 1269 1270 /** 1271 * Creates and appends a new entry. 1272 * 1273 * The specified location string is copied. However, ownership over the tag 1274 * list and structure are transferred to the message. 1275 * 1276 * Params: 1277 * location = location string for the new entry 1278 * tagList = tag list for the new entry 1279 * entryStruct = structure for the new entry 1280 * 1281 * Since: 1.10 1282 */ 1283 public void addRedirectEntry(string location, TagList tagList, Structure entryStruct) 1284 { 1285 gst_message_add_redirect_entry(gstMessage, Str.toStringz(location), (tagList is null) ? null : tagList.getTagListStruct(), (entryStruct is null) ? null : entryStruct.getStructureStruct(true)); 1286 } 1287 1288 /** 1289 * Returns: the number of entries stored in the message 1290 * 1291 * Since: 1.10 1292 */ 1293 public size_t getNumRedirectEntries() 1294 { 1295 return gst_message_get_num_redirect_entries(gstMessage); 1296 } 1297 1298 /** 1299 * Retrieve the sequence number of a message. 1300 * 1301 * Messages have ever-incrementing sequence numbers, which may also be set 1302 * explicitly via gst_message_set_seqnum(). Sequence numbers are typically used 1303 * to indicate that a message corresponds to some other set of messages or 1304 * events, for example a SEGMENT_DONE message corresponding to a SEEK event. It 1305 * is considered good practice to make this correspondence when possible, though 1306 * it is not required. 1307 * 1308 * Note that events and messages share the same sequence number incrementor; 1309 * two events or messages will never have the same sequence number unless 1310 * that correspondence was made explicitly. 1311 * 1312 * Returns: The message's sequence number. 1313 * 1314 * MT safe. 1315 */ 1316 public uint getSeqnum() 1317 { 1318 return gst_message_get_seqnum(gstMessage); 1319 } 1320 1321 /** 1322 * Extracts the object managing the streaming thread from @message. 1323 * 1324 * Returns: a GValue containing the object that manages the streaming thread. 1325 * This object is usually of type GstTask but other types can be added in the 1326 * future. The object remains valid as long as @message is valid. 1327 */ 1328 public Value getStreamStatusObject() 1329 { 1330 auto p = gst_message_get_stream_status_object(gstMessage); 1331 1332 if(p is null) 1333 { 1334 return null; 1335 } 1336 1337 return ObjectG.getDObject!(Value)(cast(GValue*) p); 1338 } 1339 1340 /** 1341 * Access the structure of the message. 1342 * 1343 * Returns: The structure of the message. The structure is 1344 * still owned by the message, which means that you should not free it and 1345 * that the pointer becomes invalid when you free the message. 1346 * 1347 * MT safe. 1348 */ 1349 public Structure getStructure() 1350 { 1351 auto p = gst_message_get_structure(gstMessage); 1352 1353 if(p is null) 1354 { 1355 return null; 1356 } 1357 1358 return ObjectG.getDObject!(Structure)(cast(GstStructure*) p); 1359 } 1360 1361 /** 1362 * Checks if @message has the given @name. This function is usually used to 1363 * check the name of a custom message. 1364 * 1365 * Params: 1366 * name = name to check 1367 * 1368 * Returns: %TRUE if @name matches the name of the message structure. 1369 */ 1370 public bool hasName(string name) 1371 { 1372 return gst_message_has_name(gstMessage, Str.toStringz(name)) != 0; 1373 } 1374 1375 /** 1376 * Extract the running_time from the async_done message. 1377 * 1378 * MT safe. 1379 * 1380 * Params: 1381 * runningTime = Result location for the running_time or %NULL 1382 */ 1383 public void parseAsyncDone(out GstClockTime runningTime) 1384 { 1385 gst_message_parse_async_done(gstMessage, &runningTime); 1386 } 1387 1388 /** 1389 * Extracts the buffering percent from the GstMessage. see also 1390 * gst_message_new_buffering(). 1391 * 1392 * MT safe. 1393 * 1394 * Params: 1395 * percent = Return location for the percent. 1396 */ 1397 public void parseBuffering(out int percent) 1398 { 1399 gst_message_parse_buffering(gstMessage, &percent); 1400 } 1401 1402 /** 1403 * Extracts the buffering stats values from @message. 1404 * 1405 * Params: 1406 * mode = a buffering mode, or %NULL 1407 * avgIn = the average input rate, or %NULL 1408 * avgOut = the average output rate, or %NULL 1409 * bufferingLeft = amount of buffering time left in 1410 * milliseconds, or %NULL 1411 */ 1412 public void parseBufferingStats(out GstBufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft) 1413 { 1414 gst_message_parse_buffering_stats(gstMessage, &mode, &avgIn, &avgOut, &bufferingLeft); 1415 } 1416 1417 /** 1418 * Extracts the lost clock from the GstMessage. 1419 * The clock object returned remains valid until the message is freed. 1420 * 1421 * MT safe. 1422 * 1423 * Params: 1424 * clock = a pointer to hold the lost clock 1425 */ 1426 public void parseClockLost(out Clock clock) 1427 { 1428 GstClock* outclock = null; 1429 1430 gst_message_parse_clock_lost(gstMessage, &outclock); 1431 1432 clock = ObjectG.getDObject!(Clock)(outclock); 1433 } 1434 1435 /** 1436 * Extracts the clock and ready flag from the GstMessage. 1437 * The clock object returned remains valid until the message is freed. 1438 * 1439 * MT safe. 1440 * 1441 * Params: 1442 * clock = a pointer to hold a clock 1443 * object, or %NULL 1444 * ready = a pointer to hold the ready flag, or %NULL 1445 */ 1446 public void parseClockProvide(out Clock clock, out bool ready) 1447 { 1448 GstClock* outclock = null; 1449 int outready; 1450 1451 gst_message_parse_clock_provide(gstMessage, &outclock, &outready); 1452 1453 clock = ObjectG.getDObject!(Clock)(outclock); 1454 ready = (outready == 1); 1455 } 1456 1457 /** 1458 * Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message. 1459 * 1460 * Params: 1461 * contextType = the context type, or %NULL 1462 * 1463 * Returns: a #gboolean indicating if the parsing succeeded. 1464 * 1465 * Since: 1.2 1466 */ 1467 public bool parseContextType(out string contextType) 1468 { 1469 char* outcontextType = null; 1470 1471 auto p = gst_message_parse_context_type(gstMessage, &outcontextType) != 0; 1472 1473 contextType = Str.toString(outcontextType); 1474 1475 return p; 1476 } 1477 1478 /** 1479 * Parses a device-added message. The device-added message is produced by 1480 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the appearance 1481 * of monitored devices. 1482 * 1483 * Params: 1484 * device = A location where to store a 1485 * pointer to the new #GstDevice, or %NULL 1486 * 1487 * Since: 1.4 1488 */ 1489 public void parseDeviceAdded(out Device device) 1490 { 1491 GstDevice* outdevice = null; 1492 1493 gst_message_parse_device_added(gstMessage, &outdevice); 1494 1495 device = ObjectG.getDObject!(Device)(outdevice); 1496 } 1497 1498 /** 1499 * Parses a device-removed message. The device-removed message is produced by 1500 * #GstDeviceProvider or a #GstDeviceMonitor. It announces the 1501 * disappearance of monitored devices. 1502 * 1503 * Params: 1504 * device = A location where to store a 1505 * pointer to the removed #GstDevice, or %NULL 1506 * 1507 * Since: 1.4 1508 */ 1509 public void parseDeviceRemoved(out Device device) 1510 { 1511 GstDevice* outdevice = null; 1512 1513 gst_message_parse_device_removed(gstMessage, &outdevice); 1514 1515 device = ObjectG.getDObject!(Device)(outdevice); 1516 } 1517 1518 /** 1519 * Extracts the GError and debug string from the GstMessage. The values returned 1520 * in the output arguments are copies; the caller must free them when done. 1521 * 1522 * Typical usage of this function might be: 1523 * |[<!-- language="C" --> 1524 * ... 1525 * switch (GST_MESSAGE_TYPE (msg)) { 1526 * case GST_MESSAGE_ERROR: { 1527 * GError *err = NULL; 1528 * gchar *dbg_info = NULL; 1529 * 1530 * gst_message_parse_error (msg, &err, &dbg_info); 1531 * g_printerr ("ERROR from element %s: %s\n", 1532 * GST_OBJECT_NAME (msg->src), err->message); 1533 * g_printerr ("Debugging info: %s\n", (dbg_info) ? dbg_info : "none"); 1534 * g_error_free (err); 1535 * g_free (dbg_info); 1536 * break; 1537 * } 1538 * ... 1539 * } 1540 * ... 1541 * ]| 1542 * 1543 * MT safe. 1544 * 1545 * Params: 1546 * gerror = location for the GError 1547 * dbg = location for the debug message, 1548 * or %NULL 1549 */ 1550 public void parseError(out ErrorG gerror, out string dbg) 1551 { 1552 GError* outgerror = null; 1553 char* outdbg = null; 1554 1555 gst_message_parse_error(gstMessage, &outgerror, &outdbg); 1556 1557 gerror = new ErrorG(outgerror); 1558 dbg = Str.toString(outdbg); 1559 } 1560 1561 /** 1562 * Returns the optional details structure, may be NULL if none. 1563 * The returned structure must not be freed. 1564 * 1565 * Params: 1566 * structure = A pointer to the returned details 1567 * 1568 * Since: 1.10 1569 */ 1570 public void parseErrorDetails(out Structure structure) 1571 { 1572 GstStructure* outstructure = null; 1573 1574 gst_message_parse_error_details(gstMessage, &outstructure); 1575 1576 structure = ObjectG.getDObject!(Structure)(outstructure); 1577 } 1578 1579 /** 1580 * Extract the group from the STREAM_START message. 1581 * 1582 * Params: 1583 * groupId = Result location for the group id or 1584 * %NULL 1585 * 1586 * Returns: %TRUE if the message had a group id set, %FALSE otherwise 1587 * 1588 * MT safe. 1589 * 1590 * Since: 1.2 1591 */ 1592 public bool parseGroupId(out uint groupId) 1593 { 1594 return gst_message_parse_group_id(gstMessage, &groupId) != 0; 1595 } 1596 1597 /** 1598 * Extract the context from the HAVE_CONTEXT message. 1599 * 1600 * MT safe. 1601 * 1602 * Params: 1603 * context = Result location for the 1604 * context or %NULL 1605 * 1606 * Since: 1.2 1607 */ 1608 public void parseHaveContext(out Context context) 1609 { 1610 GstContext* outcontext = null; 1611 1612 gst_message_parse_have_context(gstMessage, &outcontext); 1613 1614 context = ObjectG.getDObject!(Context)(outcontext); 1615 } 1616 1617 /** 1618 * Extracts the GError and debug string from the GstMessage. The values returned 1619 * in the output arguments are copies; the caller must free them when done. 1620 * 1621 * MT safe. 1622 * 1623 * Params: 1624 * gerror = location for the GError 1625 * dbg = location for the debug message, 1626 * or %NULL 1627 */ 1628 public void parseInfo(out ErrorG gerror, out string dbg) 1629 { 1630 GError* outgerror = null; 1631 char* outdbg = null; 1632 1633 gst_message_parse_info(gstMessage, &outgerror, &outdbg); 1634 1635 gerror = new ErrorG(outgerror); 1636 dbg = Str.toString(outdbg); 1637 } 1638 1639 /** 1640 * Returns the optional details structure, may be NULL if none 1641 * The returned structure must not be freed. 1642 * 1643 * Params: 1644 * structure = A pointer to the returned details structure 1645 * 1646 * Since: 1.10 1647 */ 1648 public void parseInfoDetails(out Structure structure) 1649 { 1650 GstStructure* outstructure = null; 1651 1652 gst_message_parse_info_details(gstMessage, &outstructure); 1653 1654 structure = ObjectG.getDObject!(Structure)(outstructure); 1655 } 1656 1657 /** 1658 * Extracts the new clock from the GstMessage. 1659 * The clock object returned remains valid until the message is freed. 1660 * 1661 * MT safe. 1662 * 1663 * Params: 1664 * clock = a pointer to hold the selected 1665 * new clock 1666 */ 1667 public void parseNewClock(out Clock clock) 1668 { 1669 GstClock* outclock = null; 1670 1671 gst_message_parse_new_clock(gstMessage, &outclock); 1672 1673 clock = ObjectG.getDObject!(Clock)(outclock); 1674 } 1675 1676 /** 1677 * Parses the progress @type, @code and @text. 1678 * 1679 * Params: 1680 * type = location for the type 1681 * code = location for the code 1682 * text = location for the text 1683 */ 1684 public void parseProgress(out GstProgressType type, out string code, out string text) 1685 { 1686 char* outcode = null; 1687 char* outtext = null; 1688 1689 gst_message_parse_progress(gstMessage, &type, &outcode, &outtext); 1690 1691 code = Str.toString(outcode); 1692 text = Str.toString(outtext); 1693 } 1694 1695 /** 1696 * Parses a property-notify message. These will be posted on the bus only 1697 * when set up with gst_element_add_property_notify_watch() or 1698 * gst_element_add_property_deep_notify_watch(). 1699 * 1700 * Params: 1701 * object = location where to store a 1702 * pointer to the object whose property got changed, or %NULL 1703 * propertyName = return location for the name of the 1704 * property that got changed, or %NULL 1705 * propertyValue = return location for the new value of 1706 * the property that got changed, or %NULL. This will only be set if the 1707 * property notify watch was told to include the value when it was set up 1708 * 1709 * Since: 1.10 1710 */ 1711 public void parsePropertyNotify(out ObjectGst object, out string propertyName, out Value propertyValue) 1712 { 1713 GstObject* outobject = null; 1714 char* outpropertyName = null; 1715 GValue* outpropertyValue = null; 1716 1717 gst_message_parse_property_notify(gstMessage, &outobject, &outpropertyName, &outpropertyValue); 1718 1719 object = ObjectG.getDObject!(ObjectGst)(outobject); 1720 propertyName = Str.toString(outpropertyName); 1721 propertyValue = ObjectG.getDObject!(Value)(outpropertyValue); 1722 } 1723 1724 /** 1725 * Extract the timestamps and live status from the QoS message. 1726 * 1727 * The returned values give the running_time, stream_time, timestamp and 1728 * duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown 1729 * values. 1730 * 1731 * MT safe. 1732 * 1733 * Params: 1734 * live = if the message was generated by a live element 1735 * runningTime = the running time of the buffer that 1736 * generated the message 1737 * streamTime = the stream time of the buffer that 1738 * generated the message 1739 * timestamp = the timestamps of the buffer that 1740 * generated the message 1741 * duration = the duration of the buffer that 1742 * generated the message 1743 */ 1744 public void parseQos(out bool live, out ulong runningTime, out ulong streamTime, out ulong timestamp, out ulong duration) 1745 { 1746 int outlive; 1747 1748 gst_message_parse_qos(gstMessage, &outlive, &runningTime, &streamTime, ×tamp, &duration); 1749 1750 live = (outlive == 1); 1751 } 1752 1753 /** 1754 * Extract the QoS stats representing the history of the current continuous 1755 * pipeline playback period. 1756 * 1757 * When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are 1758 * invalid. Values of -1 for either @processed or @dropped mean unknown values. 1759 * 1760 * MT safe. 1761 * 1762 * Params: 1763 * format = Units of the 'processed' and 'dropped' fields. 1764 * Video sinks and video filters will use GST_FORMAT_BUFFERS (frames). 1765 * Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT 1766 * (samples). 1767 * processed = Total number of units correctly processed 1768 * since the last state change to READY or a flushing operation. 1769 * dropped = Total number of units dropped since the last 1770 * state change to READY or a flushing operation. 1771 */ 1772 public void parseQosStats(out GstFormat format, out ulong processed, out ulong dropped) 1773 { 1774 gst_message_parse_qos_stats(gstMessage, &format, &processed, &dropped); 1775 } 1776 1777 /** 1778 * Extract the QoS values that have been calculated/analysed from the QoS data 1779 * 1780 * MT safe. 1781 * 1782 * Params: 1783 * jitter = The difference of the running-time against 1784 * the deadline. 1785 * proportion = Long term prediction of the ideal rate 1786 * relative to normal rate to get optimal quality. 1787 * quality = An element dependent integer value that 1788 * specifies the current quality level of the element. The default 1789 * maximum quality is 1000000. 1790 */ 1791 public void parseQosValues(out long jitter, out double proportion, out int quality) 1792 { 1793 gst_message_parse_qos_values(gstMessage, &jitter, &proportion, &quality); 1794 } 1795 1796 /** 1797 * Parses the location and/or structure from the entry with the given index. 1798 * The index must be between 0 and gst_message_get_num_redirect_entries() - 1. 1799 * Returned pointers are valid for as long as this message exists. 1800 * 1801 * Params: 1802 * entryIndex = index of the entry to parse 1803 * location = return location for 1804 * the pointer to the entry's location string, or %NULL 1805 * tagList = return location for 1806 * the pointer to the entry's tag list, or %NULL 1807 * entryStruct = return location 1808 * for the pointer to the entry's structure, or %NULL 1809 * 1810 * Since: 1.10 1811 */ 1812 public void parseRedirectEntry(size_t entryIndex, out string location, out TagList tagList, out Structure entryStruct) 1813 { 1814 char* outlocation = null; 1815 GstTagList* outtagList = null; 1816 GstStructure* outentryStruct = null; 1817 1818 gst_message_parse_redirect_entry(gstMessage, entryIndex, &outlocation, &outtagList, &outentryStruct); 1819 1820 location = Str.toString(outlocation); 1821 tagList = ObjectG.getDObject!(TagList)(outtagList); 1822 entryStruct = ObjectG.getDObject!(Structure)(outentryStruct); 1823 } 1824 1825 /** 1826 * Extract the requested state from the request_state message. 1827 * 1828 * MT safe. 1829 * 1830 * Params: 1831 * state = Result location for the requested state or %NULL 1832 */ 1833 public void parseRequestState(out GstState state) 1834 { 1835 gst_message_parse_request_state(gstMessage, &state); 1836 } 1837 1838 /** 1839 * Extract the running-time from the RESET_TIME message. 1840 * 1841 * MT safe. 1842 * 1843 * Params: 1844 * runningTime = Result location for the running_time or 1845 * %NULL 1846 */ 1847 public void parseResetTime(out GstClockTime runningTime) 1848 { 1849 gst_message_parse_reset_time(gstMessage, &runningTime); 1850 } 1851 1852 /** 1853 * Extracts the position and format from the segment done message. 1854 * 1855 * MT safe. 1856 * 1857 * Params: 1858 * format = Result location for the format, or %NULL 1859 * position = Result location for the position, or %NULL 1860 */ 1861 public void parseSegmentDone(out GstFormat format, out long position) 1862 { 1863 gst_message_parse_segment_done(gstMessage, &format, &position); 1864 } 1865 1866 /** 1867 * Extracts the position and format from the segment start message. 1868 * 1869 * MT safe. 1870 * 1871 * Params: 1872 * format = Result location for the format, or %NULL 1873 * position = Result location for the position, or %NULL 1874 */ 1875 public void parseSegmentStart(out GstFormat format, out long position) 1876 { 1877 gst_message_parse_segment_start(gstMessage, &format, &position); 1878 } 1879 1880 /** 1881 * Extracts the old and new states from the GstMessage. 1882 * 1883 * Typical usage of this function might be: 1884 * |[<!-- language="C" --> 1885 * ... 1886 * switch (GST_MESSAGE_TYPE (msg)) { 1887 * case GST_MESSAGE_STATE_CHANGED: { 1888 * GstState old_state, new_state; 1889 * 1890 * gst_message_parse_state_changed (msg, &old_state, &new_state, NULL); 1891 * g_print ("Element %s changed state from %s to %s.\n", 1892 * GST_OBJECT_NAME (msg->src), 1893 * gst_element_state_get_name (old_state), 1894 * gst_element_state_get_name (new_state)); 1895 * break; 1896 * } 1897 * ... 1898 * } 1899 * ... 1900 * ]| 1901 * 1902 * MT safe. 1903 * 1904 * Params: 1905 * oldstate = the previous state, or %NULL 1906 * newstate = the new (current) state, or %NULL 1907 * pending = the pending (target) state, or %NULL 1908 */ 1909 public void parseStateChanged(out GstState oldstate, out GstState newstate, out GstState pending) 1910 { 1911 gst_message_parse_state_changed(gstMessage, &oldstate, &newstate, &pending); 1912 } 1913 1914 /** 1915 * Extract the values the step_done message. 1916 * 1917 * MT safe. 1918 * 1919 * Params: 1920 * format = result location for the format 1921 * amount = result location for the amount 1922 * rate = result location for the rate 1923 * flush = result location for the flush flag 1924 * intermediate = result location for the intermediate flag 1925 * duration = result location for the duration 1926 * eos = result location for the EOS flag 1927 */ 1928 public void parseStepDone(out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate, out ulong duration, out bool eos) 1929 { 1930 int outflush; 1931 int outintermediate; 1932 int outeos; 1933 1934 gst_message_parse_step_done(gstMessage, &format, &amount, &rate, &outflush, &outintermediate, &duration, &outeos); 1935 1936 flush = (outflush == 1); 1937 intermediate = (outintermediate == 1); 1938 eos = (outeos == 1); 1939 } 1940 1941 /** 1942 * Extract the values from step_start message. 1943 * 1944 * MT safe. 1945 * 1946 * Params: 1947 * active = result location for the active flag 1948 * format = result location for the format 1949 * amount = result location for the amount 1950 * rate = result location for the rate 1951 * flush = result location for the flush flag 1952 * intermediate = result location for the intermediate flag 1953 */ 1954 public void parseStepStart(out bool active, out GstFormat format, out ulong amount, out double rate, out bool flush, out bool intermediate) 1955 { 1956 int outactive; 1957 int outflush; 1958 int outintermediate; 1959 1960 gst_message_parse_step_start(gstMessage, &outactive, &format, &amount, &rate, &outflush, &outintermediate); 1961 1962 active = (outactive == 1); 1963 flush = (outflush == 1); 1964 intermediate = (outintermediate == 1); 1965 } 1966 1967 /** 1968 * Parses a stream-collection message. 1969 * 1970 * Params: 1971 * collection = A location where to store a 1972 * pointer to the #GstStreamCollection, or %NULL 1973 * 1974 * Since: 1.10 1975 */ 1976 public void parseStreamCollection(out StreamCollection collection) 1977 { 1978 GstStreamCollection* outcollection = null; 1979 1980 gst_message_parse_stream_collection(gstMessage, &outcollection); 1981 1982 collection = ObjectG.getDObject!(StreamCollection)(outcollection); 1983 } 1984 1985 /** 1986 * Extracts the stream status type and owner the GstMessage. The returned 1987 * owner remains valid for as long as the reference to @message is valid and 1988 * should thus not be unreffed. 1989 * 1990 * MT safe. 1991 * 1992 * Params: 1993 * type = A pointer to hold the status type 1994 * owner = The owner element of the message source 1995 */ 1996 public void parseStreamStatus(out GstStreamStatusType type, out Element owner) 1997 { 1998 GstElement* outowner = null; 1999 2000 gst_message_parse_stream_status(gstMessage, &type, &outowner); 2001 2002 owner = ObjectG.getDObject!(Element)(outowner); 2003 } 2004 2005 /** 2006 * Parses a streams-selected message. 2007 * 2008 * Params: 2009 * collection = A location where to store a 2010 * pointer to the #GstStreamCollection, or %NULL 2011 * 2012 * Since: 1.10 2013 */ 2014 public void parseStreamsSelected(out StreamCollection collection) 2015 { 2016 GstStreamCollection* outcollection = null; 2017 2018 gst_message_parse_streams_selected(gstMessage, &outcollection); 2019 2020 collection = ObjectG.getDObject!(StreamCollection)(outcollection); 2021 } 2022 2023 /** 2024 * Extracts the change type and completion status from the GstMessage. 2025 * 2026 * MT safe. 2027 * 2028 * Params: 2029 * type = A pointer to hold the change type 2030 * owner = The owner element of the 2031 * message source 2032 * busy = a pointer to hold whether the change is in 2033 * progress or has been completed 2034 */ 2035 public void parseStructureChange(out GstStructureChangeType type, out Element owner, out bool busy) 2036 { 2037 GstElement* outowner = null; 2038 int outbusy; 2039 2040 gst_message_parse_structure_change(gstMessage, &type, &outowner, &outbusy); 2041 2042 owner = ObjectG.getDObject!(Element)(outowner); 2043 busy = (outbusy == 1); 2044 } 2045 2046 /** 2047 * Extracts the tag list from the GstMessage. The tag list returned in the 2048 * output argument is a copy; the caller must free it when done. 2049 * 2050 * Typical usage of this function might be: 2051 * |[<!-- language="C" --> 2052 * ... 2053 * switch (GST_MESSAGE_TYPE (msg)) { 2054 * case GST_MESSAGE_TAG: { 2055 * GstTagList *tags = NULL; 2056 * 2057 * gst_message_parse_tag (msg, &tags); 2058 * g_print ("Got tags from element %s\n", GST_OBJECT_NAME (msg->src)); 2059 * handle_tags (tags); 2060 * gst_tag_list_unref (tags); 2061 * break; 2062 * } 2063 * ... 2064 * } 2065 * ... 2066 * ]| 2067 * 2068 * MT safe. 2069 * 2070 * Params: 2071 * tagList = return location for the tag-list. 2072 */ 2073 public void parseTag(out TagList tagList) 2074 { 2075 GstTagList* outtagList = null; 2076 2077 gst_message_parse_tag(gstMessage, &outtagList); 2078 2079 tagList = ObjectG.getDObject!(TagList)(outtagList); 2080 } 2081 2082 /** 2083 * Extract the TOC from the #GstMessage. The TOC returned in the 2084 * output argument is a copy; the caller must free it with 2085 * gst_toc_unref() when done. 2086 * 2087 * MT safe. 2088 * 2089 * Params: 2090 * toc = return location for the TOC. 2091 * updated = return location for the updated flag. 2092 */ 2093 public void parseToc(out Toc toc, out bool updated) 2094 { 2095 GstToc* outtoc = null; 2096 int outupdated; 2097 2098 gst_message_parse_toc(gstMessage, &outtoc, &outupdated); 2099 2100 toc = ObjectG.getDObject!(Toc)(outtoc); 2101 updated = (outupdated == 1); 2102 } 2103 2104 /** 2105 * Extracts the GError and debug string from the GstMessage. The values returned 2106 * in the output arguments are copies; the caller must free them when done. 2107 * 2108 * MT safe. 2109 * 2110 * Params: 2111 * gerror = location for the GError 2112 * dbg = location for the debug message, 2113 * or %NULL 2114 */ 2115 public void parseWarning(out ErrorG gerror, out string dbg) 2116 { 2117 GError* outgerror = null; 2118 char* outdbg = null; 2119 2120 gst_message_parse_warning(gstMessage, &outgerror, &outdbg); 2121 2122 gerror = new ErrorG(outgerror); 2123 dbg = Str.toString(outdbg); 2124 } 2125 2126 /** 2127 * Returns the optional details structure, may be NULL if none 2128 * The returned structure must not be freed. 2129 * 2130 * Params: 2131 * structure = A pointer to the returned details structure 2132 * 2133 * Since: 1.10 2134 */ 2135 public void parseWarningDetails(out Structure structure) 2136 { 2137 GstStructure* outstructure = null; 2138 2139 gst_message_parse_warning_details(gstMessage, &outstructure); 2140 2141 structure = ObjectG.getDObject!(Structure)(outstructure); 2142 } 2143 2144 /** 2145 * Configures the buffering stats values in @message. 2146 * 2147 * Params: 2148 * mode = a buffering mode 2149 * avgIn = the average input rate 2150 * avgOut = the average output rate 2151 * bufferingLeft = amount of buffering time left in milliseconds 2152 */ 2153 public void setBufferingStats(GstBufferingMode mode, int avgIn, int avgOut, long bufferingLeft) 2154 { 2155 gst_message_set_buffering_stats(gstMessage, mode, avgIn, avgOut, bufferingLeft); 2156 } 2157 2158 /** 2159 * Sets the group id on the stream-start message. 2160 * 2161 * All streams that have the same group id are supposed to be played 2162 * together, i.e. all streams inside a container file should have the 2163 * same group id but different stream ids. The group id should change 2164 * each time the stream is started, resulting in different group ids 2165 * each time a file is played for example. 2166 * 2167 * MT safe. 2168 * 2169 * Params: 2170 * groupId = the group id 2171 * 2172 * Since: 1.2 2173 */ 2174 public void setGroupId(uint groupId) 2175 { 2176 gst_message_set_group_id(gstMessage, groupId); 2177 } 2178 2179 /** 2180 * Set the QoS stats representing the history of the current continuous pipeline 2181 * playback period. 2182 * 2183 * When @format is @GST_FORMAT_UNDEFINED both @dropped and @processed are 2184 * invalid. Values of -1 for either @processed or @dropped mean unknown values. 2185 * 2186 * MT safe. 2187 * 2188 * Params: 2189 * format = Units of the 'processed' and 'dropped' fields. Video sinks and video 2190 * filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters 2191 * will likely use GST_FORMAT_DEFAULT (samples). 2192 * processed = Total number of units correctly processed since the last state 2193 * change to READY or a flushing operation. 2194 * dropped = Total number of units dropped since the last state change to READY 2195 * or a flushing operation. 2196 */ 2197 public void setQosStats(GstFormat format, ulong processed, ulong dropped) 2198 { 2199 gst_message_set_qos_stats(gstMessage, format, processed, dropped); 2200 } 2201 2202 /** 2203 * Set the QoS values that have been calculated/analysed from the QoS data 2204 * 2205 * MT safe. 2206 * 2207 * Params: 2208 * jitter = The difference of the running-time against the deadline. 2209 * proportion = Long term prediction of the ideal rate relative to normal rate 2210 * to get optimal quality. 2211 * quality = An element dependent integer value that specifies the current 2212 * quality level of the element. The default maximum quality is 1000000. 2213 */ 2214 public void setQosValues(long jitter, double proportion, int quality) 2215 { 2216 gst_message_set_qos_values(gstMessage, jitter, proportion, quality); 2217 } 2218 2219 /** 2220 * Set the sequence number of a message. 2221 * 2222 * This function might be called by the creator of a message to indicate that 2223 * the message relates to other messages or events. See gst_message_get_seqnum() 2224 * for more information. 2225 * 2226 * MT safe. 2227 * 2228 * Params: 2229 * seqnum = A sequence number. 2230 */ 2231 public void setSeqnum(uint seqnum) 2232 { 2233 gst_message_set_seqnum(gstMessage, seqnum); 2234 } 2235 2236 /** 2237 * Configures the object handling the streaming thread. This is usually a 2238 * GstTask object but other objects might be added in the future. 2239 * 2240 * Params: 2241 * object = the object controlling the streaming 2242 */ 2243 public void setStreamStatusObject(Value object) 2244 { 2245 gst_message_set_stream_status_object(gstMessage, (object is null) ? null : object.getValueStruct()); 2246 } 2247 2248 /** 2249 * Adds the @stream to the @message. 2250 * 2251 * Params: 2252 * stream = a #GstStream to add to @message 2253 * 2254 * Since: 1.10 2255 */ 2256 public void streamsSelectedAdd(Stream stream) 2257 { 2258 gst_message_streams_selected_add(gstMessage, (stream is null) ? null : stream.getStreamStruct()); 2259 } 2260 2261 /** 2262 * Returns the number of streams contained in the @message. 2263 * 2264 * Returns: The number of streams contained within. 2265 * 2266 * Since: 1.10 2267 */ 2268 public uint streamsSelectedGetSize() 2269 { 2270 return gst_message_streams_selected_get_size(gstMessage); 2271 } 2272 2273 /** 2274 * Retrieves the #GstStream with index @index from the @message. 2275 * 2276 * Params: 2277 * idx = Index of the stream to retrieve 2278 * 2279 * Returns: A #GstStream 2280 * 2281 * Since: 1.10 2282 */ 2283 public Stream streamsSelectedGetStream(uint idx) 2284 { 2285 auto p = gst_message_streams_selected_get_stream(gstMessage, idx); 2286 2287 if(p is null) 2288 { 2289 return null; 2290 } 2291 2292 return ObjectG.getDObject!(Stream)(cast(GstStream*) p, true); 2293 } 2294 2295 /** 2296 * Get a printable name for the given message type. Do not modify or free. 2297 * 2298 * Params: 2299 * type = the message type 2300 * 2301 * Returns: a reference to the static name of the message. 2302 */ 2303 public static string typeGetName(GstMessageType type) 2304 { 2305 return Str.toString(gst_message_type_get_name(type)); 2306 } 2307 2308 /** 2309 * Get the unique quark for the given message type. 2310 * 2311 * Params: 2312 * type = the message type 2313 * 2314 * Returns: the quark associated with the message type 2315 */ 2316 public static GQuark typeToQuark(GstMessageType type) 2317 { 2318 return gst_message_type_to_quark(type); 2319 } 2320 }