diff --git a/_codec_m_t_s_8h_source.html b/_codec_m_t_s_8h_source.html
index 67fb1df816..77afad2c13 100644
--- a/_codec_m_t_s_8h_source.html
+++ b/_codec_m_t_s_8h_source.html
@@ -106,909 +106,909 @@
-
-
-
-
-
-
- 53 void begin()
override {
-
-
-
-
-
-
-
-
-
- 63 memset(print_pids, 0,
sizeof(print_pids));
-
-
- 66 if (tsd_context_init(&ctx)!=TSD_OK){
-
-
-
-
-
-
- 73 ctx.malloc = log_malloc;
- 74 ctx.realloc = log_realloc;
- 75 ctx.calloc = log_calloc;
-
-
-
-
- 80 if (stream_types.empty()){
- 81 addStreamType(TSD_PMT_STREAM_TYPE_PES_METADATA);
- 82 addStreamType(TSD_PMT_STREAM_TYPE_AUDIO_AAC);
-
-
-
-
-
-
- 89 if (tsd_set_event_callback(&ctx, event_cb)!=TSD_OK){
-
-
-
-
-
-
-
-
-
-
-
-
- 102 tsd_context_destroy(&ctx);
-
-
-
-
- 107 virtual operator bool()
override {
return is_active; }
-
- 109 const char *mime() {
return "video/MP2T"; }
-
- 111 size_t write(
const void *in_ptr,
size_t in_size)
override {
- 112 if (!is_active)
return 0;
- 113 LOGD(
"MTSDecoder::write: %d", (
int)in_size);
- 114 size_t result = buffer.
writeArray((uint8_t*)in_ptr, in_size);
-
- 116 demux(underflowLimit);
-
-
-
-
-
-
-
- 124 void clearStreamTypes(){
-
- 126 stream_types.clear();
-
-
- 129 void addStreamType(TSDPMTStreamType type){
-
- 131 stream_types.push_back(type);
-
-
- 134 bool isStreamTypeActive(TSDPMTStreamType type){
- 135 for (
int j=0;j<stream_types.size();j++){
- 136 if (stream_types[j]==type)
return true;
-
-
-
-
-
-
-
-
-
- 148 is_alloc_active = flag;
-
-
-
-
- 153 int underflowLimit = MTS_UNDERFLOW_LIMIT;
- 154 bool is_active =
false;
- 155 bool is_write_active =
false;
- 156 bool is_alloc_active =
false;
-
- 158 uint16_t print_pids[MTS_PRINT_PIDS_LEN] = {0};
- 159 SingleBuffer<uint8_t> buffer{MTS_WRITE_BUFFER_SIZE};
- 160 Vector<TSDPMTStreamType> stream_types;
- 161 Vector<AllocSize> alloc_vector;
-
- 163 void set_write_active(
bool flag){
-
- 165 is_write_active = flag;
-
-
- 168 void demux(
int limit){
-
- 170 TSDCode res = TSD_OK;
-
- 172 while (res == TSD_OK && buffer.
available() > limit) {
- 173 size_t len = tsd_demux(&ctx, (
void *)buffer.
data(), buffer.
available(), &res);
-
-
-
-
- 178 if (res != TSD_OK) logResult(res);
-
- 180 LOGD(
"Number of demux calls: %d", count);
-
-
- 183 void logResult(TSDCode code) {
-
-
-
-
- 188 case TSD_INVALID_SYNC_BYTE:
- 189 LOGW(
"TSD_INVALID_SYNC_BYTE");
-
- 191 case TSD_INVALID_CONTEXT:
- 192 LOGW(
"TSD_INVALID_CONTEXT");
-
- 194 case TSD_INVALID_DATA:
- 195 LOGW(
"TSD_INVALID_DATA");
-
- 197 case TSD_INVALID_DATA_SIZE:
- 198 LOGW(
"TSD_INVALID_DATA_SIZE");
-
- 200 case TSD_INVALID_ARGUMENT:
- 201 LOGW(
"TSD_INVALID_ARGUMENT");
-
- 203 case TSD_INVALID_START_CODE_PREFIX:
- 204 LOGW(
"TSD_INVALID_START_CODE_PREFIX");
-
- 206 case TSD_OUT_OF_MEMORY:
- 207 LOGW(
"TSD_OUT_OF_MEMORY");
-
- 209 case TSD_INCOMPLETE_TABLE:
- 210 LOGW(
"TSD_INCOMPLETE_TABLE");
-
- 212 case TSD_NOT_A_TABLE_PACKET:
- 213 LOGW(
"TSD_NOT_A_TABLE_PACKET");
-
- 215 case TSD_PARSE_ERROR:
- 216 LOGW(
"TSD_PARSE_ERROR");
-
- 218 case TSD_PID_ALREADY_REGISTERED:
- 219 LOGW(
"TSD_PID_ALREADY_REGISTERED");
-
- 221 case TSD_TSD_MAX_PID_REGS_REACHED:
- 222 LOGW(
"TSD_TSD_MAX_PID_REGS_REACHED");
-
- 224 case TSD_PID_NOT_FOUND:
- 225 LOGW(
"TSD_PID_NOT_FOUND");
-
- 227 case TSD_INVALID_POINTER_FIELD:
- 228 LOGW(
"TSD_INVALID_POINTER_FIELD");
-
-
-
-
-
- 234 static void event_cb(TSDemuxContext *ctx, uint16_t pid, TSDEventId event_id,
-
-
- 237 if (MTSDecoder::self !=
nullptr) {
- 238 MTSDecoder::self->event_cb_local(ctx, pid, event_id, data);
-
-
-
- 242 void event_cb_local(TSDemuxContext *ctx, uint16_t pid, TSDEventId event_id,
-
- 244 if (event_id == TSD_EVENT_PAT) {
- 245 set_write_active(
false);
- 246 print_pat(ctx, data);
- 247 }
else if (event_id == TSD_EVENT_PMT) {
- 248 set_write_active(
false);
- 249 print_pmt(ctx, data);
- 250 }
else if (event_id == TSD_EVENT_PES) {
- 251 TSDPESPacket *pes = (TSDPESPacket *)data;
-
- 253 LOGD(
"====================");
- 254 LOGD(
"PID %d PES Packet, Size: %ld, stream_id=%u, pts=%lu, dts=%lu", pid,
- 255 pes->data_bytes_length, pes->stream_id, pes->pts, pes->dts);
-
-
- 258 AudioLogger logger = AudioLogger::instance();
- 259 for (i = 0; i < MTS_PRINT_PIDS_LEN; ++i) {
- 260 if (print_pids[i] == pid) {
-
- 262 if (logger.isLogging(AudioLogger::Debug)) {
- 263 logger.print(
" PES data ");
- 264 logger.print(is_write_active?
"active:":
"inactive:");
-
- 266 while (j < pes->data_bytes_length) {
- 267 char n = pes->data_bytes[j];
- 268 logger.printCharHex(n);
-
-
- 271 logger.printChar(
'\n');
-
-
- 274 if (p_print !=
nullptr) {
-
- 276 size_t eff = writeSamples<uint8_t>(p_print,(uint8_t*) pes->data_bytes, pes->data_bytes_length);
- 277 if(eff!=pes->data_bytes_length){
-
-
-
-
-
-
-
- 285 }
else if (event_id == TSD_EVENT_ADAP_FIELD_PRV_DATA) {
- 286 set_write_active(
false);
-
-
- 289 TSDAdaptationField *adap_field = (TSDAdaptationField *)data;
- 290 TSDDescriptor *descriptors = NULL;
- 291 size_t descriptors_length = 0;
- 292 tsd_descriptor_extract(ctx, adap_field->private_data_bytes,
- 293 adap_field->transport_private_data_length,
- 294 &descriptors, &descriptors_length);
-
- 296 LOGD(
"====================");
- 297 LOGD(
"Descriptors - Adaptation Fields");
-
- 299 for (; i < descriptors_length; ++i) {
- 300 TSDDescriptor *des = &descriptors[i];
- 301 LOGD(
" %d) tag: (0x%04X) %s", i, des->tag,
- 302 descriptor_tag_to_str(des->tag));
- 303 LOGD(
" length: %d", des->length);
- 304 print_descriptor_info(des);
-
-
-
-
- 309 void print_pat(TSDemuxContext *ctx,
void *data) {
- 310 LOGD(
"====================");
- 311 TSDPATData *pat = (TSDPATData *)data;
- 312 size_t len = pat->length;
-
- 314 LOGD(
"PAT, Length %d", (
int)pat->length);
-
-
- 317 LOGD(
"number of progs: %d", (
int)len);
-
- 319 for (i = 0; i < len; ++i) {
- 320 LOGD(
" %d) prog num: 0x%X, pid: 0x%X", (
int)i, pat->program_number[i],
-
-
-
-
- 325 void print_pmt(TSDemuxContext *ctx,
void *data) {
- 326 LOGD(
"====================");
-
- 328 TSDPMTData *pmt = (TSDPMTData *)data;
- 329 LOGD(
"PCR PID: 0x%04X", pmt->pcr_pid);
- 330 LOGD(
"program info length: %d", (
int)pmt->program_info_length);
- 331 LOGD(
"descriptors length: %d", (
int)pmt->descriptors_length);
-
-
- 334 for (i = 0; i < pmt->descriptors_length; ++i) {
- 335 TSDDescriptor *des = &pmt->descriptors[i];
- 336 LOGD(
" %d) tag: (0x%04X) %s", (
int)i, des->tag,
- 337 descriptor_tag_to_str(des->tag));
- 338 LOGD(
" length: %d", des->length);
- 339 print_descriptor_info(des);
-
-
- 342 LOGD(
"program elements length: %d", (
int)pmt->program_elements_length);
- 343 for (i = 0; i < pmt->program_elements_length; ++i) {
- 344 TSDProgramElement *prog = &pmt->program_elements[i];
- 345 LOGD(
" -----Program #%d", (
int)i);
- 346 LOGD(
" stream type: (0x%04X) %s", prog->stream_type,
- 347 stream_type_to_str((TSDPESStreamId)(prog->stream_type)));
- 348 LOGD(
" elementary pid: 0x%04X", prog->elementary_pid);
- 349 LOGD(
" es info length: %d", prog->es_info_length);
- 350 LOGD(
" descriptors length: %d", (
int)prog->descriptors_length);
-
- 352 if (isStreamTypeActive((TSDPMTStreamType)prog->stream_type)){
- 353 set_write_active(
true);
-
-
-
- 357 for(
int j=0;j<stream_types.size();j++){
- 358 add_print_pid(prog, stream_types[j]);
-
-
-
- 362 int reg_types = TSD_REG_PES;
-
-
- 365 for (j = 0; j < prog->descriptors_length; ++j) {
- 366 TSDDescriptor *des = &prog->descriptors[j];
- 367 LOGD(
" %d) tag: (0x%04X) %s", (
int)j, des->tag,
- 368 descriptor_tag_to_str(des->tag));
- 369 LOGD(
" length: %d", des->length);
- 370 print_descriptor_info(des);
-
-
-
- 374 if (des->tag == 0x97) {
- 375 reg_types |= TSD_REG_ADAPTATION_FIELD;
-
-
-
-
- 380 tsd_register_pid(ctx, prog->elementary_pid, reg_types);
-
-
-
- 384 void add_print_pid(TSDProgramElement *prog, TSDPMTStreamType type) {
- 385 if (prog->stream_type == type) {
-
- 387 for (k = 0; k < MTS_PRINT_PIDS_LEN; ++k) {
-
- 389 if (print_pids[k] == 0) {
- 390 print_pids[k] = prog->elementary_pid;
-
-
-
-
-
-
- 397 const char *stream_type_to_str(TSDPESStreamId stream_id) {
- 398 if (stream_id >= 0x1C && stream_id <= 0x7F && stream_id != 0x24 &&
-
- 400 stream_id = (TSDPESStreamId)0x1C;
- 401 }
else if (stream_id >= 0x8A && stream_id <= 0x8F) {
- 402 stream_id = (TSDPESStreamId)0x8A;
- 403 }
else if (stream_id >= 0x93 && stream_id <= 0x94) {
- 404 stream_id = (TSDPESStreamId)0x93;
- 405 }
else if (stream_id >= 0x96 && stream_id <= 0x9F) {
- 406 stream_id = (TSDPESStreamId)0x96;
- 407 }
else if (stream_id >= 0xA1 && stream_id <= 0xBF) {
- 408 stream_id = (TSDPESStreamId)0xA1;
- 409 }
else if (stream_id >= 0xC4 && stream_id <= 0xE9) {
- 410 stream_id = (TSDPESStreamId)0xC4;
- 411 }
else if (stream_id >= 0xEB && stream_id <= 0xFF) {
- 412 stream_id = (TSDPESStreamId)0xEB;
-
-
-
-
- 417 return "ITU-T | ISO/IEC Reserved";
-
- 419 return "ISO/IEC 11172 Video";
-
- 421 return "ITU-T Rec. H.262 | ISO/IEC 13818-2 Video";
-
- 423 return "ISO/IEC 11172 Audio";
-
- 425 return "ISO/IEC 13818-3 Audio";
-
- 427 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 private sections";
-
- 429 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing "
-
-
- 432 return "ISO/IEC 13522 MHEG";
-
- 434 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 DSM-CC";
-
- 436 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1/11172-1 auxiliary";
-
- 438 return "ISO/IEC 13818-6 Multi-protocol Encapsulation";
-
- 440 return "ISO/IEC 13818-6 DSM-CC U-N Messages";
-
- 442 return "ISO/IEC 13818-6 Stream Descriptors";
-
- 444 return "ISO/IEC 13818-6 Sections (any type, including private data)";
-
- 446 return "ISO/IEC 13818-1 auxiliary";
-
- 448 return "ISO/IEC 13818-7 Audio (AAC) with ADTS transport";
-
- 450 return "ISO/IEC 14496-2 Visual";
-
- 452 return "ISO/IEC 14496-3 Audio with the LATM transport syntax as "
- 453 "defined in ISO/IEC 14496-3";
-
- 455 return "ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried "
-
-
- 458 return "ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried "
- 459 "in ISO/IEC 14496_sections";
-
- 461 return "ISO/IEC 13818-6 DSM-CC Synchronized Download Protocol";
-
- 463 return "Metadata carried in PES packets";
-
- 465 return "Metadata carried in metadata_sections";
-
- 467 return "Metadata carried in ISO/IEC 13818-6 Data Carousel";
-
- 469 return "Metadata carried in ISO/IEC 13818-6 Object Carousel";
-
- 471 return "Metadata carried in ISO/IEC 13818-6 Synchronized Download "
-
-
- 474 return "IPMP stream (defined in ISO/IEC 13818-11, MPEG-2 IPMP)";
-
- 476 return "AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC "
-
-
- 479 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved";
-
- 481 return "ITU-T Rec. H.265 and ISO/IEC 23008-2 (Ultra HD video) in a "
-
-
- 484 return "Chinese Video Standard in a packetized stream";
-
- 486 return "DigiCipher® II video | Identical to ITU-T Rec. H.262 | ISO/IEC "
-
-
- 489 return "ATSC A/53 audio [2] | AC-3 audio";
-
- 491 return "SCTE Standard Subtitle";
-
- 493 return "SCTE Isochronous Data | Reserved";
-
- 495 return "ATSC/SCTE reserved";
-
- 497 return "ATSC Program Identifier , SCTE Reserved";
-
- 499 return "SCTE 35 splice_information_table | [Cueing]";
-
-
-
- 503 return "DTS HD Audio";
-
- 505 return "ATSC Reserved";
-
- 507 return "ATSC Reserved";
-
- 509 return "DVB stream_type value for Time Slicing / MPE-FEC";
-
- 511 return "IETF Unidirectional Link Encapsulation (ULE)";
-
- 513 return "VEI stream_type";
-
- 515 return "ATSC Reserved";
-
- 517 return "ATSC Data Service Table, Network Resources Table";
-
- 519 return "ATSC Reserved";
-
- 521 return "SCTE [IP Data] | ATSC Reserved";
-
- 523 return "ATSC Reserved";
-
- 525 return "DCII (DigiCipher®) Text";
-
- 527 return "ATSC Reserved";
-
- 529 return "ATSC synchronous data stream | [Isochronous Data]";
-
- 531 return "SCTE Asynchronous Data";
-
- 533 return "ATSC User Private Program Elements";
-
- 535 return "VC-1 Elementary Stream per RP227";
-
- 537 return "ATSC User Private Program Elements";
-
-
-
-
- 542 const char *descriptor_tag_to_str(uint8_t tag) {
- 543 if (tag >= 0x24 && tag <= 0x27) {
-
- 545 }
else if (tag >= 0x29 && tag <= 0x35) {
-
- 547 }
else if (tag >= 0x3A && tag <= 0x3F) {
-
- 549 }
else if (tag >= 0x40 && tag <= 0x51) {
-
- 551 }
else if (tag >= 0x98 && tag <= 0x9F) {
-
-
-
-
-
-
- 558 return "ISO/IEC 13818 Reserved";
-
- 560 return "video_stream_descriptor";
-
- 562 return "audio_stream_descriptor";
-
- 564 return "hierarchy_descriptor";
-
- 566 return "registration_descriptor";
-
- 568 return "data_stream_alignment_descriptor";
-
- 570 return "target_background_grid_descriptor";
-
- 572 return "video_window_descriptor";
-
- 574 return "CA_descriptor";
-
- 576 return "ISO_639_language_descriptor";
-
- 578 return "system_clock_descriptor";
-
- 580 return "multiplex_buffer_utilization_descriptor";
-
- 582 return "copyright_descriptor";
-
- 584 return "Maximum_bitrate_descriptor";
-
- 586 return "Private_data_indicator_descriptor";
-
- 588 return "smoothing_buffer_descriptor";
-
- 590 return "STD_descriptor";
-
- 592 return "IBP descriptor";
-
- 594 return "DSM-CC carousel_identifier_descriptor";
-
- 596 return "DSM-CC association_tag_descriptor";
-
- 598 return "DSM-CC deferred_association_tags_descriptor";
-
- 600 return "ISO/IEC 13818-6 reserved";
-
- 602 return "NPT Reference descriptor";
-
- 604 return "NPT Endpoint descriptor";
-
- 606 return "Stream Mode descriptor";
-
- 608 return "Stream Event descriptor";
-
- 610 return "MPEG-4_video_descriptor";
-
- 612 return "MPEG-4_audio_descriptor";
-
- 614 return "IOD_descriptor";
-
- 616 return "SL_descriptor";
-
- 618 return "FMC_descriptor";
-
- 620 return "External_ES_ID_descriptor";
-
- 622 return "MuxCode_descriptor";
-
- 624 return "FmxBufferSize_descriptor";
-
- 626 return "MultiplexBuffer_descriptor";
-
- 628 return "Reserved for ISO/IEC 13818-1 use";
-
- 630 return "AVC_video_descriptor()";
-
- 632 return "Reserved for ISO/IEC 13818-1 use";
-
- 634 return "content_labeling_descriptor";
-
- 636 return "Metadata_location_descriptor";
-
- 638 return "ISO/IEC 13818 Reserved";
-
- 640 return "User Private";
-
- 642 return "SCTE 35 Stream Identifier Descriptor";
-
- 644 return "ACAP-X Application Descriptor";
-
- 646 return "ACAP-X Application Location Descriptor";
-
- 648 return "ACAP-X Application Boundary Descriptor";
-
- 650 return "Stuffing_descriptor";
-
- 652 return "AC3_audio_descriptor";
-
- 654 return "SCTE Frame_rate_descriptor";
-
- 656 return "SCTE Extended_video_descriptor";
-
- 658 return "SCTE Component_name_descriptor";
-
- 660 return "ATSC program_identifier";
-
- 662 return "Caption_service_descriptor";
-
- 664 return "Content_advisory_descriptor";
-
- 666 return "ATSC CA_descriptor";
-
- 668 return "ATSC Descriptor_tag";
-
- 670 return "SCTE 35 cue identifier descriptor";
-
- 672 return "ATSC/SCTE Reserved";
-
- 674 return "TimeStampDescriptor";
-
- 676 return "parameterized_service_descriptor() ";
-
- 678 return "Interactive Services Filtering Criteria descriptor";
-
- 680 return "Interactive Services NRT Services Summary descriptor";
-
- 682 return "SCTE Frequency_spec_descriptor";
-
- 684 return "SCTE Modulation_params_descriptor";
-
- 686 return "SCTE Transport_stream_id_descriptor";
-
- 688 return "SCTE Revision detection descriptor";
-
- 690 return "SCTE Two part channel number descriptor";
-
- 692 return "SCTE Channel properties descriptor";
-
- 694 return "SCTE Daylight Savings Time Descriptor";
-
- 696 return "SCTE_adaptation_field_data_descriptor()";
-
- 698 return "SCTE Reserved";
-
- 700 return "extended_channel_name_descriptor";
-
- 702 return "ATSC service_location_descriptor";
-
- 704 return "time_shifted_service_descriptor";
-
- 706 return "component_name_descriptor";
-
- 708 return "ATSC data_service_descriptor";
-
- 710 return "ATSC PID Count descriptor";
-
- 712 return "ATSC Download descriptor";
-
- 714 return "ATSC Multiprotocol Encapsulation descriptor";
-
- 716 return "ATSC dcc_departing_request_descriptor";
-
- 718 return "ATSC dcc_arriving_request_descriptor";
-
- 720 return "ATSC rc_descriptor";
-
- 722 return "ATSC Genre descriptor";
-
- 724 return "SCTE MAC Address List";
-
- 726 return "ATSC private information descriptor";
-
- 728 return "ATSC compatibility wrapper descriptor";
-
- 730 return "ATSC broadcaster policy descriptor";
-
- 732 return "ATSC service name descriptor";
-
- 734 return "ATSC URI descriptor";
-
- 736 return "ATSC enhanced signaling descriptor";
-
- 738 return "ATSC M/H string mapping descriptor";
-
- 740 return "ATSC Module Link descriptor";
-
- 742 return "ATSC CRC32 descriptor";
-
- 744 return "ATSC Content Identifier Descriptor";
-
- 746 return "ModuleInfoDescriptor";
-
- 748 return "ATSC Group Link descriptor";
-
- 750 return "ATSC Time Stamp descriptor";
-
- 752 return "ScheduleDescriptor";
-
- 754 return "Component list descriptor";
-
- 756 return "ATSC M/H component descriptor";
-
- 758 return "ATSC M/H rights issuer descriptor";
-
- 760 return "ATSC M/H current program descriptor";
-
- 762 return "ATSC M/H original service identification descriptor";
-
- 764 return "protection_descriptor";
-
- 766 return "MH_SG_bootstrap_descriptor";
-
- 768 return "Service ID descriptor";
-
- 770 return "Protocol Version descriptor";
-
- 772 return "NRT Service descriptor";
-
- 774 return "Capabilities descriptor";
-
- 776 return "Icon descriptor";
-
- 778 return "Receiver Targeting descriptor";
-
- 780 return "Time Slot descriptor";
-
- 782 return "Internet Location Descriptor";
-
- 784 return "Associated Service descriptor";
-
- 786 return "Eye Identification Descriptor tag";
-
- 788 return "E-AC-3 descriptor (A/52 Annex G)";
-
- 790 return "2D 3D Corresponding Content Descriptor";
-
- 792 return "Multimedia EPG Linkage Descriptor";
-
- 794 return "etv_application_information_descriptor()";
-
- 796 return "etv_media_time_descriptor()";
-
- 798 return "etv_stream_event_descriptor()";
-
- 800 return "etv_application_descriptor()";
-
- 802 return "RBI_signaling_descriptor()";
-
- 804 return "etv_application_metadata_descriptor()";
-
- 806 return "etv_bif_platform_descriptor()";
-
- 808 return "etv_integrated_signaling_descriptor()";
-
- 810 return "3d_MPEG2_descriptor()";
-
- 812 return "ebp_descriptor()";
-
- 814 return "MPEG_AAC_descriptor";
-
- 816 return "IC3D_event_info_descriptor";
-
- 818 return "MDTV hybrid stereoscopic service descriptor";
-
-
-
-
- 823 void print_descriptor_info(TSDDescriptor *desc) {
-
-
-
-
- 828 TSDDescriptorRegistration res;
- 829 if (TSD_OK == tsd_parse_descriptor_registration(
- 830 desc->data, desc->data_length, &res)) {
- 831 LOGD(
"\n format identififer: 0x%08X", res.format_identifier);
-
-
-
-
- 836 TSDDescriptorISO639Language res;
- 837 if (TSD_OK == tsd_parse_descriptor_iso639_language(
- 838 desc->data, desc->data_length, &res)) {
-
-
- 841 for (; i < res.language_length; ++i) {
- 842 LOGD(
" ISO Language Code: 0x%08X, audio type: 0x%02x",
- 843 res.iso_language_code[i], res.audio_type[i]);
-
-
-
-
-
-
- 850 TSDDescriptorMaxBitrate res;
- 851 if (TSD_OK == tsd_parse_descriptor_max_bitrate(
- 852 desc->data, desc->data_length, &res)) {
- 853 LOGD(
" Maximum Bitrate: %d x 50 bytes/second", res.max_bitrate);
-
-
-
- 857 LOGW(
" Unknown Descriptor: 0x%x ", desc->tag);
-
-
-
-
- 862 static void* log_malloc (
size_t size) {
- 863 void *result = malloc(size);
- 864 LOGI(
"malloc(%d) -> %p %s\n", (
int)size,result, result!=NULL?
"OK":
"ERROR");
-
-
-
- 868 static void* log_calloc(
size_t num,
size_t size){
- 869 void *result = calloc(num, size);
- 870 LOGI(
"calloc(%d) -> %p %s\n", (
int)(num*size),result, result!=NULL?
"OK":
"ERROR");
-
-
-
- 874 static void* log_realloc(
void *ptr,
size_t size){
- 875 void *result = realloc(ptr, size);
- 876 LOGI(
"realloc(%d) -> %p %s\n", (
int)size, result, result!=NULL?
"OK":
"ERROR");
-
-
-
- 880 static void log_free (
void *mem){
- 881 LOGD(
"free(%p)\n", mem);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ 54 void begin()
override {
+
+
+
+
+
+
+
+
+
+ 64 memset(print_pids, 0,
sizeof(print_pids));
+
+
+ 67 if (tsd_context_init(&ctx)!=TSD_OK){
+
+
+
+
+
+
+ 74 ctx.malloc = log_malloc;
+ 75 ctx.realloc = log_realloc;
+ 76 ctx.calloc = log_calloc;
+
+
+
+
+ 81 if (stream_types.empty()){
+ 82 addStreamType(TSD_PMT_STREAM_TYPE_PES_METADATA);
+ 83 addStreamType(TSD_PMT_STREAM_TYPE_AUDIO_AAC);
+
+
+
+
+
+
+ 90 if (tsd_set_event_callback(&ctx, event_cb)!=TSD_OK){
+
+
+
+
+
+
+
+
+
+
+
+
+ 103 tsd_context_destroy(&ctx);
+
+
+
+
+ 108 virtual operator bool()
override {
return is_active; }
+
+ 110 const char *mime() {
return "video/MP2T"; }
+
+ 112 size_t write(
const void *in_ptr,
size_t in_size)
override {
+ 113 if (!is_active)
return 0;
+ 114 LOGD(
"MTSDecoder::write: %d", (
int)in_size);
+ 115 size_t result = buffer.
writeArray((uint8_t*)in_ptr, in_size);
+
+ 117 demux(underflowLimit);
+
+
+
+
+
+
+
+ 125 void clearStreamTypes(){
+
+ 127 stream_types.clear();
+
+
+ 130 void addStreamType(TSDPMTStreamType type){
+
+ 132 stream_types.push_back(type);
+
+
+ 135 bool isStreamTypeActive(TSDPMTStreamType type){
+ 136 for (
int j=0;j<stream_types.size();j++){
+ 137 if (stream_types[j]==type)
return true;
+
+
+
+
+
+
+
+
+
+ 149 is_alloc_active = flag;
+
+
+
+
+ 154 int underflowLimit = MTS_UNDERFLOW_LIMIT;
+ 155 bool is_active =
false;
+ 156 bool is_write_active =
false;
+ 157 bool is_alloc_active =
false;
+
+ 159 uint16_t print_pids[MTS_PRINT_PIDS_LEN] = {0};
+ 160 SingleBuffer<uint8_t> buffer{MTS_WRITE_BUFFER_SIZE};
+ 161 Vector<TSDPMTStreamType> stream_types;
+ 162 Vector<AllocSize> alloc_vector;
+
+ 164 void set_write_active(
bool flag){
+
+ 166 is_write_active = flag;
+
+
+ 169 void demux(
int limit){
+
+ 171 TSDCode res = TSD_OK;
+
+ 173 while (res == TSD_OK && buffer.
available() > limit) {
+ 174 size_t len = tsd_demux(&ctx, (
void *)buffer.
data(), buffer.
available(), &res);
+
+
+
+
+ 179 if (res != TSD_OK) logResult(res);
+
+ 181 LOGD(
"Number of demux calls: %d", count);
+
+
+ 184 void logResult(TSDCode code) {
+
+
+
+
+ 189 case TSD_INVALID_SYNC_BYTE:
+ 190 LOGW(
"TSD_INVALID_SYNC_BYTE");
+
+ 192 case TSD_INVALID_CONTEXT:
+ 193 LOGW(
"TSD_INVALID_CONTEXT");
+
+ 195 case TSD_INVALID_DATA:
+ 196 LOGW(
"TSD_INVALID_DATA");
+
+ 198 case TSD_INVALID_DATA_SIZE:
+ 199 LOGW(
"TSD_INVALID_DATA_SIZE");
+
+ 201 case TSD_INVALID_ARGUMENT:
+ 202 LOGW(
"TSD_INVALID_ARGUMENT");
+
+ 204 case TSD_INVALID_START_CODE_PREFIX:
+ 205 LOGW(
"TSD_INVALID_START_CODE_PREFIX");
+
+ 207 case TSD_OUT_OF_MEMORY:
+ 208 LOGW(
"TSD_OUT_OF_MEMORY");
+
+ 210 case TSD_INCOMPLETE_TABLE:
+ 211 LOGW(
"TSD_INCOMPLETE_TABLE");
+
+ 213 case TSD_NOT_A_TABLE_PACKET:
+ 214 LOGW(
"TSD_NOT_A_TABLE_PACKET");
+
+ 216 case TSD_PARSE_ERROR:
+ 217 LOGW(
"TSD_PARSE_ERROR");
+
+ 219 case TSD_PID_ALREADY_REGISTERED:
+ 220 LOGW(
"TSD_PID_ALREADY_REGISTERED");
+
+ 222 case TSD_TSD_MAX_PID_REGS_REACHED:
+ 223 LOGW(
"TSD_TSD_MAX_PID_REGS_REACHED");
+
+ 225 case TSD_PID_NOT_FOUND:
+ 226 LOGW(
"TSD_PID_NOT_FOUND");
+
+ 228 case TSD_INVALID_POINTER_FIELD:
+ 229 LOGW(
"TSD_INVALID_POINTER_FIELD");
+
+
+
+
+
+ 235 static void event_cb(TSDemuxContext *ctx, uint16_t pid, TSDEventId event_id,
+
+
+ 238 if (MTSDecoder::self !=
nullptr) {
+ 239 MTSDecoder::self->event_cb_local(ctx, pid, event_id, data);
+
+
+
+ 243 void event_cb_local(TSDemuxContext *ctx, uint16_t pid, TSDEventId event_id,
+
+ 245 if (event_id == TSD_EVENT_PAT) {
+ 246 set_write_active(
false);
+ 247 print_pat(ctx, data);
+ 248 }
else if (event_id == TSD_EVENT_PMT) {
+ 249 set_write_active(
false);
+ 250 print_pmt(ctx, data);
+ 251 }
else if (event_id == TSD_EVENT_PES) {
+ 252 TSDPESPacket *pes = (TSDPESPacket *)data;
+
+ 254 LOGD(
"====================");
+ 255 LOGD(
"PID %d PES Packet, Size: %ld, stream_id=%u, pts=%lu, dts=%lu", pid,
+ 256 pes->data_bytes_length, pes->stream_id, pes->pts, pes->dts);
+
+
+ 259 AudioLogger logger = AudioLogger::instance();
+ 260 for (i = 0; i < MTS_PRINT_PIDS_LEN; ++i) {
+ 261 if (print_pids[i] == pid) {
+
+ 263 if (logger.isLogging(AudioLogger::Debug)) {
+ 264 logger.print(
" PES data ");
+ 265 logger.print(is_write_active?
"active:":
"inactive:");
+
+ 267 while (j < pes->data_bytes_length) {
+ 268 char n = pes->data_bytes[j];
+ 269 logger.printCharHex(n);
+
+
+ 272 logger.printChar(
'\n');
+
+
+ 275 if (p_print !=
nullptr) {
+
+ 277 size_t eff = writeSamples<uint8_t>(p_print,(uint8_t*) pes->data_bytes, pes->data_bytes_length);
+ 278 if(eff!=pes->data_bytes_length){
+
+
+
+
+
+
+
+ 286 }
else if (event_id == TSD_EVENT_ADAP_FIELD_PRV_DATA) {
+ 287 set_write_active(
false);
+
+
+ 290 TSDAdaptationField *adap_field = (TSDAdaptationField *)data;
+ 291 TSDDescriptor *descriptors = NULL;
+ 292 size_t descriptors_length = 0;
+ 293 tsd_descriptor_extract(ctx, adap_field->private_data_bytes,
+ 294 adap_field->transport_private_data_length,
+ 295 &descriptors, &descriptors_length);
+
+ 297 LOGD(
"====================");
+ 298 LOGD(
"Descriptors - Adaptation Fields");
+
+ 300 for (; i < descriptors_length; ++i) {
+ 301 TSDDescriptor *des = &descriptors[i];
+ 302 LOGD(
" %d) tag: (0x%04X) %s", i, des->tag,
+ 303 descriptor_tag_to_str(des->tag));
+ 304 LOGD(
" length: %d", des->length);
+ 305 print_descriptor_info(des);
+
+
+
+
+ 310 void print_pat(TSDemuxContext *ctx,
void *data) {
+ 311 LOGD(
"====================");
+ 312 TSDPATData *pat = (TSDPATData *)data;
+ 313 size_t len = pat->length;
+
+ 315 LOGD(
"PAT, Length %d", (
int)pat->length);
+
+
+ 318 LOGD(
"number of progs: %d", (
int)len);
+
+ 320 for (i = 0; i < len; ++i) {
+ 321 LOGD(
" %d) prog num: 0x%X, pid: 0x%X", (
int)i, pat->program_number[i],
+
+
+
+
+ 326 void print_pmt(TSDemuxContext *ctx,
void *data) {
+ 327 LOGD(
"====================");
+
+ 329 TSDPMTData *pmt = (TSDPMTData *)data;
+ 330 LOGD(
"PCR PID: 0x%04X", pmt->pcr_pid);
+ 331 LOGD(
"program info length: %d", (
int)pmt->program_info_length);
+ 332 LOGD(
"descriptors length: %d", (
int)pmt->descriptors_length);
+
+
+ 335 for (i = 0; i < pmt->descriptors_length; ++i) {
+ 336 TSDDescriptor *des = &pmt->descriptors[i];
+ 337 LOGD(
" %d) tag: (0x%04X) %s", (
int)i, des->tag,
+ 338 descriptor_tag_to_str(des->tag));
+ 339 LOGD(
" length: %d", des->length);
+ 340 print_descriptor_info(des);
+
+
+ 343 LOGD(
"program elements length: %d", (
int)pmt->program_elements_length);
+ 344 for (i = 0; i < pmt->program_elements_length; ++i) {
+ 345 TSDProgramElement *prog = &pmt->program_elements[i];
+ 346 LOGD(
" -----Program #%d", (
int)i);
+ 347 LOGD(
" stream type: (0x%04X) %s", prog->stream_type,
+ 348 stream_type_to_str((TSDPESStreamId)(prog->stream_type)));
+ 349 LOGD(
" elementary pid: 0x%04X", prog->elementary_pid);
+ 350 LOGD(
" es info length: %d", prog->es_info_length);
+ 351 LOGD(
" descriptors length: %d", (
int)prog->descriptors_length);
+
+ 353 if (isStreamTypeActive((TSDPMTStreamType)prog->stream_type)){
+ 354 set_write_active(
true);
+
+
+
+ 358 for(
int j=0;j<stream_types.size();j++){
+ 359 add_print_pid(prog, stream_types[j]);
+
+
+
+ 363 int reg_types = TSD_REG_PES;
+
+
+ 366 for (j = 0; j < prog->descriptors_length; ++j) {
+ 367 TSDDescriptor *des = &prog->descriptors[j];
+ 368 LOGD(
" %d) tag: (0x%04X) %s", (
int)j, des->tag,
+ 369 descriptor_tag_to_str(des->tag));
+ 370 LOGD(
" length: %d", des->length);
+ 371 print_descriptor_info(des);
+
+
+
+ 375 if (des->tag == 0x97) {
+ 376 reg_types |= TSD_REG_ADAPTATION_FIELD;
+
+
+
+
+ 381 tsd_register_pid(ctx, prog->elementary_pid, reg_types);
+
+
+
+ 385 void add_print_pid(TSDProgramElement *prog, TSDPMTStreamType type) {
+ 386 if (prog->stream_type == type) {
+
+ 388 for (k = 0; k < MTS_PRINT_PIDS_LEN; ++k) {
+
+ 390 if (print_pids[k] == 0) {
+ 391 print_pids[k] = prog->elementary_pid;
+
+
+
+
+
+
+ 398 const char *stream_type_to_str(TSDPESStreamId stream_id) {
+ 399 if (stream_id >= 0x1C && stream_id <= 0x7F && stream_id != 0x24 &&
+
+ 401 stream_id = (TSDPESStreamId)0x1C;
+ 402 }
else if (stream_id >= 0x8A && stream_id <= 0x8F) {
+ 403 stream_id = (TSDPESStreamId)0x8A;
+ 404 }
else if (stream_id >= 0x93 && stream_id <= 0x94) {
+ 405 stream_id = (TSDPESStreamId)0x93;
+ 406 }
else if (stream_id >= 0x96 && stream_id <= 0x9F) {
+ 407 stream_id = (TSDPESStreamId)0x96;
+ 408 }
else if (stream_id >= 0xA1 && stream_id <= 0xBF) {
+ 409 stream_id = (TSDPESStreamId)0xA1;
+ 410 }
else if (stream_id >= 0xC4 && stream_id <= 0xE9) {
+ 411 stream_id = (TSDPESStreamId)0xC4;
+ 412 }
else if (stream_id >= 0xEB && stream_id <= 0xFF) {
+ 413 stream_id = (TSDPESStreamId)0xEB;
+
+
+
+
+ 418 return "ITU-T | ISO/IEC Reserved";
+
+ 420 return "ISO/IEC 11172 Video";
+
+ 422 return "ITU-T Rec. H.262 | ISO/IEC 13818-2 Video";
+
+ 424 return "ISO/IEC 11172 Audio";
+
+ 426 return "ISO/IEC 13818-3 Audio";
+
+ 428 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 private sections";
+
+ 430 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 PES packets containing "
+
+
+ 433 return "ISO/IEC 13522 MHEG";
+
+ 435 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 DSM-CC";
+
+ 437 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1/11172-1 auxiliary";
+
+ 439 return "ISO/IEC 13818-6 Multi-protocol Encapsulation";
+
+ 441 return "ISO/IEC 13818-6 DSM-CC U-N Messages";
+
+ 443 return "ISO/IEC 13818-6 Stream Descriptors";
+
+ 445 return "ISO/IEC 13818-6 Sections (any type, including private data)";
+
+ 447 return "ISO/IEC 13818-1 auxiliary";
+
+ 449 return "ISO/IEC 13818-7 Audio (AAC) with ADTS transport";
+
+ 451 return "ISO/IEC 14496-2 Visual";
+
+ 453 return "ISO/IEC 14496-3 Audio with the LATM transport syntax as "
+ 454 "defined in ISO/IEC 14496-3";
+
+ 456 return "ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried "
+
+
+ 459 return "ISO/IEC 14496-1 SL-packetized stream or FlexMux stream carried "
+ 460 "in ISO/IEC 14496_sections";
+
+ 462 return "ISO/IEC 13818-6 DSM-CC Synchronized Download Protocol";
+
+ 464 return "Metadata carried in PES packets";
+
+ 466 return "Metadata carried in metadata_sections";
+
+ 468 return "Metadata carried in ISO/IEC 13818-6 Data Carousel";
+
+ 470 return "Metadata carried in ISO/IEC 13818-6 Object Carousel";
+
+ 472 return "Metadata carried in ISO/IEC 13818-6 Synchronized Download "
+
+
+ 475 return "IPMP stream (defined in ISO/IEC 13818-11, MPEG-2 IPMP)";
+
+ 477 return "AVC video stream as defined in ITU-T Rec. H.264 | ISO/IEC "
+
+
+ 480 return "ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved";
+
+ 482 return "ITU-T Rec. H.265 and ISO/IEC 23008-2 (Ultra HD video) in a "
+
+
+ 485 return "Chinese Video Standard in a packetized stream";
+
+ 487 return "DigiCipher® II video | Identical to ITU-T Rec. H.262 | ISO/IEC "
+
+
+ 490 return "ATSC A/53 audio [2] | AC-3 audio";
+
+ 492 return "SCTE Standard Subtitle";
+
+ 494 return "SCTE Isochronous Data | Reserved";
+
+ 496 return "ATSC/SCTE reserved";
+
+ 498 return "ATSC Program Identifier , SCTE Reserved";
+
+ 500 return "SCTE 35 splice_information_table | [Cueing]";
+
+
+
+ 504 return "DTS HD Audio";
+
+ 506 return "ATSC Reserved";
+
+ 508 return "ATSC Reserved";
+
+ 510 return "DVB stream_type value for Time Slicing / MPE-FEC";
+
+ 512 return "IETF Unidirectional Link Encapsulation (ULE)";
+
+ 514 return "VEI stream_type";
+
+ 516 return "ATSC Reserved";
+
+ 518 return "ATSC Data Service Table, Network Resources Table";
+
+ 520 return "ATSC Reserved";
+
+ 522 return "SCTE [IP Data] | ATSC Reserved";
+
+ 524 return "ATSC Reserved";
+
+ 526 return "DCII (DigiCipher®) Text";
+
+ 528 return "ATSC Reserved";
+
+ 530 return "ATSC synchronous data stream | [Isochronous Data]";
+
+ 532 return "SCTE Asynchronous Data";
+
+ 534 return "ATSC User Private Program Elements";
+
+ 536 return "VC-1 Elementary Stream per RP227";
+
+ 538 return "ATSC User Private Program Elements";
+
+
+
+
+ 543 const char *descriptor_tag_to_str(uint8_t tag) {
+ 544 if (tag >= 0x24 && tag <= 0x27) {
+
+ 546 }
else if (tag >= 0x29 && tag <= 0x35) {
+
+ 548 }
else if (tag >= 0x3A && tag <= 0x3F) {
+
+ 550 }
else if (tag >= 0x40 && tag <= 0x51) {
+
+ 552 }
else if (tag >= 0x98 && tag <= 0x9F) {
+
+
+
+
+
+
+ 559 return "ISO/IEC 13818 Reserved";
+
+ 561 return "video_stream_descriptor";
+
+ 563 return "audio_stream_descriptor";
+
+ 565 return "hierarchy_descriptor";
+
+ 567 return "registration_descriptor";
+
+ 569 return "data_stream_alignment_descriptor";
+
+ 571 return "target_background_grid_descriptor";
+
+ 573 return "video_window_descriptor";
+
+ 575 return "CA_descriptor";
+
+ 577 return "ISO_639_language_descriptor";
+
+ 579 return "system_clock_descriptor";
+
+ 581 return "multiplex_buffer_utilization_descriptor";
+
+ 583 return "copyright_descriptor";
+
+ 585 return "Maximum_bitrate_descriptor";
+
+ 587 return "Private_data_indicator_descriptor";
+
+ 589 return "smoothing_buffer_descriptor";
+
+ 591 return "STD_descriptor";
+
+ 593 return "IBP descriptor";
+
+ 595 return "DSM-CC carousel_identifier_descriptor";
+
+ 597 return "DSM-CC association_tag_descriptor";
+
+ 599 return "DSM-CC deferred_association_tags_descriptor";
+
+ 601 return "ISO/IEC 13818-6 reserved";
+
+ 603 return "NPT Reference descriptor";
+
+ 605 return "NPT Endpoint descriptor";
+
+ 607 return "Stream Mode descriptor";
+
+ 609 return "Stream Event descriptor";
+
+ 611 return "MPEG-4_video_descriptor";
+
+ 613 return "MPEG-4_audio_descriptor";
+
+ 615 return "IOD_descriptor";
+
+ 617 return "SL_descriptor";
+
+ 619 return "FMC_descriptor";
+
+ 621 return "External_ES_ID_descriptor";
+
+ 623 return "MuxCode_descriptor";
+
+ 625 return "FmxBufferSize_descriptor";
+
+ 627 return "MultiplexBuffer_descriptor";
+
+ 629 return "Reserved for ISO/IEC 13818-1 use";
+
+ 631 return "AVC_video_descriptor()";
+
+ 633 return "Reserved for ISO/IEC 13818-1 use";
+
+ 635 return "content_labeling_descriptor";
+
+ 637 return "Metadata_location_descriptor";
+
+ 639 return "ISO/IEC 13818 Reserved";
+
+ 641 return "User Private";
+
+ 643 return "SCTE 35 Stream Identifier Descriptor";
+
+ 645 return "ACAP-X Application Descriptor";
+
+ 647 return "ACAP-X Application Location Descriptor";
+
+ 649 return "ACAP-X Application Boundary Descriptor";
+
+ 651 return "Stuffing_descriptor";
+
+ 653 return "AC3_audio_descriptor";
+
+ 655 return "SCTE Frame_rate_descriptor";
+
+ 657 return "SCTE Extended_video_descriptor";
+
+ 659 return "SCTE Component_name_descriptor";
+
+ 661 return "ATSC program_identifier";
+
+ 663 return "Caption_service_descriptor";
+
+ 665 return "Content_advisory_descriptor";
+
+ 667 return "ATSC CA_descriptor";
+
+ 669 return "ATSC Descriptor_tag";
+
+ 671 return "SCTE 35 cue identifier descriptor";
+
+ 673 return "ATSC/SCTE Reserved";
+
+ 675 return "TimeStampDescriptor";
+
+ 677 return "parameterized_service_descriptor() ";
+
+ 679 return "Interactive Services Filtering Criteria descriptor";
+
+ 681 return "Interactive Services NRT Services Summary descriptor";
+
+ 683 return "SCTE Frequency_spec_descriptor";
+
+ 685 return "SCTE Modulation_params_descriptor";
+
+ 687 return "SCTE Transport_stream_id_descriptor";
+
+ 689 return "SCTE Revision detection descriptor";
+
+ 691 return "SCTE Two part channel number descriptor";
+
+ 693 return "SCTE Channel properties descriptor";
+
+ 695 return "SCTE Daylight Savings Time Descriptor";
+
+ 697 return "SCTE_adaptation_field_data_descriptor()";
+
+ 699 return "SCTE Reserved";
+
+ 701 return "extended_channel_name_descriptor";
+
+ 703 return "ATSC service_location_descriptor";
+
+ 705 return "time_shifted_service_descriptor";
+
+ 707 return "component_name_descriptor";
+
+ 709 return "ATSC data_service_descriptor";
+
+ 711 return "ATSC PID Count descriptor";
+
+ 713 return "ATSC Download descriptor";
+
+ 715 return "ATSC Multiprotocol Encapsulation descriptor";
+
+ 717 return "ATSC dcc_departing_request_descriptor";
+
+ 719 return "ATSC dcc_arriving_request_descriptor";
+
+ 721 return "ATSC rc_descriptor";
+
+ 723 return "ATSC Genre descriptor";
+
+ 725 return "SCTE MAC Address List";
+
+ 727 return "ATSC private information descriptor";
+
+ 729 return "ATSC compatibility wrapper descriptor";
+
+ 731 return "ATSC broadcaster policy descriptor";
+
+ 733 return "ATSC service name descriptor";
+
+ 735 return "ATSC URI descriptor";
+
+ 737 return "ATSC enhanced signaling descriptor";
+
+ 739 return "ATSC M/H string mapping descriptor";
+
+ 741 return "ATSC Module Link descriptor";
+
+ 743 return "ATSC CRC32 descriptor";
+
+ 745 return "ATSC Content Identifier Descriptor";
+
+ 747 return "ModuleInfoDescriptor";
+
+ 749 return "ATSC Group Link descriptor";
+
+ 751 return "ATSC Time Stamp descriptor";
+
+ 753 return "ScheduleDescriptor";
+
+ 755 return "Component list descriptor";
+
+ 757 return "ATSC M/H component descriptor";
+
+ 759 return "ATSC M/H rights issuer descriptor";
+
+ 761 return "ATSC M/H current program descriptor";
+
+ 763 return "ATSC M/H original service identification descriptor";
+
+ 765 return "protection_descriptor";
+
+ 767 return "MH_SG_bootstrap_descriptor";
+
+ 769 return "Service ID descriptor";
+
+ 771 return "Protocol Version descriptor";
+
+ 773 return "NRT Service descriptor";
+
+ 775 return "Capabilities descriptor";
+
+ 777 return "Icon descriptor";
+
+ 779 return "Receiver Targeting descriptor";
+
+ 781 return "Time Slot descriptor";
+
+ 783 return "Internet Location Descriptor";
+
+ 785 return "Associated Service descriptor";
+
+ 787 return "Eye Identification Descriptor tag";
+
+ 789 return "E-AC-3 descriptor (A/52 Annex G)";
+
+ 791 return "2D 3D Corresponding Content Descriptor";
+
+ 793 return "Multimedia EPG Linkage Descriptor";
+
+ 795 return "etv_application_information_descriptor()";
+
+ 797 return "etv_media_time_descriptor()";
+
+ 799 return "etv_stream_event_descriptor()";
+
+ 801 return "etv_application_descriptor()";
+
+ 803 return "RBI_signaling_descriptor()";
+
+ 805 return "etv_application_metadata_descriptor()";
+
+ 807 return "etv_bif_platform_descriptor()";
+
+ 809 return "etv_integrated_signaling_descriptor()";
+
+ 811 return "3d_MPEG2_descriptor()";
+
+ 813 return "ebp_descriptor()";
+
+ 815 return "MPEG_AAC_descriptor";
+
+ 817 return "IC3D_event_info_descriptor";
+
+ 819 return "MDTV hybrid stereoscopic service descriptor";
+
+
+
+
+ 824 void print_descriptor_info(TSDDescriptor *desc) {
+
+
+
+
+ 829 TSDDescriptorRegistration res;
+ 830 if (TSD_OK == tsd_parse_descriptor_registration(
+ 831 desc->data, desc->data_length, &res)) {
+ 832 LOGD(
"\n format identififer: 0x%08X", res.format_identifier);
+
+
+
+
+ 837 TSDDescriptorISO639Language res;
+ 838 if (TSD_OK == tsd_parse_descriptor_iso639_language(
+ 839 desc->data, desc->data_length, &res)) {
+
+
+ 842 for (; i < res.language_length; ++i) {
+ 843 LOGD(
" ISO Language Code: 0x%08X, audio type: 0x%02x",
+ 844 res.iso_language_code[i], res.audio_type[i]);
+
+
+
+
+
+
+ 851 TSDDescriptorMaxBitrate res;
+ 852 if (TSD_OK == tsd_parse_descriptor_max_bitrate(
+ 853 desc->data, desc->data_length, &res)) {
+ 854 LOGD(
" Maximum Bitrate: %d x 50 bytes/second", res.max_bitrate);
+
+
+
+ 858 LOGW(
" Unknown Descriptor: 0x%x ", desc->tag);
+
+
+
+
+ 863 static void* log_malloc (
size_t size) {
+ 864 void *result = malloc(size);
+ 865 LOGI(
"malloc(%d) -> %p %s\n", (
int)size,result, result!=NULL?
"OK":
"ERROR");
+
+
+
+ 869 static void* log_calloc(
size_t num,
size_t size){
+ 870 void *result = calloc(num, size);
+ 871 LOGI(
"calloc(%d) -> %p %s\n", (
int)(num*size),result, result!=NULL?
"OK":
"ERROR");
+
+
+
+ 875 static void* log_realloc(
void *ptr,
size_t size){
+ 876 void *result = realloc(ptr, size);
+ 877 LOGI(
"realloc(%d) -> %p %s\n", (
int)size, result, result!=NULL?
"OK":
"ERROR");
+
+
+
+ 881 static void log_free (
void *mem){
+ 882 LOGD(
"free(%p)\n", mem);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- 944 MTSDecoder *MTSDecoder::self =
nullptr;
-
-
+
+
+
+ 945 MTSDecoder *MTSDecoder::self =
nullptr;
+
+
-
-
-
+
+
+
diff --git a/annotated.html b/annotated.html
index 9d2a8f2120..0309be921d 100644
--- a/annotated.html
+++ b/annotated.html
@@ -370,7 +370,7 @@
CMP3EncoderLAME | Encodes PCM data to the MP3 format and writes the result to a stream This is basically just a wrapper using https://github.com/pschatzmann/arduino-liblame |
CMP4Atom | Represents a single MPEG4 atom |
CMP4ParseBuffer | |
- CMTSDecoder | MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux |
+ CMTSDecoder | MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux |
CMultiConverter | Combines multiple converters |
CMultiOutput | Replicates the output to multiple destinations |
CMusicalNotes | Determination of the frequency of a music note |
diff --git a/classaudio__tools_1_1_audio_decoder.html b/classaudio__tools_1_1_audio_decoder.html
index 3d1db46e80..1322b2c8cd 100644
--- a/classaudio__tools_1_1_audio_decoder.html
+++ b/classaudio__tools_1_1_audio_decoder.html
@@ -114,7 +114,7 @@
-
+
diff --git a/classaudio__tools_1_1_audio_info_source.html b/classaudio__tools_1_1_audio_info_source.html
index 175c43cc77..3f7660d55c 100644
--- a/classaudio__tools_1_1_audio_info_source.html
+++ b/classaudio__tools_1_1_audio_info_source.html
@@ -113,7 +113,7 @@
-
+
diff --git a/classaudio__tools_1_1_audio_writer.html b/classaudio__tools_1_1_audio_writer.html
index f10a57496e..96481beefd 100644
--- a/classaudio__tools_1_1_audio_writer.html
+++ b/classaudio__tools_1_1_audio_writer.html
@@ -113,7 +113,7 @@
-
+
diff --git a/classaudio__tools_1_1_m_t_s_decoder.html b/classaudio__tools_1_1_m_t_s_decoder.html
index a5f553c072..fffff56771 100644
--- a/classaudio__tools_1_1_m_t_s_decoder.html
+++ b/classaudio__tools_1_1_m_t_s_decoder.html
@@ -77,7 +77,7 @@
-
MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux.
+
MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux.
More...
#include <CodecMTS.h>
@@ -261,7 +261,7 @@
|
-
MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux.
+
MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux.
- Author
- Phil Schatzmann
- Copyright
- GPLv3
The documentation for this class was generated from the following file:
diff --git a/group__codecs.html b/group__codecs.html
index 7713a8e972..567499c92b 100644
--- a/group__codecs.html
+++ b/group__codecs.html
@@ -268,7 +268,7 @@
| Encodes PCM data to the MP3 format and writes the result to a stream This is basically just a wrapper using https://github.com/pschatzmann/arduino-liblame. More...
|
|
class | MTSDecoder |
- | MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux. More...
|
+ | MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux. More...
|
|
class | OggContainerDecoder |
| Decoder for Ogg Container. Decodes a packet from an Ogg container. The Ogg begin segment contains the AudioInfo structure. You can subclass and overwrite the beginOfSegment() method to implement your own headers Dependency: https://github.com/pschatzmann/arduino-libopus. More...
|
diff --git a/group__decoder.html b/group__decoder.html
index e9e0d97999..861ad4990e 100644
--- a/group__decoder.html
+++ b/group__decoder.html
@@ -173,7 +173,7 @@
| MP3 Decoder using https://github.com/pschatzmann/minimp3. This decoder does not provide any good results and it is not suited to decode any audio above 32000 on an ESP32. So the sample rate is limited by the MINIMP3_MAX_SAMPLE_RATE variable. More...
|
|
class | MTSDecoder |
- | MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux. More...
|
+ | MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux. More...
|
|
class | OggContainerDecoder |
| Decoder for Ogg Container. Decodes a packet from an Ogg container. The Ogg begin segment contains the AudioInfo structure. You can subclass and overwrite the beginOfSegment() method to implement your own headers Dependency: https://github.com/pschatzmann/arduino-libopus. More...
|
diff --git a/hierarchy.html b/hierarchy.html
index a481eb14a7..606467ba17 100644
--- a/hierarchy.html
+++ b/hierarchy.html
@@ -181,7 +181,7 @@
CMP3DecoderHelix | MP3 Decoder using libhelix: https://github.com/pschatzmann/arduino-libhelix This is basically just a simple wrapper to provide AudioInfo and AudioInfoSupport |
CMP3DecoderMAD | MP3 Decoder using https://github.com/pschatzmann/arduino-libmad |
CMP3DecoderMini | MP3 Decoder using https://github.com/pschatzmann/minimp3. This decoder does not provide any good results and it is not suited to decode any audio above 32000 on an ESP32. So the sample rate is limited by the MINIMP3_MAX_SAMPLE_RATE variable |
- CMTSDecoder | MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux |
+ CMTSDecoder | MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux |
►COggContainerDecoder | Decoder for Ogg Container. Decodes a packet from an Ogg container. The Ogg begin segment contains the AudioInfo structure. You can subclass and overwrite the beginOfSegment() method to implement your own headers Dependency: https://github.com/pschatzmann/arduino-libopus |
COpusOggDecoder | Opus Decoder which uses the Ogg Container. See https://datatracker.ietf.org/doc/html/rfc7845. The audio data is transmitted in frames and the header information contains the sampler rate, channels and other critical info. Dependency: https://github.com/pschatzmann/arduino-libopus |
COpusAudioDecoder | OpusAudioDecoder: Depends on https://github.com/pschatzmann/arduino-libopus.git |
diff --git a/namespaceaudio__tools.html b/namespaceaudio__tools.html
index a53203766d..1b73c16ecf 100644
--- a/namespaceaudio__tools.html
+++ b/namespaceaudio__tools.html
@@ -938,7 +938,7 @@
class | MP4ParseBuffer |
|
class | MTSDecoder |
- | MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux. More...
|
+ | MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux. More...
|
|
class | MultiConverter |
| Combines multiple converters. More...
|
diff --git a/namespaces.html b/namespaces.html
index 0cf8770658..aae82032b9 100644
--- a/namespaces.html
+++ b/namespaces.html
@@ -370,7 +370,7 @@
CMP3EncoderLAME | Encodes PCM data to the MP3 format and writes the result to a stream This is basically just a wrapper using https://github.com/pschatzmann/arduino-liblame |
CMP4Atom | Represents a single MPEG4 atom |
CMP4ParseBuffer | |
- CMTSDecoder | MPEG-TS (MTS) decoder https://github.com/pschatzmann/arduino-tsdemux |
+ CMTSDecoder | MPEG-TS (MTS) decoder. Extracts the AAC audio data from a MPEG-TS (MTS) data stream. You can define the relevant stream types via the API. https://github.com/pschatzmann/arduino-tsdemux |
CMultiConverter | Combines multiple converters |
CMultiOutput | Replicates the output to multiple destinations |
CMusicalNotes | Determination of the frequency of a music note |