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 gst.mpegts.Descriptor; 26 27 private import glib.ArrayG; 28 private import glib.MemorySlice; 29 private import glib.PtrArray; 30 private import glib.Str; 31 private import glib.c.functions; 32 private import gobject.ObjectG; 33 private import gst.mpegts.CableDeliverySystemDescriptor; 34 private import gst.mpegts.ComponentDescriptor; 35 private import gst.mpegts.Content; 36 private import gst.mpegts.DVBLinkageDescriptor; 37 private import gst.mpegts.DVBParentalRatingItem; 38 private import gst.mpegts.DVBServiceListItem; 39 private import gst.mpegts.DataBroadcastDescriptor; 40 private import gst.mpegts.DvbMultilingualBouquetNameItem; 41 private import gst.mpegts.DvbMultilingualComponentItem; 42 private import gst.mpegts.DvbMultilingualNetworkNameItem; 43 private import gst.mpegts.DvbMultilingualServiceNameItem; 44 private import gst.mpegts.ExtendedEventDescriptor; 45 private import gst.mpegts.ISO639LanguageDescriptor; 46 private import gst.mpegts.LogicalChannelDescriptor; 47 private import gst.mpegts.SatelliteDeliverySystemDescriptor; 48 private import gst.mpegts.T2DeliverySystemDescriptor; 49 private import gst.mpegts.TerrestrialDeliverySystemDescriptor; 50 private import gst.mpegts.c.functions; 51 public import gst.mpegts.c.types; 52 private import gtkd.Loader; 53 54 55 /** 56 * These are the base descriptor types and methods. 57 * 58 * For more details, refer to the ITU H.222.0 or ISO/IEC 13818-1 specifications 59 * and other specifications mentioned in the documentation. 60 */ 61 public class Descriptor 62 { 63 /** the main Gtk struct */ 64 protected GstMpegtsDescriptor* gstMpegtsDescriptor; 65 protected bool ownedRef; 66 67 /** Get the main Gtk struct */ 68 public GstMpegtsDescriptor* getDescriptorStruct(bool transferOwnership = false) 69 { 70 if (transferOwnership) 71 ownedRef = false; 72 return gstMpegtsDescriptor; 73 } 74 75 /** the main Gtk struct as a void* */ 76 protected void* getStruct() 77 { 78 return cast(void*)gstMpegtsDescriptor; 79 } 80 81 /** 82 * Sets our main struct and passes it to the parent class. 83 */ 84 public this (GstMpegtsDescriptor* gstMpegtsDescriptor, bool ownedRef = false) 85 { 86 this.gstMpegtsDescriptor = gstMpegtsDescriptor; 87 this.ownedRef = ownedRef; 88 } 89 90 ~this () 91 { 92 if ( Linker.isLoaded(LIBRARY_GSTMPEGTS) && ownedRef ) 93 gst_mpegts_descriptor_free(gstMpegtsDescriptor); 94 } 95 96 /** 97 * Parses out the stuffing bytes from the @descriptor. 98 * 99 * Params: 100 * stuffingBytes = the stuffing bytes 101 * 102 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 103 */ 104 public bool parseDvbStuffing(out ubyte[] stuffingBytes) 105 { 106 ubyte* outstuffingBytes = null; 107 108 auto p = gst_mpegts_descriptor_parse_dvb_stuffing(gstMpegtsDescriptor, &outstuffingBytes) != 0; 109 110 stuffingBytes = outstuffingBytes[0 .. gstMpegtsDescriptor.length]; 111 112 return p; 113 } 114 115 /** 116 */ 117 118 /** */ 119 public static GType getType() 120 { 121 return gst_mpegts_descriptor_get_type(); 122 } 123 124 /** 125 * Frees @desc 126 */ 127 public void free() 128 { 129 gst_mpegts_descriptor_free(gstMpegtsDescriptor); 130 ownedRef = false; 131 } 132 133 /** 134 * Extracts the Conditional Access information from @descriptor. 135 * 136 * Params: 137 * caSystemId = the type of CA system used 138 * caPid = The PID containing ECM or EMM data 139 * privateData = The private data 140 * 141 * Returns: %TRUE if parsing succeeded, else %FALSE. 142 */ 143 public bool parseCa(out ushort caSystemId, out ushort caPid, out ubyte[] privateData) 144 { 145 ubyte* outprivateData; 146 size_t privateDataSize; 147 148 auto __p = gst_mpegts_descriptor_parse_ca(gstMpegtsDescriptor, &caSystemId, &caPid, &outprivateData, &privateDataSize) != 0; 149 150 privateData = outprivateData[0 .. privateDataSize]; 151 152 return __p; 153 } 154 155 /** 156 * Extracts the cable delivery system information from @descriptor. 157 * 158 * Params: 159 * res = the #GstMpegtsCableDeliverySystemDescriptor to fill 160 * 161 * Returns: %TRUE if parsing succeeded, else %FALSE. 162 */ 163 public bool parseCableDeliverySystem(out CableDeliverySystemDescriptor res) 164 { 165 GstMpegtsCableDeliverySystemDescriptor* outres = sliceNew!GstMpegtsCableDeliverySystemDescriptor(); 166 167 auto __p = gst_mpegts_descriptor_parse_cable_delivery_system(gstMpegtsDescriptor, outres) != 0; 168 169 res = ObjectG.getDObject!(CableDeliverySystemDescriptor)(outres, true); 170 171 return __p; 172 } 173 174 /** 175 * Extracts the bouquet name from @descriptor. 176 * 177 * Params: 178 * bouquetName = the bouquet name 179 * 180 * Returns: %TRUE if parsing succeeded, else %FALSE. 181 */ 182 public bool parseDvbBouquetName(out string bouquetName) 183 { 184 char* outbouquetName = null; 185 186 auto __p = gst_mpegts_descriptor_parse_dvb_bouquet_name(gstMpegtsDescriptor, &outbouquetName) != 0; 187 188 bouquetName = Str.toString(outbouquetName); 189 190 return __p; 191 } 192 193 /** 194 * Extracts ca id's from @descriptor. 195 * 196 * Params: 197 * list = a list of ca identifier. 198 * Edge entry identifies the CA system. Allocations of the value of this field 199 * are found in http://www.dvbservices.com 200 * 201 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 202 */ 203 public bool parseDvbCaIdentifier(out ArrayG list) 204 { 205 GArray* outlist = null; 206 207 auto __p = gst_mpegts_descriptor_parse_dvb_ca_identifier(gstMpegtsDescriptor, &outlist) != 0; 208 209 list = new ArrayG(outlist); 210 211 return __p; 212 } 213 214 /** 215 * Extracts the DVB component information from @descriptor. 216 * 217 * Params: 218 * res = the #GstMpegtsComponentDescriptor to fill 219 * 220 * Returns: %TRUE if parsing succeeded, else %FALSE. 221 */ 222 public bool parseDvbComponent(out ComponentDescriptor res) 223 { 224 GstMpegtsComponentDescriptor* outres = null; 225 226 auto __p = gst_mpegts_descriptor_parse_dvb_component(gstMpegtsDescriptor, &outres) != 0; 227 228 res = ObjectG.getDObject!(ComponentDescriptor)(outres); 229 230 return __p; 231 } 232 233 /** 234 * Extracts the DVB content information from @descriptor. 235 * 236 * Params: 237 * content = #GstMpegtsContent 238 * 239 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 240 */ 241 public bool parseDvbContent(out PtrArray content) 242 { 243 GPtrArray* outcontent = null; 244 245 auto __p = gst_mpegts_descriptor_parse_dvb_content(gstMpegtsDescriptor, &outcontent) != 0; 246 247 content = new PtrArray(outcontent); 248 249 return __p; 250 } 251 252 /** 253 * Parses out the data broadcast from the @descriptor. 254 * 255 * Params: 256 * res = #GstMpegtsDataBroadcastDescriptor 257 * 258 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 259 */ 260 public bool parseDvbDataBroadcast(out DataBroadcastDescriptor res) 261 { 262 GstMpegtsDataBroadcastDescriptor* outres = null; 263 264 auto __p = gst_mpegts_descriptor_parse_dvb_data_broadcast(gstMpegtsDescriptor, &outres) != 0; 265 266 res = ObjectG.getDObject!(DataBroadcastDescriptor)(outres); 267 268 return __p; 269 } 270 271 /** 272 * Parses out the data broadcast id from the @descriptor. 273 * 274 * Params: 275 * dataBroadcastId = the data broadcast id 276 * idSelectorBytes = the selector bytes, if present 277 * 278 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 279 */ 280 public bool parseDvbDataBroadcastId(out ushort dataBroadcastId, out ubyte[] idSelectorBytes) 281 { 282 ubyte* outidSelectorBytes; 283 ubyte len; 284 285 auto __p = gst_mpegts_descriptor_parse_dvb_data_broadcast_id(gstMpegtsDescriptor, &dataBroadcastId, &outidSelectorBytes, &len) != 0; 286 287 idSelectorBytes = outidSelectorBytes[0 .. len]; 288 289 return __p; 290 } 291 292 /** 293 * Extracts the DVB extended event information from @descriptor. 294 * 295 * Params: 296 * res = the #GstMpegtsExtendedEventDescriptor to fill 297 * 298 * Returns: %TRUE if parsing succeeded, else %FALSE. 299 */ 300 public bool parseDvbExtendedEvent(out ExtendedEventDescriptor res) 301 { 302 GstMpegtsExtendedEventDescriptor* outres = null; 303 304 auto __p = gst_mpegts_descriptor_parse_dvb_extended_event(gstMpegtsDescriptor, &outres) != 0; 305 306 res = ObjectG.getDObject!(ExtendedEventDescriptor)(outres); 307 308 return __p; 309 } 310 311 /** 312 * Parses out a list of frequencies from the @descriptor. 313 * 314 * Params: 315 * offset = %FALSE in Hz, %TRUE in kHz 316 * list = a list of all frequencies in Hz/kHz 317 * depending on @offset 318 * 319 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 320 */ 321 public bool parseDvbFrequencyList(out bool offset, out ArrayG list) 322 { 323 int outoffset; 324 GArray* outlist = null; 325 326 auto __p = gst_mpegts_descriptor_parse_dvb_frequency_list(gstMpegtsDescriptor, &outoffset, &outlist) != 0; 327 328 offset = (outoffset == 1); 329 list = new ArrayG(outlist); 330 331 return __p; 332 } 333 334 /** 335 * Extracts the DVB linkage information from @descriptor. 336 * 337 * Params: 338 * res = the #GstMpegtsDVBLinkageDescriptor to fill 339 * 340 * Returns: %TRUE if parsing succeeded, else %FALSE. 341 */ 342 public bool parseDvbLinkage(out DVBLinkageDescriptor res) 343 { 344 GstMpegtsDVBLinkageDescriptor* outres = null; 345 346 auto __p = gst_mpegts_descriptor_parse_dvb_linkage(gstMpegtsDescriptor, &outres) != 0; 347 348 res = ObjectG.getDObject!(DVBLinkageDescriptor)(outres); 349 350 return __p; 351 } 352 353 /** 354 * Parses out the multilingual bouquet name from the @descriptor. 355 * 356 * Params: 357 * bouquetNameItems = a #GstMpegtsDvbMultilingualBouquetNameItem 358 * 359 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 360 */ 361 public bool parseDvbMultilingualBouquetName(out PtrArray bouquetNameItems) 362 { 363 GPtrArray* outbouquetNameItems = null; 364 365 auto __p = gst_mpegts_descriptor_parse_dvb_multilingual_bouquet_name(gstMpegtsDescriptor, &outbouquetNameItems) != 0; 366 367 bouquetNameItems = new PtrArray(outbouquetNameItems); 368 369 return __p; 370 } 371 372 /** 373 * Parses out the multilingual component from the @descriptor. 374 * 375 * Params: 376 * componentTag = the component tag 377 * componentDescriptionItems = a #GstMpegtsDvbMultilingualComponentItem 378 * 379 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 380 */ 381 public bool parseDvbMultilingualComponent(out ubyte componentTag, out PtrArray componentDescriptionItems) 382 { 383 GPtrArray* outcomponentDescriptionItems = null; 384 385 auto __p = gst_mpegts_descriptor_parse_dvb_multilingual_component(gstMpegtsDescriptor, &componentTag, &outcomponentDescriptionItems) != 0; 386 387 componentDescriptionItems = new PtrArray(outcomponentDescriptionItems); 388 389 return __p; 390 } 391 392 /** 393 * Parses out the multilingual network name from the @descriptor. 394 * 395 * Params: 396 * networkNameItems = a #GstMpegtsDvbMultilingualNetworkNameItem 397 * 398 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 399 */ 400 public bool parseDvbMultilingualNetworkName(out PtrArray networkNameItems) 401 { 402 GPtrArray* outnetworkNameItems = null; 403 404 auto __p = gst_mpegts_descriptor_parse_dvb_multilingual_network_name(gstMpegtsDescriptor, &outnetworkNameItems) != 0; 405 406 networkNameItems = new PtrArray(outnetworkNameItems); 407 408 return __p; 409 } 410 411 /** 412 * Parses out the multilingual service name from the @descriptor. 413 * 414 * Params: 415 * serviceNameItems = a #GstMpegtsDvbMultilingualServiceNameItem 416 * 417 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 418 */ 419 public bool parseDvbMultilingualServiceName(out PtrArray serviceNameItems) 420 { 421 GPtrArray* outserviceNameItems = null; 422 423 auto __p = gst_mpegts_descriptor_parse_dvb_multilingual_service_name(gstMpegtsDescriptor, &outserviceNameItems) != 0; 424 425 serviceNameItems = new PtrArray(outserviceNameItems); 426 427 return __p; 428 } 429 430 /** 431 * Parses out the dvb network name from the @descriptor: 432 * 433 * Params: 434 * name = the extracted name 435 * 436 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 437 */ 438 public bool parseDvbNetworkName(out string name) 439 { 440 char* outname = null; 441 442 auto __p = gst_mpegts_descriptor_parse_dvb_network_name(gstMpegtsDescriptor, &outname) != 0; 443 444 name = Str.toString(outname); 445 446 return __p; 447 } 448 449 /** 450 * Extracts the DVB parental rating information from @descriptor. 451 * 452 * Params: 453 * rating = #GstMpegtsDVBParentalRatingItem 454 * 455 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 456 */ 457 public bool parseDvbParentalRating(out PtrArray rating) 458 { 459 GPtrArray* outrating = null; 460 461 auto __p = gst_mpegts_descriptor_parse_dvb_parental_rating(gstMpegtsDescriptor, &outrating) != 0; 462 463 rating = new PtrArray(outrating); 464 465 return __p; 466 } 467 468 /** 469 * Parses out the private data specifier from the @descriptor. 470 * 471 * Params: 472 * privateDataSpecifier = the private data specifier id 473 * registered by http://www.dvbservices.com/ 474 * privateData = additional data or NULL 475 * 476 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 477 */ 478 public bool parseDvbPrivateDataSpecifier(out uint privateDataSpecifier, out ubyte[] privateData) 479 { 480 ubyte* outprivateData; 481 ubyte length; 482 483 auto __p = gst_mpegts_descriptor_parse_dvb_private_data_specifier(gstMpegtsDescriptor, &privateDataSpecifier, &outprivateData, &length) != 0; 484 485 privateData = outprivateData[0 .. length]; 486 487 return __p; 488 } 489 490 /** 491 * Parses out the scrambling mode from the @descriptor. 492 * 493 * Params: 494 * scramblingMode = This 8-bit field identifies the selected 495 * mode of the scrambling algorithm (#GstMpegtsDVBScramblingModeType). 496 * The technical details of the scrambling algorithm are available only 497 * to bona-fide users upon signature of a Non Disclosure Agreement (NDA) 498 * administered by the DVB Common Scrambling Algorithm Custodian. 499 * 500 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 501 */ 502 public bool parseDvbScrambling(out GstMpegtsDVBScramblingModeType scramblingMode) 503 { 504 return gst_mpegts_descriptor_parse_dvb_scrambling(gstMpegtsDescriptor, &scramblingMode) != 0; 505 } 506 507 /** 508 * Extracts the dvb service information from @descriptor. 509 * 510 * Params: 511 * serviceType = the service type 512 * serviceName = the service name 513 * providerName = the provider name 514 * 515 * Returns: %TRUE if parsing succeeded, else %FALSE. 516 */ 517 public bool parseDvbService(out GstMpegtsDVBServiceType serviceType, out string serviceName, out string providerName) 518 { 519 char* outserviceName = null; 520 char* outproviderName = null; 521 522 auto __p = gst_mpegts_descriptor_parse_dvb_service(gstMpegtsDescriptor, &serviceType, &outserviceName, &outproviderName) != 0; 523 524 serviceName = Str.toString(outserviceName); 525 providerName = Str.toString(outproviderName); 526 527 return __p; 528 } 529 530 /** 531 * Parses out a list of services from the @descriptor: 532 * 533 * Params: 534 * list = the list of services 535 * 536 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 537 */ 538 public bool parseDvbServiceList(out PtrArray list) 539 { 540 GPtrArray* outlist = null; 541 542 auto __p = gst_mpegts_descriptor_parse_dvb_service_list(gstMpegtsDescriptor, &outlist) != 0; 543 544 list = new PtrArray(outlist); 545 546 return __p; 547 } 548 549 /** 550 * Extracts the DVB short event information from @descriptor. 551 * 552 * Params: 553 * languageCode = the language code 554 * eventName = the event name 555 * text = the event text 556 * 557 * Returns: %TRUE if parsing succeeded, else %FALSE. 558 */ 559 public bool parseDvbShortEvent(out string languageCode, out string eventName, out string text) 560 { 561 char* outlanguageCode = null; 562 char* outeventName = null; 563 char* outtext = null; 564 565 auto __p = gst_mpegts_descriptor_parse_dvb_short_event(gstMpegtsDescriptor, &outlanguageCode, &outeventName, &outtext) != 0; 566 567 languageCode = Str.toString(outlanguageCode); 568 eventName = Str.toString(outeventName); 569 text = Str.toString(outtext); 570 571 return __p; 572 } 573 574 /** 575 * Extracts the component tag from @descriptor. 576 * 577 * Params: 578 * componentTag = the component tag 579 * 580 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 581 */ 582 public bool parseDvbStreamIdentifier(out ubyte componentTag) 583 { 584 return gst_mpegts_descriptor_parse_dvb_stream_identifier(gstMpegtsDescriptor, &componentTag) != 0; 585 } 586 587 /** 588 * Extracts the DVB subtitling informatio from specific table id in @descriptor. 589 * 590 * Note: Use #gst_tag_get_language_code if you want to get the the 591 * ISO 639-1 language code from the returned ISO 639-2 one. 592 * 593 * Params: 594 * idx = Table id of the entry to parse 595 * lang = the language code 596 * type = the type of subtitling 597 * compositionPageId = the composition page id 598 * ancillaryPageId = the ancillary page id 599 * 600 * Returns: %TRUE if parsing succeeded, else %FALSE. 601 */ 602 public bool parseDvbSubtitlingIdx(uint idx, out string lang, out ubyte type, out ushort compositionPageId, out ushort ancillaryPageId) 603 { 604 char* outlang = null; 605 606 auto __p = gst_mpegts_descriptor_parse_dvb_subtitling_idx(gstMpegtsDescriptor, idx, &outlang, &type, &compositionPageId, &ancillaryPageId) != 0; 607 608 lang = Str.toString(outlang); 609 610 return __p; 611 } 612 613 /** 614 * Returns: The number of entries in @descriptor 615 */ 616 public uint parseDvbSubtitlingNb() 617 { 618 return gst_mpegts_descriptor_parse_dvb_subtitling_nb(gstMpegtsDescriptor); 619 } 620 621 /** 622 * Parses out the DVB-T2 delivery system from the @descriptor. 623 * 624 * Params: 625 * res = #GstMpegtsT2DeliverySystemDescriptor 626 * 627 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 628 */ 629 public bool parseDvbT2DeliverySystem(out T2DeliverySystemDescriptor res) 630 { 631 GstMpegtsT2DeliverySystemDescriptor* outres = null; 632 633 auto __p = gst_mpegts_descriptor_parse_dvb_t2_delivery_system(gstMpegtsDescriptor, &outres) != 0; 634 635 res = ObjectG.getDObject!(T2DeliverySystemDescriptor)(outres); 636 637 return __p; 638 } 639 640 /** 641 * Parses teletext number @idx in the @descriptor. The language is in ISO639 format. 642 * 643 * Params: 644 * idx = The id of the teletext to get 645 * languageCode = a null-terminated string 646 * teletextType = #GstMpegtsDVBTeletextType 647 * 648 * Returns: FALSE on out-of-bounds and errors 649 */ 650 public bool parseDvbTeletextIdx(uint idx, out string languageCode, out GstMpegtsDVBTeletextType teletextType, out ubyte magazineNumber, out ubyte pageNumber) 651 { 652 char* outlanguageCode = null; 653 654 auto __p = gst_mpegts_descriptor_parse_dvb_teletext_idx(gstMpegtsDescriptor, idx, &outlanguageCode, &teletextType, &magazineNumber, &pageNumber) != 0; 655 656 languageCode = Str.toString(outlanguageCode); 657 658 return __p; 659 } 660 661 /** 662 * Find the number of teletext entries in @descriptor 663 * 664 * Returns: Number of teletext entries 665 */ 666 public uint parseDvbTeletextNb() 667 { 668 return gst_mpegts_descriptor_parse_dvb_teletext_nb(gstMpegtsDescriptor); 669 } 670 671 /** 672 * Extracts the iso 639-2 language information from @descriptor. 673 * 674 * Note: Use #gst_tag_get_language_code if you want to get the the 675 * ISO 639-1 language code from the returned ISO 639-2 one. 676 * 677 * Params: 678 * res = the #GstMpegtsISO639LanguageDescriptor to fill 679 * 680 * Returns: %TRUE if parsing succeeded, else %FALSE. 681 */ 682 public bool parseIso639Language(out ISO639LanguageDescriptor res) 683 { 684 GstMpegtsISO639LanguageDescriptor* outres = null; 685 686 auto __p = gst_mpegts_descriptor_parse_iso_639_language(gstMpegtsDescriptor, &outres) != 0; 687 688 res = ObjectG.getDObject!(ISO639LanguageDescriptor)(outres); 689 690 return __p; 691 } 692 693 /** 694 * Extracts the iso 639-2 language information from specific table id in @descriptor. 695 * 696 * Note: Use #gst_tag_get_language_code if you want to get the the 697 * ISO 639-1 language code from the returned ISO 639-2 one. 698 * 699 * Params: 700 * idx = Table id of the language to parse 701 * lang = 4-byte gchar array to hold the language code 702 * audioType = the #GstMpegtsIso639AudioType to set 703 * 704 * Returns: %TRUE if parsing succeeded, else %FALSE. 705 */ 706 public bool parseIso639LanguageIdx(uint idx, out string lang, out GstMpegtsIso639AudioType audioType) 707 { 708 char* outlang = null; 709 710 auto __p = gst_mpegts_descriptor_parse_iso_639_language_idx(gstMpegtsDescriptor, idx, &outlang, &audioType) != 0; 711 712 lang = Str.toString(outlang); 713 714 return __p; 715 } 716 717 /** 718 * Returns: The number of languages in @descriptor 719 */ 720 public uint parseIso639LanguageNb() 721 { 722 return gst_mpegts_descriptor_parse_iso_639_language_nb(gstMpegtsDescriptor); 723 } 724 725 /** 726 * Extracts the logical channels from @descriptor. 727 * 728 * Params: 729 * res = the #GstMpegtsLogicalChannelDescriptor to fill 730 * 731 * Returns: %TRUE if parsing succeeded, else %FALSE. 732 */ 733 public bool parseLogicalChannel(out LogicalChannelDescriptor res) 734 { 735 GstMpegtsLogicalChannelDescriptor* outres = sliceNew!GstMpegtsLogicalChannelDescriptor(); 736 737 auto __p = gst_mpegts_descriptor_parse_logical_channel(gstMpegtsDescriptor, outres) != 0; 738 739 res = ObjectG.getDObject!(LogicalChannelDescriptor)(outres, true); 740 741 return __p; 742 } 743 744 /** 745 * Extracts the satellite delivery system information from @descriptor. 746 * 747 * Params: 748 * res = the #GstMpegtsSatelliteDeliverySystemDescriptor to fill 749 * 750 * Returns: %TRUE if parsing succeeded, else %FALSE. 751 */ 752 public bool parseSatelliteDeliverySystem(out SatelliteDeliverySystemDescriptor res) 753 { 754 GstMpegtsSatelliteDeliverySystemDescriptor* outres = sliceNew!GstMpegtsSatelliteDeliverySystemDescriptor(); 755 756 auto __p = gst_mpegts_descriptor_parse_satellite_delivery_system(gstMpegtsDescriptor, outres) != 0; 757 758 res = ObjectG.getDObject!(SatelliteDeliverySystemDescriptor)(outres, true); 759 760 return __p; 761 } 762 763 /** 764 * Parses out the terrestrial delivery system from the @descriptor. 765 * 766 * Params: 767 * res = #GstMpegtsTerrestrialDeliverySystemDescriptor 768 * 769 * Returns: %TRUE if the parsing happened correctly, else %FALSE. 770 */ 771 public bool parseTerrestrialDeliverySystem(out TerrestrialDeliverySystemDescriptor res) 772 { 773 GstMpegtsTerrestrialDeliverySystemDescriptor* outres = sliceNew!GstMpegtsTerrestrialDeliverySystemDescriptor(); 774 775 auto __p = gst_mpegts_descriptor_parse_terrestrial_delivery_system(gstMpegtsDescriptor, outres) != 0; 776 777 res = ObjectG.getDObject!(TerrestrialDeliverySystemDescriptor)(outres, true); 778 779 return __p; 780 } 781 782 /** 783 * Creates a #GstMpegtsDescriptor with custom @tag and @data 784 * 785 * Params: 786 * tag = descriptor tag 787 * data = descriptor data (after tag and length field) 788 * 789 * Returns: #GstMpegtsDescriptor 790 */ 791 public static Descriptor fromCustom(ubyte tag, ubyte[] data) 792 { 793 auto __p = gst_mpegts_descriptor_from_custom(tag, data.ptr, cast(size_t)data.length); 794 795 if(__p is null) 796 { 797 return null; 798 } 799 800 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 801 } 802 803 /** 804 * Creates a #GstMpegtsDescriptor with custom @tag, @tag_extension and @data 805 * 806 * Params: 807 * tag = descriptor tag 808 * tagExtension = descriptor tag extension 809 * data = descriptor data (after tag and length field) 810 * 811 * Returns: #GstMpegtsDescriptor 812 */ 813 public static Descriptor fromCustomWithExtension(ubyte tag, ubyte tagExtension, ubyte[] data) 814 { 815 auto __p = gst_mpegts_descriptor_from_custom_with_extension(tag, tagExtension, data.ptr, cast(size_t)data.length); 816 817 if(__p is null) 818 { 819 return null; 820 } 821 822 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 823 } 824 825 /** 826 * Creates a #GstMpegtsDescriptor to be a %GST_MTS_DESC_DVB_NETWORK_NAME, 827 * with the network name @name. The data field of the #GstMpegtsDescriptor 828 * will be allocated, and transferred to the caller. 829 * 830 * Params: 831 * name = the network name to set 832 * 833 * Returns: the #GstMpegtsDescriptor or %NULL on fail 834 */ 835 public static Descriptor fromDvbNetworkName(string name) 836 { 837 auto __p = gst_mpegts_descriptor_from_dvb_network_name(Str.toStringz(name)); 838 839 if(__p is null) 840 { 841 return null; 842 } 843 844 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 845 } 846 847 /** 848 * Fills a #GstMpegtsDescriptor to be a %GST_MTS_DESC_DVB_SERVICE. 849 * The data field of the #GstMpegtsDescriptor will be allocated, 850 * and transferred to the caller. 851 * 852 * Params: 853 * serviceType = Service type defined as a #GstMpegtsDVBServiceType 854 * serviceName = Name of the service 855 * serviceProvider = Name of the service provider 856 * 857 * Returns: the #GstMpegtsDescriptor or %NULL on fail 858 */ 859 public static Descriptor fromDvbService(GstMpegtsDVBServiceType serviceType, string serviceName, string serviceProvider) 860 { 861 auto __p = gst_mpegts_descriptor_from_dvb_service(serviceType, Str.toStringz(serviceName), Str.toStringz(serviceProvider)); 862 863 if(__p is null) 864 { 865 return null; 866 } 867 868 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 869 } 870 871 /** */ 872 public static Descriptor fromDvbSubtitling(string lang, ubyte type, ushort composition, ushort ancillary) 873 { 874 auto __p = gst_mpegts_descriptor_from_dvb_subtitling(Str.toStringz(lang), type, composition, ancillary); 875 876 if(__p is null) 877 { 878 return null; 879 } 880 881 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 882 } 883 884 /** 885 * Creates a %GST_MTS_DESC_ISO_639_LANGUAGE #GstMpegtsDescriptor with 886 * a single language 887 * 888 * Params: 889 * language = ISO-639-2 language 3-char code 890 * 891 * Returns: #GstMpegtsDescriptor, %NULL on failure 892 */ 893 public static Descriptor fromIso639Language(string language) 894 { 895 auto __p = gst_mpegts_descriptor_from_iso_639_language(Str.toStringz(language)); 896 897 if(__p is null) 898 { 899 return null; 900 } 901 902 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 903 } 904 905 /** 906 * Creates a %GST_MTS_DESC_REGISTRATION #GstMpegtsDescriptor 907 * 908 * Params: 909 * formatIdentifier = a 4 character format identifier string 910 * additionalInfo = pointer to optional additional info 911 * 912 * Returns: #GstMpegtsDescriptor, %NULL on failure 913 */ 914 public static Descriptor fromRegistration(string formatIdentifier, ubyte[] additionalInfo) 915 { 916 auto __p = gst_mpegts_descriptor_from_registration(Str.toStringz(formatIdentifier), additionalInfo.ptr, cast(size_t)additionalInfo.length); 917 918 if(__p is null) 919 { 920 return null; 921 } 922 923 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p, true); 924 } 925 926 /** 927 * Finds the first descriptor of type @tag in the array. 928 * 929 * Note: To look for descriptors that can be present more than once in an 930 * array of descriptors, iterate the #GArray manually. 931 * 932 * Params: 933 * descriptors = an array 934 * of #GstMpegtsDescriptor 935 * tag = the tag to look for 936 * 937 * Returns: the first descriptor matching @tag, else %NULL. 938 */ 939 public static Descriptor findDescriptor(PtrArray descriptors, ubyte tag) 940 { 941 auto __p = gst_mpegts_find_descriptor((descriptors is null) ? null : descriptors.getPtrArrayStruct(), tag); 942 943 if(__p is null) 944 { 945 return null; 946 } 947 948 return ObjectG.getDObject!(Descriptor)(cast(GstMpegtsDescriptor*) __p); 949 } 950 951 /** 952 * Parses the descriptors present in @buffer and returns them as an 953 * array. 954 * 955 * Note: The data provided in @buffer will not be copied. 956 * 957 * Params: 958 * buffer = descriptors to parse 959 * bufLen = Size of @buffer 960 * 961 * Returns: an 962 * array of the parsed descriptors or %NULL if there was an error. 963 * Release with #g_array_unref when done with it. 964 */ 965 public static PtrArray parseDescriptors(ubyte* buffer, size_t bufLen) 966 { 967 auto __p = gst_mpegts_parse_descriptors(buffer, bufLen); 968 969 if(__p is null) 970 { 971 return null; 972 } 973 974 return new PtrArray(cast(GPtrArray*) __p, true); 975 } 976 }