📄 mpeg_descriptor.c
字号:
d.descriptor_tag = b[0]; d.descriptor_length = b[1]; d.association_tags_loop_length = getBits (b, 0, 16, 8); b += 3; len = d.descriptor_length - 1; out_SW_NL (4,"Association_tags_loop_length: ",d.association_tags_loop_length); /* -- association tags */ out_nl (4,"Association tag loop:"); indent (+1); for (i=0; i < d.association_tags_loop_length; ) { d.association_tag = getBits (b, 0, i, 16); out_SW_NL (4,"Association_tag: ",d.association_tag); i += 2; } indent (-1); b += d.association_tags_loop_length; len -= d.association_tags_loop_length; d.transport_stream_id = getBits (b, 0, 0, 16); d.program_number = getBits (b, 0, 16, 16); d.org_network_id = getBits (b, 0, 32, 16); b += 6; len -= 6; out_SW_NL (4,"Transport_stream_ID: ",d.transport_stream_id); out_SW_NL (4,"Program_number: ",d.program_number); out_S2W_NL (4,"Original_network_ID: ",d.org_network_id, dvbstrOriginalNetwork_ID(d.org_network_id)); print_private_data (4, b, len);}/* * ------------------------------------------------------------ * * -- DSM-CC STREAM Descriptors ISO 13818-6 * *//* 0x17 DSMCC NPT-reference descriptor ISO 13818-6 */void descriptorMPEG_NPT_reference (u_char *b){ // descriptor_tag = b[0]; // descriptor_length = b[1]; outBit_S2x_NL(4,"postDiscontinuityIndicator: ", b,16, 1, (char *(*)(u_long)) dsmccStr_postDiscontinuityIndicator); outBit_Sx_NL (4,"contentId: ", b,17, 7); outBit_Sx_NL (6,"reserved: ", b,24, 7); outBit64_Sx (4,"STC_Reference: ", b,31,33); out_nl (4," [= ref/300 * 90 kHz]"); outBit_Sx_NL (6,"reserved: ", b,64,31); outBit64_Sx_NL (4,"NPT_Reference: ", b,75,33); outBit_Sx_NL (4,"scaleNumerator: ", b,108,16); outBit_Sx_NL (4,"scaleDenominator: ", b,124,16);}/* 0x18 DSMCC NPT-endpoint descriptor ISO 13818-6 */void descriptorMPEG_NPT_endpoint (u_char *b){ unsigned long long t; // descriptor_tag = b[0]; // descriptor_length = b[1]; outBit_Sx_NL (6,"reserved: ", b,16,15); t = outBit64_Sx (4,"startNPT: ", b,31,33); out_nl_calc_NPT (4,t); outBit_Sx_NL (6,"reserved: ", b,64,15); t = outBit64_Sx (4,"stopNPT: ", b,79,33); out_nl_calc_NPT (4,t); }/* 0x19 DSMCC stream_mode descriptor ISO 13818-6 */void descriptorMPEG_stream_mode (u_char *b){ // descriptor_tag = b[0]; // descriptor_length = b[1]; outBit_S2x_NL(4,"streamMode: ", b,16, 8, (char *(*)(u_long)) dsmccStr_streamMode); outBit_Sx_NL (6,"reserved: ", b,24, 8); }/* 0x1A DSMCC stream_event descriptor ISO 13818-6 */void descriptorMPEG_stream_event (u_char *b){ unsigned long long t; int len; // descriptor_tag = b[0]; len = b[1]; outBit_Sx_NL (4,"eventId: ", b,16,16); outBit_Sx_NL (6,"reserved: ", b,32,31); t = outBit64_Sx (4,"eventNPT: ", b,63,33); out_nl_calc_NPT (4,t); b += 12; len -= 10; print_private_data (4, b, len);}/* * ------------------------------------------------------------ * * -- MPEG4 Descriptors ISO 13818-1 * *//* 0x1B MPEG4 video descriptor ISO 13818-1 */void descriptorMPEG_MPEG4_video (u_char *b){ // d.descriptor_tag = b[0]; // d.descriptor_length = b[1]; outBit_Sx_NL (4,"MPEG4 visual profile and level: ", b,16,8); /* $$$ Table */} /* 0x1C MPEG4 audio descriptor ISO 13818-1 */void descriptorMPEG_MPEG4_audio (u_char *b){ // d.descriptor_tag = b[0]; // d.descriptor_length = b[1]; outBit_Sx_NL (4,"MPEG4 audio profile and level: ", b,16,8); /* $$$ Table */}/* 0x1D IOD - InitialObjectDescriptor ISO 13818-1 */void descriptorMPEG_IOD (u_char *b){ // d.descriptor_tag = b[0]; // d.descriptor_length = b[1]; outBit_Sx_NL (4,"Scope_of_IOD: ", b,16,8); outBit_Sx_NL (4,"IOD_label: ", b,24,8); outBit_Sx_NL (4,"InitialObjectDescriptor: ", b,32,8); // $$$ TODO defined in subclause 8.6.3.1 of ISO/IEC 14496-1}/* 0x1E SL descriptor ISO 13818-1 */void descriptorMPEG_SL (u_char *b){ // d.descriptor_tag = b[0]; // d.descriptor_length = b[1]; outBit_Sx_NL (4,"ES_ID: ", b,16,16);}/* 0x1F FMC descriptor ISO 13818-1 */void descriptorMPEG_FMC (u_char *b){ int descriptor_length; // d.descriptor_tag = b[0]; descriptor_length = b[1]; b += 2; while (descriptor_length > 0 ) { outBit_Sx_NL (4,"ES_ID: ", b, 0,16); outBit_Sx_NL (4,"FlexMuxChannel: ", b,16, 8); b += 3; descriptor_length -= 3; }}/* 0x20 External SL descriptor ISO 13818-1 */void descriptorMPEG_External_ES_ID (u_char *b){ // d.descriptor_tag = b[0]; // d.descriptor_length = b[1]; outBit_Sx_NL (4,"ES_ID: ", b,16,16);}/* 0x21 MuxCode descriptor ISO 13818-1 */void descriptorMPEG_MuxCode (u_char *b){ int len; // tag = b[0]; len = b[1]; print_databytes (4,"MuxCodeTableEntry", b+2, len); // $$$ TODO // $$$ TODO defined in subclause 11.2.4.3 of ISO/IEC 14496-1. // Muxcode_descriptor () { // descriptor_tag 8 uimsbf // descriptor_length 8 uimsbf // for (i = 0; i < N; i++) { // MuxCodeTableEntry () // } // }}/* 0x22 FMX Buffer Size descriptor ISO 13818-1 */void descriptorMPEG_FMXBufferSize (u_char *b){ int len; // tag = b[0]; len = b[1]; indent (+1); printhex_buf (4, b+2, len); // $$$ TODO indent (-1); // $$$ TODO defined in subclause 11.2 of ISO/IEC 14496-1. // FmxBufferSize_descriptor () { // descriptor_tag 8 uimsbf // descriptor_length 8 uimsbf // DefaultFlexMuxBufferDescriptor() // for (i=0; i<descriptor_length; i += 4) { // FlexMuxBufferDescriptor() // } // }}/* 0x23 Multiplex Buffer descriptor ISO 13818-1 */void descriptorMPEG_MultiplexBuffer (u_char *b){ // d.descriptor_tag = b[0]; // d.descriptor_length = b[1]; outBit_S2Tx_NL (4,"MB_buffer_size: ", b,16,24,"bytes"); outBit_S2Tx_NL (4,"TB_leak_rate: ", b,40,24,"(x 400 bit/s)");}// ---- collision with old H.222.0 draft, obsolete??// /*// 0x24 Flex-Mux-Timing descriptor// ITU-T H.222.0-I-Cor1 // */// // void descriptorMPEG_FlexMuxTiming (u_char *b)// // {// // d.descriptor_tag = b[0];// // d.descriptor_length = b[1];// // // outBit_Sx_NL (4,"FCR_ES_ID: ", b,16,16);// outBit_S2Tx_NL (4,"FCRResolution: ", b,32,32,"(cycles/s)");// outBit_Sx_NL (4,"FCRLength: ", b,64, 8);// outBit_Sx_NL (4,"FCRRateLength: ", b,72, 8);// // }/* 0x24 Content Labeling descriptor ITU-T H.222.0 AMD 1*/void descriptorMPEG_ContentLabeling (u_char *b){ int len; u_int maf; u_int crirf; u_int ctbi; // tag = b[0]; len = b[1];// $$$ TODO indent (+1); printhex_buf (4, b+2, len); // $$$ TODO H.222.0 AMD 1 indent (-1); maf = outBit_S2x_NL (4,"metadata_application_format: ", b, 16, 16, (char *(*)(u_long)) dvbstrMPEG_metadata_application_format); b += 4; len -= 2; if (maf == 0xFFFF) { outBit_Sx_NL (4,"metadata_application_format_identifier: ", b, 0, 32); b += 4; len -= 4; } crirf = outBit_Sx_NL (4,"content_reference_id_record_flag: ", b, 0, 1); ctbi = outBit_S2x_NL(4,"content_time_base_indicator: ", b, 1, 4, (char *(*)(u_long)) dvbstrMPEG_Content_time_base_indicator); outBit_Sx_NL (6,"reserved: ", b, 5, 3); b++; len --; if (crirf == 1) { u_int len2; len2 = outBit_Sx_NL (4,"content_reference_id_record_length: ", b, 0, 8); print_databytes (4,"content_reference_id_byte:", b+1, len2); b += len2 + 1; len -= len2 + 1; } if ( (ctbi == 1) || (ctbi == 2)) { long long ll; outBit_Sx_NL (6,"reserved: ", b, 0, 7); ll = getBits48 (b, 0, 7, 33); out_S2LL_NL(4,"content_time_base_value: ",ll,"90kHz units"); // -- following is wrong, because of different unit measuring // out (4,"content_time_base_value: "); // print_timebase90kHz (4, ll); // out_NL (4); outBit_Sx_NL (6,"reserved: ", b, 40, 7); ll = getBits48 (b, 0, 47, 33); out_S2LL_NL(4,"metadata_time_base_value: ",ll,"90kHz units"); // -- following is wrong, because of different unit measuring // out (4,"metadata_time_base_value: "); // print_timebase90kHz (4, ll); // out_NL (4); b += 10; len -= 10; } if (ctbi == 2) { outBit_Sx_NL (6,"reserved: ", b, 0, 1); outBit_Sx_NL (4,"contentId: ", b, 1, 7); b++; len --; } if ( (ctbi >= 3) && (ctbi <= 7)) { u_int len2; len2 = outBit_Sx_NL (4,"time_base_association_data_length: ", b, 0, 8); print_databytes (6,"reserved:", b+1, len2); b += len2 + 1; len -= len2 + 1; } print_private_data (4, b, len);}/* 0x25 TVA metadata pointer descriptor TS 102 323 TV ANYTIME */void descriptorMPEG_TVA_metadata_pointer (u_char *b){ int len; // tag = b[0]; len = b[1]; indent (+1); printhex_buf (4, b+2, len); // $$$ TODO TS 102 323, where defined? indent (-1);}/* 0x26 TVA metadata descriptor TS 102 323 TV ANYTIME */void descriptorMPEG_TVA_metadata (u_char *b){ int len; // tag = b[0]; len = b[1]; indent (+1); printhex_buf (4, b+2, len); // $$$ TODO TS 102 323, where defined? indent (-1);}/* 0x27 TVA metadata STD descriptor ISO/IEC 13818-1:2000/DAM-1:2001(E)*/void descriptorMPEG_TVA_metadata_STD (u_char *b){ // tag = b[0]; // len = b[1]; outBit_Sx_NL (6,"reserved: ", b, 16, 2); outBit_S2Tx_NL (4,"metadata_input_leak_rate: ", b, 18, 22,"(x 400 bit/s)"); outBit_Sx_NL (6,"reserved: ", b, 40, 2); outBit_S2Tx_NL (4,"metadata_buffer_size: ", b, 42, 22,"(x 1024 bytes)"); outBit_Sx_NL (6,"reserved: ", b, 64, 2); outBit_S2Tx_NL (4,"metadata_output_leak_rate: ", b, 66, 22,"(x 400 bit/s)");}/* 0x28 AVC video descriptor H.222.0 AMD 3*/void descriptorMPEG_AVC_video (u_char *b){ int len; // tag = b[0]; len = b[1]; indent (+1); printhex_buf (4, b+2, len); // $$$ TODO indent (-1);}/* 0x29 IPMP descriptor H.222.0 AMD 3*/void descriptorMPEG_IPMP (u_char *b){ int len; // tag = b[0]; len = b[1]; indent (+1); printhex_buf (4, b+2, len); // $$$ TODO indent (-1);}/* 0x2A AVC_timing_and_HRD descriptor H.222.0 AMD 3*/void descriptorMPEG_AVC_timing_and_HRD (u_char *b){ int len; // tag = b[0]; len = b[1]; indent (+1); printhex_buf (4, b+2, len); // $$$ TODO indent (-1);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -