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 * Conversion parameters: 26 * inFile = gstreamer-GstMessage.html 27 * outPack = gstreamer 28 * outFile = Message 29 * strct = GstMessage 30 * realStrct= 31 * ctorStrct= 32 * clss = Message 33 * interf = 34 * class Code: Yes 35 * interface Code: No 36 * template for: 37 * extend = 38 * implements: 39 * prefixes: 40 * - gst_message_ 41 * omit structs: 42 * - GstMessage 43 * omit prefixes: 44 * omit code: 45 * - gst_message_parse_tag 46 * - gst_message_new_element 47 * - gst_message_new_new_clock 48 * - gst_message_new_segment_done 49 * - gst_message_new_segment_start 50 * - gst_message_new_warning 51 * - gst_message_new_state_dirty 52 * - gst_message_new_eos 53 * - gst_message_new_error 54 * - gst_message_new_info 55 * - gst_message_new_latency 56 * - gst_message_new_duration_changed 57 * - gst_message_new_async_start 58 * - gst_message_new_reset_time 59 * omit signals: 60 * imports: 61 * - glib.Str 62 * - glib.ErrorG 63 * - gobject.Value 64 * - gstreamer.Clock 65 * - gstreamer.Context 66 * - gstreamer.Element 67 * - gstreamer.ObjectGst 68 * - gstreamer.Structure 69 * - gstreamer.TagList 70 * - gstreamer.Toc 71 * structWrap: 72 * - GError* -> ErrorG 73 * - GValue* -> Value 74 * - GstClock* -> Clock 75 * - GstContext* -> Context 76 * - GstElement* -> Element 77 * - GstMessage* -> Message 78 * - GstObject* -> ObjectGst 79 * - GstStructure* -> Structure 80 * - GstTagList* -> TagList 81 * - GstToc* -> Toc 82 * module aliases: 83 * local aliases: 84 * overrides: 85 */ 86 87 module gstreamer.Message; 88 89 public import gstreamerc.gstreamertypes; 90 91 private import gstreamerc.gstreamer; 92 private import glib.ConstructionException; 93 private import gobject.ObjectG; 94 95 private import glib.Str; 96 private import glib.ErrorG; 97 private import gobject.Value; 98 private import gstreamer.Clock; 99 private import gstreamer.Context; 100 private import gstreamer.Element; 101 private import gstreamer.ObjectGst; 102 private import gstreamer.Structure; 103 private import gstreamer.TagList; 104 private import gstreamer.Toc; 105 106 107 108 /** 109 * Messages are implemented as a subclass of GstMiniObject with a generic 110 * GstStructure as the content. This allows for writing custom messages without 111 * requiring an API change while allowing a wide range of different types 112 * of messages. 113 * 114 * Messages are posted by objects in the pipeline and are passed to the 115 * application using the GstBus. 116 * 117 * The basic use pattern of posting a message on a GstBus is as follows: 118 * 119 * $(DDOC_COMMENT example) 120 * 121 * A GstElement usually posts messages on the bus provided by the parent 122 * container using gst_element_post_message(). 123 * 124 * Last reviewed on 2005-11-09 (0.9.4) 125 */ 126 public class Message 127 { 128 129 /** the main Gtk struct */ 130 protected GstMessage* gstMessage; 131 132 133 /** Get the main Gtk struct */ 134 public GstMessage* getMessageStruct() 135 { 136 return gstMessage; 137 } 138 139 140 /** the main Gtk struct as a void* */ 141 protected void* getStruct() 142 { 143 return cast(void*)gstMessage; 144 } 145 146 /** 147 * Sets our main struct and passes it to the parent class 148 */ 149 public this (GstMessage* gstMessage) 150 { 151 this.gstMessage = gstMessage; 152 } 153 154 /** 155 * Get the type of the message. 156 */ 157 public GstMessageType type() 158 { 159 return cast(GstMessageType)getMessageStruct().type; 160 } 161 162 /** 163 * Get the src (the element that originated the message) of the message. 164 */ 165 public ObjectGst src() 166 { 167 return new ObjectGst( cast(GstObject*)getMessageStruct().src ); 168 } 169 170 /** 171 * Create a new element-specific message. This is meant as a generic way of 172 * allowing one-way communication from an element to an application, for example 173 * "the firewire cable was unplugged". The format of the message should be 174 * documented in the element's documentation. The structure field can be NULL. 175 * MT safe. 176 * Params: 177 * src = The object originating the message. 178 * structure = The structure for the message. The message will take ownership of 179 * the structure. 180 * Returns: 181 * The new element message. 182 */ 183 public static Message newElement(ObjectGst src, Structure structure) 184 { 185 // GstMessage* gst_message_new_element (GstObject *src, GstStructure *structure); 186 auto p = gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()); 187 188 if(p is null) 189 { 190 throw new ConstructionException("null returned by gst_message_new_element"); 191 } 192 193 return new Message(cast(GstMessage*)p); 194 } 195 196 /** 197 * Create a new clock message. This message is posted whenever the 198 * pipeline selectes a new clock for the pipeline. 199 * MT safe. 200 * Params: 201 * src = The object originating the message. 202 * clock = the new selected clock 203 * Returns: 204 * The new new clock message. 205 */ 206 public static Message newNewClock(ObjectGst src, Clock clock) 207 { 208 // GstMessage* gst_message_new_new_clock (GstObject *src, GstClock *clock); 209 auto p = gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()); 210 211 if(p is null) 212 { 213 throw new ConstructionException("null returned by gst_message_new_new_clock"); 214 } 215 216 return new Message(cast(GstMessage*)p ); 217 } 218 219 /** 220 * Create a new segment done message. This message is posted by elements that 221 * finish playback of a segment as a result of a segment seek. This message 222 * is received by the application after all elements that posted a segment_start 223 * have posted the segment_done. 224 * MT safe. 225 * Params: 226 * src = The object originating the message. 227 * format = The format of the position being done 228 * position = The position of the segment being done 229 * Returns: 230 * The new segment done message. 231 */ 232 public static Message newSegmentDone(ObjectGst src, GstFormat format, long position) 233 { 234 // GstMessage* gst_message_new_segment_done (GstObject *src, GstFormat format, gint64 position); 235 auto p = gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position); 236 237 if(p is null) 238 { 239 throw new ConstructionException("null returned by gst_message_new_segment_done"); 240 } 241 242 return new Message(cast(GstMessage*)p ); 243 } 244 245 /** 246 * Create a new segment message. This message is posted by elements that 247 * start playback of a segment as a result of a segment seek. This message 248 * is not received by the application but is used for maintenance reasons in 249 * container elements. 250 * MT safe. 251 * Params: 252 * src = The object originating the message. 253 * format = The format of the position being played 254 * position = The position of the segment being played 255 * Returns: 256 * The new segment start message. 257 */ 258 public static Message newSegmentStart(ObjectGst src, GstFormat format, long position) 259 { 260 // GstMessage* gst_message_new_segment_start (GstObject *src, GstFormat format, gint64 position); 261 auto p = gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position); 262 263 if(p is null) 264 { 265 throw new ConstructionException("null returned by gst_message_new_segment_start"); 266 } 267 268 return new Message(cast(GstMessage*)p ); 269 } 270 271 /** 272 * Create a new warning message. The message will make copies of error and 273 * debug. 274 * MT safe. 275 * Params: 276 * src = The object originating the message. 277 * error = The GError for this message. 278 * debug = A debugging string for something or other. 279 * Returns: 280 * The new warning message. 281 */ 282 public static Message newWarning(ObjectGst src, ErrorG error, string dbug) 283 { 284 // GstMessage* gst_message_new_warning (GstObject *src, GError *error, gchar *debug); 285 auto p = gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)); 286 287 if(p is null) 288 { 289 throw new ConstructionException("null returned by gst_message_new_warning"); 290 } 291 292 return new Message(cast(GstMessage*)p ); 293 } 294 295 /** 296 * Create a state dirty message. This message is posted whenever an element 297 * changed its state asynchronously and is used internally to update the 298 * states of container objects. 299 * MT safe. 300 * Params: 301 * src = the object originating the message 302 * Returns: 303 * The new state dirty message. 304 */ 305 public static Message newStateDirty(ObjectGst src) 306 { 307 // GstMessage* gst_message_new_state_dirty (GstObject *src); 308 auto p = gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct()); 309 310 if(p is null) 311 { 312 throw new ConstructionException("null returned by gst_message_new_state_dirty"); 313 } 314 315 return new Message(cast(GstMessage*)p ); 316 } 317 318 /** 319 * Create a new eos message. This message is generated and posted in 320 * the sink elements of a GstBin. The bin will only forward the EOS 321 * message to the application if all sinks have posted an EOS message. 322 * MT safe. 323 * Params: 324 * src = The object originating the message. 325 * Returns: 326 * The new eos message. 327 */ 328 public static Message newEOS(ObjectGst src) 329 { 330 // GstMessage* gst_message_new_eos (GstObject *src); 331 auto p = gst_message_new_eos((src is null) ? null : src.getObjectGstStruct()); 332 333 if(p is null) 334 { 335 throw new ConstructionException("null returned by gst_message_new_eos"); 336 } 337 338 return new Message(cast(GstMessage*)p ); 339 } 340 341 /** 342 * Create a new error message. The message will copy error and 343 * debug. This message is posted by element when a fatal event 344 * occured. The pipeline will probably (partially) stop. The application 345 * receiving this message should stop the pipeline. 346 * MT safe. 347 * Params: 348 * src = The object originating the message. 349 * error = The GError for this message. 350 * debug = A debugging string for something or other. 351 * Returns: 352 * The new error message. 353 */ 354 public static Message newError(ObjectGst src, ErrorG error, string dbug) 355 { 356 // GstMessage* gst_message_new_error (GstObject *src, GError *error, gchar *debug); 357 auto p = gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)); 358 359 if(p is null) 360 { 361 throw new ConstructionException("null returned by gst_message_new_error"); 362 } 363 364 return new Message(cast(GstMessage*)p ); 365 } 366 367 /** 368 * Create a new info message. The message will make copies of error and 369 * debug. 370 * MT safe. 371 * Since 0.10.12 372 * Params: 373 * src = The object originating the message. 374 * error = The GError for this message. 375 * debug = A debugging string for something or other. 376 * Returns: 377 * The new info message. 378 */ 379 public static Message newInfo(ObjectGst src, ErrorG error, string dbug) 380 { 381 // GstMessage* gst_message_new_info (GstObject *src, GError *error, gchar *debug); 382 auto p = gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)); 383 384 if(p is null) 385 { 386 throw new ConstructionException("null returned by gst_message_new_info"); 387 } 388 389 return new Message(cast(GstMessage*)p ); 390 } 391 392 /** 393 * This message can be posted by elements when their latency requirements 394 * have changed. 395 * Params: 396 * src = The object originating the message. 397 * Returns: 398 * The new latency message. MT safe. 399 */ 400 public static Message newLatency(ObjectGst src) 401 { 402 // GstMessage* gst_message_new_latency (GstObject *src); 403 auto p = gst_message_new_latency((src is null) ? null : src.getObjectGstStruct()); 404 405 if(p is null) 406 { 407 throw new ConstructionException("null returned by gst_message_new_latency"); 408 } 409 410 return new Message(cast(GstMessage*)p ); 411 } 412 413 /** 414 * Create a new duration changed message. This message is posted by elements 415 * that know the duration of a stream when the duration changes. This message 416 * is received by bins and is used to calculate the total duration of a 417 * pipeline. Elements may post a duration message with a duration of 418 * GST_CLOCK_TIME_NONE to indicate that the duration has changed and the 419 * cached duration should be discarded. The new duration can then be 420 * retrieved via a query. 421 * Params: 422 * src = The object originating the message. [transfer none] 423 * Throws: ConstructionException GTK+ fails to create the object. 424 */ 425 public static Message newDurationChanged(ObjectGst src) 426 { 427 // GstMessage * gst_message_new_duration_changed (GstObject *src); 428 auto p = gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct()); 429 430 if(p is null) 431 { 432 throw new ConstructionException("null returned by gst_message_new_duration_changed((src is null) ? null : src.getObjectGstStruct())"); 433 } 434 435 return new Message(cast(GstMessage*)p ); 436 } 437 438 /** 439 * This message is posted by elements when they start an ASYNC state change. 440 * Params: 441 * src = The object originating the message. [transfer none] 442 * Throws: ConstructionException GTK+ fails to create the object. 443 */ 444 public static Message newAsyncStart(ObjectGst src) 445 { 446 // GstMessage * gst_message_new_async_start (GstObject *src); 447 auto p = gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct()); 448 if(p is null) 449 { 450 throw new ConstructionException("null returned by gst_message_new_async_start((src is null) ? null : src.getObjectGstStruct())"); 451 } 452 return new Message(cast(GstMessage*)p ); 453 } 454 455 /** 456 * The message is posted when elements completed an ASYNC state change. 457 * running_time contains the time of the desired running_time when this 458 * elements goes to PLAYING. A value of GST_CLOCK_TIME_NONE for running_time 459 * means that the element has no clock interaction and thus doesn't care about 460 * the running_time of the pipeline. 461 * Params: 462 * src = The object originating the message. [transfer none] 463 * runningTime = the desired running_time 464 * Throws: ConstructionException GTK+ fails to create the object. 465 */ 466 public static Message newAsyncDone(ObjectGst src, GstClockTime runningTime) 467 { 468 // GstMessage * gst_message_new_async_done (GstObject *src, GstClockTime running_time); 469 auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime); 470 if(p is null) 471 { 472 throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime)"); 473 } 474 return new Message(cast(GstMessage*)p ); 475 } 476 477 /** 478 */ 479 480 /** 481 * Get the unique quark for the given message type. 482 * Params: 483 * type = the message type 484 * Returns: the quark associated with the message type 485 */ 486 public static GQuark typeToQuark(GstMessageType type) 487 { 488 // GQuark gst_message_type_to_quark (GstMessageType type); 489 return gst_message_type_to_quark(type); 490 } 491 492 /** 493 * Get a printable name for the given message type. Do not modify or free. 494 * Params: 495 * type = the message type 496 * Returns: a reference to the static name of the message. 497 */ 498 public static string typeGetName(GstMessageType type) 499 { 500 // const gchar * gst_message_type_get_name (GstMessageType type); 501 return Str.toString(gst_message_type_get_name(type)); 502 } 503 504 /** 505 * Convenience macro to increase the reference count of the message. 506 * Returns: msg (for convenience when doing assignments) 507 */ 508 public Message doref() 509 { 510 // GstMessage * gst_message_ref (GstMessage *msg); 511 auto p = gst_message_ref(gstMessage); 512 513 if(p is null) 514 { 515 return null; 516 } 517 518 return ObjectG.getDObject!(Message)(cast(GstMessage*) p); 519 } 520 521 /** 522 * Convenience macro to decrease the reference count of the message, possibly 523 * freeing it. 524 */ 525 public void unref() 526 { 527 // void gst_message_unref (GstMessage *msg); 528 gst_message_unref(gstMessage); 529 } 530 531 /** 532 * Creates a copy of the message. Returns a copy of the message. 533 * Returns: a new copy of msg. MT safe. [transfer full] 534 */ 535 public Message copy() 536 { 537 // GstMessage * gst_message_copy (const GstMessage *msg); 538 auto p = gst_message_copy(gstMessage); 539 540 if(p is null) 541 { 542 return null; 543 } 544 545 return ObjectG.getDObject!(Message)(cast(GstMessage*) p); 546 } 547 548 /** 549 * Access the structure of the message. 550 * Returns: The structure of the message. The structure is still owned by the message, which means that you should not free it and that the pointer becomes invalid when you free the message. MT safe. [transfer none] 551 */ 552 public Structure getStructure() 553 { 554 // const GstStructure * gst_message_get_structure (GstMessage *message); 555 auto p = gst_message_get_structure(gstMessage); 556 557 if(p is null) 558 { 559 return null; 560 } 561 562 return ObjectG.getDObject!(Structure)(cast(GstStructure*) p); 563 } 564 565 /** 566 * Retrieve the sequence number of a message. 567 * Messages have ever-incrementing sequence numbers, which may also be set 568 * explicitly via gst_message_set_seqnum(). Sequence numbers are typically used 569 * to indicate that a message corresponds to some other set of messages or 570 * events, for example a SEGMENT_DONE message corresponding to a SEEK event. It 571 * is considered good practice to make this correspondence when possible, though 572 * it is not required. 573 * Note that events and messages share the same sequence number incrementor; 574 * two events or messages will never have the same sequence number unless 575 * that correspondence was made explicitly. 576 * Returns: The message's sequence number. MT safe. 577 */ 578 public uint getSeqnum() 579 { 580 // guint32 gst_message_get_seqnum (GstMessage *message); 581 return gst_message_get_seqnum(gstMessage); 582 } 583 584 /** 585 * Set the sequence number of a message. 586 * This function might be called by the creator of a message to indicate that 587 * the message relates to other messages or events. See gst_message_get_seqnum() 588 * for more information. 589 * MT safe. 590 * Params: 591 * seqnum = A sequence number. 592 */ 593 public void setSeqnum(uint seqnum) 594 { 595 // void gst_message_set_seqnum (GstMessage *message, guint32 seqnum); 596 gst_message_set_seqnum(gstMessage, seqnum); 597 } 598 599 /** 600 * Checks if message has the given name. This function is usually used to 601 * check the name of a custom message. 602 * Params: 603 * name = name to check 604 * Returns: TRUE if name matches the name of the message structure. 605 */ 606 public int hasName(string name) 607 { 608 // gboolean gst_message_has_name (GstMessage *message, const gchar *name); 609 return gst_message_has_name(gstMessage, Str.toStringz(name)); 610 } 611 612 /** 613 * Modifies a pointer to a GstMessage to point to a different GstMessage. The 614 * modification is done atomically (so this is useful for ensuring thread safety 615 * in some cases), and the reference counts are updated appropriately (the old 616 * message is unreffed, the new one is reffed). 617 * Either new_message or the GstMessage pointed to by old_message may be NULL. 618 * Params: 619 * oldMessage = pointer to a pointer to a GstMessage 620 * to be replaced. [inout][transfer full] 621 * newMessage = pointer to a GstMessage that will 622 * replace the message pointed to by old_message. [allow-none][transfer none] 623 * Returns: TRUE if new_message was different from old_message 624 */ 625 public static int replace(ref Message oldMessage, Message newMessage) 626 { 627 // gboolean gst_message_replace (GstMessage **old_message, GstMessage *new_message); 628 GstMessage* outoldMessage = (oldMessage is null) ? null : oldMessage.getMessageStruct(); 629 630 auto p = gst_message_replace(&outoldMessage, (newMessage is null) ? null : newMessage.getMessageStruct()); 631 632 oldMessage = ObjectG.getDObject!(Message)(outoldMessage); 633 return p; 634 } 635 636 /** 637 * Extracts the GError and debug string from the GstMessage. The values returned 638 * in the output arguments are copies; the caller must free them when done. 639 * Params: 640 * gerror = location for the GError. [out][allow-none][transfer full] 641 */ 642 public void parseError(out ErrorG gerror, out string dbug) 643 { 644 // void gst_message_parse_error (GstMessage *message, GError **gerror, gchar **debug); 645 GError* outgerror = null; 646 char* outdbug = null; 647 648 gst_message_parse_error(gstMessage, &outgerror, &outdbug); 649 650 gerror = ObjectG.getDObject!(ErrorG)(outgerror); 651 dbug = Str.toString(outdbug); 652 } 653 654 /** 655 * Extracts the GError and debug string from the GstMessage. The values returned 656 * in the output arguments are copies; the caller must free them when done. 657 * MT safe. 658 * Params: 659 * gerror = location for the GError. [out][allow-none][transfer full] 660 */ 661 public void parseWarning(out ErrorG gerror, out string dbug) 662 { 663 // void gst_message_parse_warning (GstMessage *message, GError **gerror, gchar **debug); 664 GError* outgerror = null; 665 char* outdbug = null; 666 667 gst_message_parse_warning(gstMessage, &outgerror, &outdbug); 668 669 gerror = ObjectG.getDObject!(ErrorG)(outgerror); 670 dbug = Str.toString(outdbug); 671 } 672 673 /** 674 * Extracts the GError and debug string from the GstMessage. The values returned 675 * in the output arguments are copies; the caller must free them when done. 676 * MT safe. 677 * Params: 678 * gerror = location for the GError. [out][allow-none][transfer full] 679 */ 680 public void parseInfo(out ErrorG gerror, out string dbug) 681 { 682 // void gst_message_parse_info (GstMessage *message, GError **gerror, gchar **debug); 683 GError* outgerror = null; 684 char* outdbug = null; 685 686 gst_message_parse_info(gstMessage, &outgerror, &outdbug); 687 688 gerror = ObjectG.getDObject!(ErrorG)(outgerror); 689 dbug = Str.toString(outdbug); 690 } 691 692 /** 693 * Create a new tag message. The message will take ownership of the tag list. 694 * The message is posted by elements that discovered a new taglist. 695 * Params: 696 * src = The object originating the message. [transfer none] 697 * tagList = the tag list for the message. [transfer full] 698 * Throws: ConstructionException GTK+ fails to create the object. 699 */ 700 public this (ObjectGst src, TagList tagList) 701 { 702 // GstMessage * gst_message_new_tag (GstObject *src, GstTagList *tag_list); 703 auto p = gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct()); 704 if(p is null) 705 { 706 throw new ConstructionException("null returned by gst_message_new_tag((src is null) ? null : src.getObjectGstStruct(), (tagList is null) ? null : tagList.getTagListStruct())"); 707 } 708 this(cast(GstMessage*) p); 709 } 710 711 /** 712 * Create a new buffering message. This message can be posted by an element that 713 * needs to buffer data before it can continue processing. percent should be a 714 * value between 0 and 100. A value of 100 means that the buffering completed. 715 * When percent is < 100 the application should PAUSE a PLAYING pipeline. When 716 * percent is 100, the application can set the pipeline (back) to PLAYING. 717 * The application must be prepared to receive BUFFERING messages in the 718 * PREROLLING state and may only set the pipeline to PLAYING after receiving a 719 * message with percent set to 100, which can happen after the pipeline 720 * completed prerolling. 721 * MT safe. 722 * Params: 723 * src = The object originating the message. [transfer none] 724 * percent = The buffering percent 725 * Throws: ConstructionException GTK+ fails to create the object. 726 */ 727 public this (ObjectGst src, int percent) 728 { 729 // GstMessage * gst_message_new_buffering (GstObject *src, gint percent); 730 auto p = gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent); 731 if(p is null) 732 { 733 throw new ConstructionException("null returned by gst_message_new_buffering((src is null) ? null : src.getObjectGstStruct(), percent)"); 734 } 735 this(cast(GstMessage*) p); 736 } 737 738 /** 739 * Extracts the buffering percent from the GstMessage. see also 740 * gst_message_new_buffering(). 741 * MT safe. 742 * Params: 743 * percent = Return location for the percent. [out][allow-none] 744 */ 745 public void parseBuffering(out int percent) 746 { 747 // void gst_message_parse_buffering (GstMessage *message, gint *percent); 748 gst_message_parse_buffering(gstMessage, &percent); 749 } 750 751 /** 752 * Configures the buffering stats values in message. 753 * Params: 754 * mode = a buffering mode 755 * avgIn = the average input rate 756 * avgOut = the average output rate 757 * bufferingLeft = amount of buffering time left in milliseconds 758 */ 759 public void setBufferingStats(GstBufferingMode mode, int avgIn, int avgOut, long bufferingLeft) 760 { 761 // void gst_message_set_buffering_stats (GstMessage *message, GstBufferingMode mode, gint avg_in, gint avg_out, gint64 buffering_left); 762 gst_message_set_buffering_stats(gstMessage, mode, avgIn, avgOut, bufferingLeft); 763 } 764 765 /** 766 * Extracts the buffering stats values from message. 767 * Params: 768 * mode = a buffering mode, or NULL. [out][allow-none] 769 * avgIn = the average input rate, or NULL. [out][allow-none] 770 * avgOut = the average output rate, or NULL. [out][allow-none] 771 * bufferingLeft = amount of buffering time left in 772 * milliseconds, or NULL. [out][allow-none] 773 */ 774 public void parseBufferingStats(out GstBufferingMode mode, out int avgIn, out int avgOut, out long bufferingLeft) 775 { 776 // void gst_message_parse_buffering_stats (GstMessage *message, GstBufferingMode *mode, gint *avg_in, gint *avg_out, gint64 *buffering_left); 777 gst_message_parse_buffering_stats(gstMessage, &mode, &avgIn, &avgOut, &bufferingLeft); 778 } 779 780 /** 781 * Create a state change message. This message is posted whenever an element 782 * changed its state. 783 * Params: 784 * src = the object originating the message. [transfer none] 785 * oldstate = the previous state 786 * newstate = the new (current) state 787 * pending = the pending (target) state 788 * Throws: ConstructionException GTK+ fails to create the object. 789 */ 790 public this (ObjectGst src, GstState oldstate, GstState newstate, GstState pending) 791 { 792 // GstMessage * gst_message_new_state_changed (GstObject *src, GstState oldstate, GstState newstate, GstState pending); 793 auto p = gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending); 794 if(p is null) 795 { 796 throw new ConstructionException("null returned by gst_message_new_state_changed((src is null) ? null : src.getObjectGstStruct(), oldstate, newstate, pending)"); 797 } 798 this(cast(GstMessage*) p); 799 } 800 801 /** 802 * Extracts the old and new states from the GstMessage. 803 * Params: 804 * oldstate = the previous state, or NULL. [out][allow-none] 805 * newstate = the new (current) state, or NULL. [out][allow-none] 806 * pending = the pending (target) state, or NULL. [out][allow-none] 807 */ 808 public void parseStateChanged(out GstState oldstate, out GstState newstate, out GstState pending) 809 { 810 // void gst_message_parse_state_changed (GstMessage *message, GstState *oldstate, GstState *newstate, GstState *pending); 811 gst_message_parse_state_changed(gstMessage, &oldstate, &newstate, &pending); 812 } 813 814 /** 815 * This message is posted by elements when they complete a part, when intermediate set 816 * to TRUE, or a complete step operation. 817 * duration will contain the amount of time (in GST_FORMAT_TIME) of the stepped 818 * amount of media in format format. 819 * Params: 820 * src = The object originating the message. 821 * format = the format of amount 822 * amount = the amount of stepped data 823 * rate = the rate of the stepped amount 824 * flush = is this an flushing step 825 * intermediate = is this an intermediate step 826 * duration = the duration of the data 827 * eos = the step caused EOS 828 * Throws: ConstructionException GTK+ fails to create the object. 829 */ 830 public this (ObjectGst src, GstFormat format, ulong amount, double rate, int flush, int intermediate, ulong duration, int eos) 831 { 832 // GstMessage * gst_message_new_step_done (GstObject *src, GstFormat format, guint64 amount, gdouble rate, gboolean flush, gboolean intermediate, guint64 duration, gboolean eos); 833 auto p = gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos); 834 if(p is null) 835 { 836 throw new ConstructionException("null returned by gst_message_new_step_done((src is null) ? null : src.getObjectGstStruct(), format, amount, rate, flush, intermediate, duration, eos)"); 837 } 838 this(cast(GstMessage*) p); 839 } 840 841 /** 842 * Extract the values the step_done message. 843 * MT safe. 844 * Params: 845 * format = result location for the format. [out][allow-none] 846 * amount = result location for the amount. [out][allow-none] 847 * rate = result location for the rate. [out][allow-none] 848 * flush = result location for the flush flag. [out][allow-none] 849 * intermediate = result location for the intermediate flag. [out][allow-none] 850 * duration = result location for the duration. [out][allow-none] 851 * eos = result location for the EOS flag. [out][allow-none] 852 */ 853 public void parseStepDone(out GstFormat format, out ulong amount, out double rate, out int flush, out int intermediate, out ulong duration, out int eos) 854 { 855 // void gst_message_parse_step_done (GstMessage *message, GstFormat *format, guint64 *amount, gdouble *rate, gboolean *flush, gboolean *intermediate, guint64 *duration, gboolean *eos); 856 gst_message_parse_step_done(gstMessage, &format, &amount, &rate, &flush, &intermediate, &duration, &eos); 857 } 858 859 /** 860 * Create a clock provide message. This message is posted whenever an 861 * element is ready to provide a clock or lost its ability to provide 862 * a clock (maybe because it paused or became EOS). 863 * This message is mainly used internally to manage the clock 864 * selection. 865 * Params: 866 * src = the object originating the message. [transfer none] 867 * clock = the clock it provides. [transfer none] 868 * ready = TRUE if the sender can provide a clock 869 * Throws: ConstructionException GTK+ fails to create the object. 870 */ 871 public this (ObjectGst src, Clock clock, int ready) 872 { 873 // GstMessage * gst_message_new_clock_provide (GstObject *src, GstClock *clock, gboolean ready); 874 auto p = gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready); 875 if(p is null) 876 { 877 throw new ConstructionException("null returned by gst_message_new_clock_provide((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct(), ready)"); 878 } 879 this(cast(GstMessage*) p); 880 } 881 882 /** 883 * Extracts the clock and ready flag from the GstMessage. 884 * The clock object returned remains valid until the message is freed. 885 * MT safe. 886 * Params: 887 * clock = a pointer to hold a clock 888 * object, or NULL. [out][allow-none][transfer none] 889 * ready = a pointer to hold the ready flag, or NULL. [out][allow-none] 890 */ 891 public void parseClockProvide(out Clock clock, out int ready) 892 { 893 // void gst_message_parse_clock_provide (GstMessage *message, GstClock **clock, gboolean *ready); 894 GstClock* outclock = null; 895 896 gst_message_parse_clock_provide(gstMessage, &outclock, &ready); 897 898 clock = ObjectG.getDObject!(Clock)(outclock); 899 } 900 901 /** 902 * Create a clock lost message. This message is posted whenever the 903 * clock is not valid anymore. 904 * If this message is posted by the pipeline, the pipeline will 905 * select a new clock again when it goes to PLAYING. It might therefore 906 * be needed to set the pipeline to PAUSED and PLAYING again. 907 * Params: 908 * src = the object originating the message. [transfer none] 909 * clock = the clock that was lost. [transfer none] 910 * Throws: ConstructionException GTK+ fails to create the object. 911 */ 912 public this (ObjectGst src, Clock clock) 913 { 914 // GstMessage * gst_message_new_clock_lost (GstObject *src, GstClock *clock); 915 auto p = gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()); 916 if(p is null) 917 { 918 throw new ConstructionException("null returned by gst_message_new_clock_lost((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct())"); 919 } 920 this(cast(GstMessage*) p); 921 } 922 923 /** 924 * Extracts the lost clock from the GstMessage. 925 * The clock object returned remains valid until the message is freed. 926 * MT safe. 927 * Params: 928 * clock = a pointer to hold the lost clock. [out][allow-none][transfer none] 929 */ 930 public void parseClockLost(out Clock clock) 931 { 932 // void gst_message_parse_clock_lost (GstMessage *message, GstClock **clock); 933 GstClock* outclock = null; 934 935 gst_message_parse_clock_lost(gstMessage, &outclock); 936 937 clock = ObjectG.getDObject!(Clock)(outclock); 938 } 939 940 /** 941 * Extracts the new clock from the GstMessage. 942 * The clock object returned remains valid until the message is freed. 943 * MT safe. 944 * Params: 945 * clock = a pointer to hold the selected 946 * new clock. [out][allow-none][transfer none] 947 */ 948 public void parseNewClock(out Clock clock) 949 { 950 // void gst_message_parse_new_clock (GstMessage *message, GstClock **clock); 951 GstClock* outclock = null; 952 953 gst_message_parse_new_clock(gstMessage, &outclock); 954 955 clock = ObjectG.getDObject!(Clock)(outclock); 956 } 957 958 /** 959 * Create a new application-typed message. GStreamer will never create these 960 * messages; they are a gift from us to you. Enjoy. 961 * Params: 962 * src = the object originating the message. [transfer none] 963 * structure = the structure for the message. The message 964 * will take ownership of the structure. [transfer full] 965 * Throws: ConstructionException GTK+ fails to create the object. 966 */ 967 public this (ObjectGst src, Structure structure) 968 { 969 // GstMessage * gst_message_new_application (GstObject *src, GstStructure *structure); 970 auto p = gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()); 971 if(p is null) 972 { 973 throw new ConstructionException("null returned by gst_message_new_application((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct())"); 974 } 975 this(cast(GstMessage*) p); 976 } 977 978 /** 979 * Create a new custom-typed message. This can be used for anything not 980 * handled by other message-specific functions to pass a message to the 981 * app. The structure field can be NULL. 982 * Params: 983 * type = The GstMessageType to distinguish messages 984 * src = The object originating the message. 985 * structure = the structure for the message. The message 986 * will take ownership of the structure. [transfer full] 987 * Throws: ConstructionException GTK+ fails to create the object. 988 */ 989 public this (GstMessageType type, ObjectGst src, Structure structure) 990 { 991 // GstMessage * gst_message_new_custom (GstMessageType type, GstObject *src, GstStructure *structure); 992 auto p = gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()); 993 if(p is null) 994 { 995 throw new ConstructionException("null returned by gst_message_new_custom(type, (src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct())"); 996 } 997 this(cast(GstMessage*) p); 998 } 999 1000 /** 1001 * Extracts the position and format from the segment start message. 1002 * MT safe. 1003 * Params: 1004 * format = Result location for the format, or NULL. [out][allow-none] 1005 * position = Result location for the position, or NULL. [out][allow-none] 1006 */ 1007 public void parseSegmentStart(out GstFormat format, out long position) 1008 { 1009 // void gst_message_parse_segment_start (GstMessage *message, GstFormat *format, gint64 *position); 1010 gst_message_parse_segment_start(gstMessage, &format, &position); 1011 } 1012 1013 /** 1014 * Extracts the position and format from the segment done message. 1015 * MT safe. 1016 * Params: 1017 * format = Result location for the format, or NULL. [out][allow-none] 1018 * position = Result location for the position, or NULL. [out][allow-none] 1019 */ 1020 public void parseSegmentDone(out GstFormat format, out long position) 1021 { 1022 // void gst_message_parse_segment_done (GstMessage *message, GstFormat *format, gint64 *position); 1023 gst_message_parse_segment_done(gstMessage, &format, &position); 1024 } 1025 1026 /** 1027 * The message is posted when elements completed an ASYNC state change. 1028 * running_time contains the time of the desired running_time when this 1029 * elements goes to PLAYING. A value of GST_CLOCK_TIME_NONE for running_time 1030 * means that the element has no clock interaction and thus doesn't care about 1031 * the running_time of the pipeline. 1032 * Params: 1033 * src = The object originating the message. [transfer none] 1034 * runningTime = the desired running_time 1035 * Throws: ConstructionException GTK+ fails to create the object. 1036 */ 1037 public this (ObjectGst src, GstClockTime runningTime) 1038 { 1039 // GstMessage * gst_message_new_async_done (GstObject *src, GstClockTime running_time); 1040 auto p = gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime); 1041 if(p is null) 1042 { 1043 throw new ConstructionException("null returned by gst_message_new_async_done((src is null) ? null : src.getObjectGstStruct(), runningTime)"); 1044 } 1045 this(cast(GstMessage*) p); 1046 } 1047 1048 /** 1049 * Extract the running_time from the async_done message. 1050 * MT safe. 1051 * Params: 1052 * runningTime = Result location for the running_time or NULL. [out][allow-none] 1053 */ 1054 public void parseAsyncDone(out GstClockTime runningTime) 1055 { 1056 // void gst_message_parse_async_done (GstMessage *message, GstClockTime *running_time); 1057 gst_message_parse_async_done(gstMessage, &runningTime); 1058 } 1059 1060 /** 1061 * This message is posted by elements when they accept or activate a new step 1062 * event for amount in format. 1063 * active is set to FALSE when the element accepted the new step event and has 1064 * queued it for execution in the streaming threads. 1065 * active is set to TRUE when the element has activated the step operation and 1066 * is now ready to start executing the step in the streaming thread. After this 1067 * message is emited, the application can queue a new step operation in the 1068 * element. 1069 * Params: 1070 * src = The object originating the message. 1071 * active = if the step is active or queued 1072 * format = the format of amount 1073 * amount = the amount of stepped data 1074 * rate = the rate of the stepped amount 1075 * flush = is this an flushing step 1076 * intermediate = is this an intermediate step 1077 * Throws: ConstructionException GTK+ fails to create the object. 1078 */ 1079 public this (ObjectGst src, int active, GstFormat format, ulong amount, double rate, int flush, int intermediate) 1080 { 1081 // GstMessage * gst_message_new_step_start (GstObject *src, gboolean active, GstFormat format, guint64 amount, gdouble rate, gboolean flush, gboolean intermediate); 1082 auto p = gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate); 1083 if(p is null) 1084 { 1085 throw new ConstructionException("null returned by gst_message_new_step_start((src is null) ? null : src.getObjectGstStruct(), active, format, amount, rate, flush, intermediate)"); 1086 } 1087 this(cast(GstMessage*) p); 1088 } 1089 1090 /** 1091 * Extract the values from step_start message. 1092 * MT safe. 1093 * Params: 1094 * active = result location for the active flag. [out][allow-none] 1095 * format = result location for the format. [out][allow-none] 1096 * amount = result location for the amount. [out][allow-none] 1097 * rate = result location for the rate. [out][allow-none] 1098 * flush = result location for the flush flag. [out][allow-none] 1099 * intermediate = result location for the intermediate flag. [out][allow-none] 1100 */ 1101 public void parseStepStart(out int active, out GstFormat format, out ulong amount, out double rate, out int flush, out int intermediate) 1102 { 1103 // void gst_message_parse_step_start (GstMessage *message, gboolean *active, GstFormat *format, guint64 *amount, gdouble *rate, gboolean *flush, gboolean *intermediate); 1104 gst_message_parse_step_start(gstMessage, &active, &format, &amount, &rate, &flush, &intermediate); 1105 } 1106 1107 /** 1108 * A QOS message is posted on the bus whenever an element decides to drop a 1109 * buffer because of QoS reasons or whenever it changes its processing strategy 1110 * because of QoS reasons (quality adjustments such as processing at lower 1111 * accuracy). 1112 * This message can be posted by an element that performs synchronisation against the 1113 * clock (live) or it could be dropped by an element that performs QoS because of QOS 1114 * events received from a downstream element (!live). 1115 * running_time, stream_time, timestamp, duration should be set to the 1116 * respective running-time, stream-time, timestamp and duration of the (dropped) 1117 * buffer that generated the QoS event. Values can be left to 1118 * GST_CLOCK_TIME_NONE when unknown. 1119 * Params: 1120 * src = The object originating the message. 1121 * live = if the message was generated by a live element 1122 * runningTime = the running time of the buffer that generated the message 1123 * streamTime = the stream time of the buffer that generated the message 1124 * timestamp = the timestamps of the buffer that generated the message 1125 * duration = the duration of the buffer that generated the message 1126 * Throws: ConstructionException GTK+ fails to create the object. 1127 */ 1128 public this (ObjectGst src, int live, ulong runningTime, ulong streamTime, ulong timestamp, ulong duration) 1129 { 1130 // GstMessage * gst_message_new_qos (GstObject *src, gboolean live, guint64 running_time, guint64 stream_time, guint64 timestamp, guint64 duration); 1131 auto p = gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration); 1132 if(p is null) 1133 { 1134 throw new ConstructionException("null returned by gst_message_new_qos((src is null) ? null : src.getObjectGstStruct(), live, runningTime, streamTime, timestamp, duration)"); 1135 } 1136 this(cast(GstMessage*) p); 1137 } 1138 1139 /** 1140 * Set the QoS values that have been calculated/analysed from the QoS data 1141 * MT safe. 1142 * Params: 1143 * jitter = The difference of the running-time against the deadline. 1144 * proportion = Long term prediction of the ideal rate relative to normal rate 1145 * to get optimal quality. 1146 * quality = An element dependent integer value that specifies the current 1147 * quality level of the element. The default maximum quality is 1000000. 1148 */ 1149 public void setQosValues(long jitter, double proportion, int quality) 1150 { 1151 // void gst_message_set_qos_values (GstMessage *message, gint64 jitter, gdouble proportion, gint quality); 1152 gst_message_set_qos_values(gstMessage, jitter, proportion, quality); 1153 } 1154 1155 /** 1156 * Set the QoS stats representing the history of the current continuous pipeline 1157 * playback period. 1158 * When format is GST_FORMAT_UNDEFINED both dropped and processed are 1159 * invalid. Values of -1 for either processed or dropped mean unknown values. 1160 * MT safe. 1161 * Params: 1162 * format = Units of the 'processed' and 'dropped' fields. Video sinks and video 1163 * filters will use GST_FORMAT_BUFFERS (frames). Audio sinks and audio filters 1164 * will likely use GST_FORMAT_DEFAULT (samples). 1165 * processed = Total number of units correctly processed since the last state 1166 * change to READY or a flushing operation. 1167 * dropped = Total number of units dropped since the last state change to READY 1168 * or a flushing operation. 1169 */ 1170 public void setQosStats(GstFormat format, ulong processed, ulong dropped) 1171 { 1172 // void gst_message_set_qos_stats (GstMessage *message, GstFormat format, guint64 processed, guint64 dropped); 1173 gst_message_set_qos_stats(gstMessage, format, processed, dropped); 1174 } 1175 1176 /** 1177 * Extract the timestamps and live status from the QoS message. 1178 * The returned values give the running_time, stream_time, timestamp and 1179 * duration of the dropped buffer. Values of GST_CLOCK_TIME_NONE mean unknown 1180 * values. 1181 * MT safe. 1182 * Params: 1183 * live = if the message was generated by a live element. [out][allow-none] 1184 * runningTime = the running time of the buffer that 1185 * generated the message. [out][allow-none] 1186 * streamTime = the stream time of the buffer that 1187 * generated the message. [out][allow-none] 1188 * timestamp = the timestamps of the buffer that 1189 * generated the message. [out][allow-none] 1190 * duration = the duration of the buffer that 1191 * generated the message. [out][allow-none] 1192 */ 1193 public void parseQos(out int live, ulong* runningTime, out ulong streamTime, out ulong timestamp, out ulong duration) 1194 { 1195 // void gst_message_parse_qos (GstMessage *message, gboolean *live, guint64 *running_time, guint64 *stream_time, guint64 *timestamp, guint64 *duration); 1196 gst_message_parse_qos(gstMessage, &live, runningTime, &streamTime, ×tamp, &duration); 1197 } 1198 1199 /** 1200 * Extract the QoS values that have been calculated/analysed from the QoS data 1201 * MT safe. 1202 * Params: 1203 * jitter = The difference of the running-time against 1204 * the deadline. [out][allow-none] 1205 * proportion = Long term prediction of the ideal rate 1206 * relative to normal rate to get optimal quality. [out][allow-none] 1207 * quality = An element dependent integer value that 1208 * specifies the current quality level of the element. The default 1209 * maximum quality is 1000000. [out][allow-none] 1210 */ 1211 public void parseQosValues(out long jitter, out double proportion, out int quality) 1212 { 1213 // void gst_message_parse_qos_values (GstMessage *message, gint64 *jitter, gdouble *proportion, gint *quality); 1214 gst_message_parse_qos_values(gstMessage, &jitter, &proportion, &quality); 1215 } 1216 1217 /** 1218 * Extract the QoS stats representing the history of the current continuous 1219 * pipeline playback period. 1220 * When format is GST_FORMAT_UNDEFINED both dropped and processed are 1221 * invalid. Values of -1 for either processed or dropped mean unknown values. 1222 * MT safe. 1223 * Params: 1224 * format = Units of the 'processed' and 'dropped' fields. 1225 * Video sinks and video filters will use GST_FORMAT_BUFFERS (frames). 1226 * Audio sinks and audio filters will likely use GST_FORMAT_DEFAULT 1227 * (samples). [out][allow-none] 1228 * processed = Total number of units correctly processed 1229 * since the last state change to READY or a flushing operation. [out][allow-none] 1230 * dropped = Total number of units dropped since the last 1231 * state change to READY or a flushing operation. [out][allow-none] 1232 */ 1233 public void parseQosStats(out GstFormat format, out ulong processed, out ulong dropped) 1234 { 1235 // void gst_message_parse_qos_stats (GstMessage *message, GstFormat *format, guint64 *processed, guint64 *dropped); 1236 gst_message_parse_qos_stats(gstMessage, &format, &processed, &dropped); 1237 } 1238 1239 /** 1240 * Create a new TOC message. The message is posted by elements 1241 * that discovered or updated a TOC. 1242 * Params: 1243 * src = the object originating the message. 1244 * toc = GstToc structure for the message. [transfer none] 1245 * updated = whether TOC was updated or not. 1246 * Throws: ConstructionException GTK+ fails to create the object. 1247 */ 1248 public this (ObjectGst src, Toc toc, int updated) 1249 { 1250 // GstMessage * gst_message_new_toc (GstObject *src, GstToc *toc, gboolean updated); 1251 auto p = gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated); 1252 if(p is null) 1253 { 1254 throw new ConstructionException("null returned by gst_message_new_toc((src is null) ? null : src.getObjectGstStruct(), (toc is null) ? null : toc.getTocStruct(), updated)"); 1255 } 1256 this(cast(GstMessage*) p); 1257 } 1258 1259 /** 1260 * Extract thef TOC from the GstMessage. The TOC returned in the 1261 * output argument is a copy; the caller must free it with 1262 * gst_toc_unref() when done. 1263 * MT safe. 1264 * Params: 1265 * toc = return location for the TOC. [out][transfer full] 1266 * updated = return location for the updated flag. [out] 1267 */ 1268 public void parseToc(out Toc toc, out int updated) 1269 { 1270 // void gst_message_parse_toc (GstMessage *message, GstToc **toc, gboolean *updated); 1271 GstToc* outtoc = null; 1272 1273 gst_message_parse_toc(gstMessage, &outtoc, &updated); 1274 1275 toc = ObjectG.getDObject!(Toc)(outtoc); 1276 } 1277 1278 /** 1279 * Extract the running-time from the RESET_TIME message. 1280 * MT safe. 1281 * Params: 1282 * runningTime = Result location for the running_time or 1283 * NULL. [out][allow-none] 1284 */ 1285 public void parseResetTime(GstClockTime* runningTime) 1286 { 1287 // void gst_message_parse_reset_time (GstMessage *message, GstClockTime *running_time); 1288 gst_message_parse_reset_time(gstMessage, runningTime); 1289 } 1290 1291 /** 1292 * Create a new stream_start message. This message is generated and posted in 1293 * the sink elements of a GstBin. The bin will only forward the STREAM_START 1294 * message to the application if all sinks have posted an STREAM_START message. 1295 * Params: 1296 * src = The object originating the message. [transfer none] 1297 * Throws: ConstructionException GTK+ fails to create the object. 1298 */ 1299 public this (ObjectGst src) 1300 { 1301 // GstMessage * gst_message_new_stream_start (GstObject *src); 1302 auto p = gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct()); 1303 if(p is null) 1304 { 1305 throw new ConstructionException("null returned by gst_message_new_stream_start((src is null) ? null : src.getObjectGstStruct())"); 1306 } 1307 this(cast(GstMessage*) p); 1308 } 1309 1310 /** 1311 * Sets the group id on the stream-start message. 1312 * All streams that have the same group id are supposed to be played 1313 * together, i.e. all streams inside a container file should have the 1314 * same group id but different stream ids. The group id should change 1315 * each time the stream is started, resulting in different group ids 1316 * each time a file is played for example. 1317 * MT safe. 1318 * Since 1.2 1319 * Params: 1320 * groupId = the group id 1321 */ 1322 public void setGroupId(uint groupId) 1323 { 1324 // void gst_message_set_group_id (GstMessage *message, guint group_id); 1325 gst_message_set_group_id(gstMessage, groupId); 1326 } 1327 1328 /** 1329 * Extract the group from the STREAM_START message. 1330 * Since 1.2 1331 * Params: 1332 * groupId = Result location for the group id or 1333 * NULL. [out][allow-none] 1334 * Returns: TRUE if the message had a group id set, FALSE otherwise MT safe. 1335 */ 1336 public int parseGroupId(out uint groupId) 1337 { 1338 // gboolean gst_message_parse_group_id (GstMessage *message, guint *group_id); 1339 return gst_message_parse_group_id(gstMessage, &groupId); 1340 } 1341 1342 /** 1343 * Create a new structure change message. This message is posted when the 1344 * structure of a pipeline is in the process of being changed, for example 1345 * when pads are linked or unlinked. 1346 * src should be the sinkpad that unlinked or linked. 1347 * Params: 1348 * src = The object originating the message. [transfer none] 1349 * type = The change type. 1350 * owner = The owner element of src. [transfer none] 1351 * busy = Whether the structure change is busy. 1352 * Throws: ConstructionException GTK+ fails to create the object. 1353 */ 1354 public this (ObjectGst src, GstStructureChangeType type, Element owner, int busy) 1355 { 1356 // GstMessage * gst_message_new_structure_change (GstObject *src, GstStructureChangeType type, GstElement *owner, gboolean busy); 1357 auto p = gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy); 1358 if(p is null) 1359 { 1360 throw new ConstructionException("null returned by gst_message_new_structure_change((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct(), busy)"); 1361 } 1362 this(cast(GstMessage*) p); 1363 } 1364 1365 /** 1366 * Extracts the change type and completion status from the GstMessage. 1367 * MT safe. 1368 * Params: 1369 * type = A pointer to hold the change type. [out] 1370 * owner = The owner element of the 1371 * message source. [out][allow-none][transfer none] 1372 * busy = a pointer to hold whether the change is in 1373 * progress or has been completed. [out][allow-none] 1374 */ 1375 public void parseStructureChange(out GstStructureChangeType type, out Element owner, out int busy) 1376 { 1377 // void gst_message_parse_structure_change (GstMessage *message, GstStructureChangeType *type, GstElement **owner, gboolean *busy); 1378 GstElement* outowner = null; 1379 1380 gst_message_parse_structure_change(gstMessage, &type, &outowner, &busy); 1381 1382 owner = ObjectG.getDObject!(Element)(outowner); 1383 } 1384 1385 /** 1386 * This message can be posted by elements when they want to have their state 1387 * changed. A typical use case would be an audio server that wants to pause the 1388 * pipeline because a higher priority stream is being played. 1389 * Params: 1390 * src = the object originating the message. [transfer none] 1391 * state = The new requested state 1392 * Throws: ConstructionException GTK+ fails to create the object. 1393 */ 1394 public this (ObjectGst src, GstState state) 1395 { 1396 // GstMessage * gst_message_new_request_state (GstObject *src, GstState state); 1397 auto p = gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state); 1398 if(p is null) 1399 { 1400 throw new ConstructionException("null returned by gst_message_new_request_state((src is null) ? null : src.getObjectGstStruct(), state)"); 1401 } 1402 this(cast(GstMessage*) p); 1403 } 1404 1405 /** 1406 * Extract the requested state from the request_state message. 1407 * MT safe. 1408 * Params: 1409 * state = Result location for the requested state or NULL. [out][allow-none] 1410 */ 1411 public void parseRequestState(out GstState state) 1412 { 1413 // void gst_message_parse_request_state (GstMessage *message, GstState *state); 1414 gst_message_parse_request_state(gstMessage, &state); 1415 } 1416 1417 /** 1418 * Create a new stream status message. This message is posted when a streaming 1419 * thread is created/destroyed or when the state changed. 1420 * Params: 1421 * src = The object originating the message. 1422 * type = The stream status type. 1423 * owner = the owner element of src. [transfer none] 1424 * Throws: ConstructionException GTK+ fails to create the object. 1425 */ 1426 public this (ObjectGst src, GstStreamStatusType type, Element owner) 1427 { 1428 // GstMessage * gst_message_new_stream_status (GstObject *src, GstStreamStatusType type, GstElement *owner); 1429 auto p = gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct()); 1430 if(p is null) 1431 { 1432 throw new ConstructionException("null returned by gst_message_new_stream_status((src is null) ? null : src.getObjectGstStruct(), type, (owner is null) ? null : owner.getElementStruct())"); 1433 } 1434 this(cast(GstMessage*) p); 1435 } 1436 1437 /** 1438 * Extracts the stream status type and owner the GstMessage. The returned 1439 * owner remains valid for as long as the reference to message is valid and 1440 * should thus not be unreffed. 1441 * MT safe. 1442 * Params: 1443 * type = A pointer to hold the status type. [out] 1444 * owner = The owner element of the message source. [out][transfer none] 1445 */ 1446 public void parseStreamStatus(out GstStreamStatusType type, out Element owner) 1447 { 1448 // void gst_message_parse_stream_status (GstMessage *message, GstStreamStatusType *type, GstElement **owner); 1449 GstElement* outowner = null; 1450 1451 gst_message_parse_stream_status(gstMessage, &type, &outowner); 1452 1453 owner = ObjectG.getDObject!(Element)(outowner); 1454 } 1455 1456 /** 1457 * Configures the object handling the streaming thread. This is usually a 1458 * GstTask object but other objects might be added in the future. 1459 * Params: 1460 * object = the object controlling the streaming 1461 */ 1462 public void setStreamStatusObject(Value object) 1463 { 1464 // void gst_message_set_stream_status_object (GstMessage *message, const GValue *object); 1465 gst_message_set_stream_status_object(gstMessage, (object is null) ? null : object.getValueStruct()); 1466 } 1467 1468 /** 1469 * Extracts the object managing the streaming thread from message. 1470 * Returns: a GValue containing the object that manages the streaming thread. This object is usually of type GstTask but other types can be added in the future. The object remains valid as long as message is valid. 1471 */ 1472 public Value getStreamStatusObject() 1473 { 1474 // const GValue * gst_message_get_stream_status_object (GstMessage *message); 1475 auto p = gst_message_get_stream_status_object(gstMessage); 1476 1477 if(p is null) 1478 { 1479 return null; 1480 } 1481 1482 return ObjectG.getDObject!(Value)(cast(GValue*) p); 1483 } 1484 1485 /** 1486 * Progress messages are posted by elements when they use an asynchronous task 1487 * to perform actions triggered by a state change. 1488 * code contains a well defined string describing the action. 1489 * test should contain a user visible string detailing the current action. 1490 * Params: 1491 * src = The object originating the message. 1492 * type = a GstProgressType 1493 * code = a progress code 1494 * text = free, user visible text describing the progress 1495 * Throws: ConstructionException GTK+ fails to create the object. 1496 */ 1497 public this (ObjectGst src, GstProgressType type, string code, string text) 1498 { 1499 // GstMessage * gst_message_new_progress (GstObject *src, GstProgressType type, const gchar *code, const gchar *text); 1500 auto p = gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text)); 1501 if(p is null) 1502 { 1503 throw new ConstructionException("null returned by gst_message_new_progress((src is null) ? null : src.getObjectGstStruct(), type, Str.toStringz(code), Str.toStringz(text))"); 1504 } 1505 this(cast(GstMessage*) p); 1506 } 1507 1508 /** 1509 * Parses the progress type, code and text. 1510 * Params: 1511 * type = location for the type. [out][allow-none] 1512 * code = location for the code. [out][allow-none][transfer full] 1513 * text = location for the text. [out][allow-none][transfer full] 1514 */ 1515 public void parseProgress(out GstProgressType type, out string code, out string text) 1516 { 1517 // void gst_message_parse_progress (GstMessage *message, GstProgressType *type, gchar **code, gchar **text); 1518 char* outcode = null; 1519 char* outtext = null; 1520 1521 gst_message_parse_progress(gstMessage, &type, &outcode, &outtext); 1522 1523 code = Str.toString(outcode); 1524 text = Str.toString(outtext); 1525 } 1526 1527 /** 1528 * This message is posted when an element needs a specific GstContext. 1529 * Since 1.2 1530 * Params: 1531 * src = The object originating the message. [transfer none] 1532 * contextType = The context type that is needed 1533 * Throws: ConstructionException GTK+ fails to create the object. 1534 */ 1535 public this (ObjectGst src, string contextType) 1536 { 1537 // GstMessage * gst_message_new_need_context (GstObject *src, const gchar *context_type); 1538 auto p = gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType)); 1539 if(p is null) 1540 { 1541 throw new ConstructionException("null returned by gst_message_new_need_context((src is null) ? null : src.getObjectGstStruct(), Str.toStringz(contextType))"); 1542 } 1543 this(cast(GstMessage*) p); 1544 } 1545 1546 /** 1547 * Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message. 1548 * Since 1.2 1549 * Params: 1550 * contextType = the context type, or NULL. [out][allow-none] 1551 * Returns: a gboolean indicating if the parsing succeeded. 1552 */ 1553 public int parseContextType(out string contextType) 1554 { 1555 // gboolean gst_message_parse_context_type (GstMessage *message, const gchar **context_type); 1556 char* outcontextType = null; 1557 1558 auto p = gst_message_parse_context_type(gstMessage, &outcontextType); 1559 1560 contextType = Str.toString(outcontextType); 1561 return p; 1562 } 1563 1564 /** 1565 * This message is posted when an element has a new local GstContext. 1566 * Since 1.2 1567 * Params: 1568 * src = The object originating the message. [transfer none] 1569 * context = the context. [transfer full] 1570 * Throws: ConstructionException GTK+ fails to create the object. 1571 */ 1572 public this (ObjectGst src, Context context) 1573 { 1574 // GstMessage * gst_message_new_have_context (GstObject *src, GstContext *context); 1575 auto p = gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct()); 1576 if(p is null) 1577 { 1578 throw new ConstructionException("null returned by gst_message_new_have_context((src is null) ? null : src.getObjectGstStruct(), (context is null) ? null : context.getContextStruct())"); 1579 } 1580 this(cast(GstMessage*) p); 1581 } 1582 1583 /** 1584 * Extract the context from the HAVE_CONTEXT message. 1585 * MT safe. 1586 * Since 1.2 1587 * Params: 1588 * context = Result location for the 1589 * context or NULL. [out][transfer full][allow-none] 1590 */ 1591 public void parseHaveContext(out Context context) 1592 { 1593 // void gst_message_parse_have_context (GstMessage *message, GstContext **context); 1594 GstContext* outcontext = null; 1595 1596 gst_message_parse_have_context(gstMessage, &outcontext); 1597 1598 context = ObjectG.getDObject!(Context)(outcontext); 1599 } 1600 }