comparison libmpdemux/demux_ts.c @ 18565:0eaccc94c90c

support for dts (identified only by the PMT, not from the bitstream)
author nicodvb
date Sun, 04 Jun 2006 23:23:58 +0000
parents c56569da9230
children a109f55ad8d8
comparison
equal deleted inserted replaced
18564:c56569da9230 18565:0eaccc94c90c
69 VIDEO_MPEG4 = 0x10000004, 69 VIDEO_MPEG4 = 0x10000004,
70 VIDEO_H264 = 0x10000005, 70 VIDEO_H264 = 0x10000005,
71 VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'), 71 VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'),
72 AUDIO_MP2 = 0x50, 72 AUDIO_MP2 = 0x50,
73 AUDIO_A52 = 0x2000, 73 AUDIO_A52 = 0x2000,
74 AUDIO_DTS = 0x2001,
74 AUDIO_LPCM_BE = 0x10001, 75 AUDIO_LPCM_BE = 0x10001,
75 AUDIO_AAC = mmioFOURCC('M', 'P', '4', 'A'), 76 AUDIO_AAC = mmioFOURCC('M', 'P', '4', 'A'),
76 SPU_DVD = 0x3000000, 77 SPU_DVD = 0x3000000,
77 SPU_DVB = 0x3000001, 78 SPU_DVB = 0x3000001,
78 PES_PRIVATE1 = 0xBD00000, 79 PES_PRIVATE1 = 0xBD00000,
230 es_stream_type_t type; 231 es_stream_type_t type;
231 ts_section_t section; 232 ts_section_t section;
232 } TS_pids_t; 233 } TS_pids_t;
233 234
234 235
235 #define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC)) 236 #define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS))
236 #define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC)) 237 #define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC))
237 238
238 static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe); 239 static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe);
239 240
240 static uint8_t get_packet_size(const unsigned char *buf, int size) 241 static uint8_t get_packet_size(const unsigned char *buf, int size)
770 771
771 if(param->atype == AUDIO_MP2) 772 if(param->atype == AUDIO_MP2)
772 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO MPA(pid=%d)", param->apid); 773 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO MPA(pid=%d)", param->apid);
773 else if(param->atype == AUDIO_A52) 774 else if(param->atype == AUDIO_A52)
774 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO A52(pid=%d)", param->apid); 775 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO A52(pid=%d)", param->apid);
776 else if(param->atype == AUDIO_DTS)
777 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO DTS(pid=%d)", param->apid);
775 else if(param->atype == AUDIO_LPCM_BE) 778 else if(param->atype == AUDIO_LPCM_BE)
776 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO LPCM(pid=%d)", param->apid); 779 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO LPCM(pid=%d)", param->apid);
777 else if(param->atype == AUDIO_AAC) 780 else if(param->atype == AUDIO_AAC)
778 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO AAC(pid=%d)", param->apid); 781 mp_msg(MSGT_DEMUXER, MSGL_INFO, "AUDIO AAC(pid=%d)", param->apid);
779 else 782 else
2164 2167
2165 d = &ptr[j+2]; 2168 d = &ptr[j+2];
2166 if(d[0] == 'A' && d[1] == 'C' && d[2] == '-' && d[3] == '3') 2169 if(d[0] == 'A' && d[1] == 'C' && d[2] == '-' && d[3] == '3')
2167 { 2170 {
2168 es->type = AUDIO_A52; 2171 es->type = AUDIO_A52;
2172 }
2173 else if(d[0] == 'D' && d[1] == 'T' && d[2] == 'S' && d[3] == '2')
2174 {
2175 es->type = AUDIO_DTS;
2169 } 2176 }
2170 else 2177 else
2171 es->type = UNKNOWN; 2178 es->type = UNKNOWN;
2172 mp_msg(MSGT_DEMUX, MSGL_DBG2, "FORMAT %s\n", es->format_descriptor); 2179 mp_msg(MSGT_DEMUX, MSGL_DBG2, "FORMAT %s\n", es->format_descriptor);
2173 } 2180 }
2356 pmt->es[idx].type = SL_SECTION; 2363 pmt->es[idx].type = SL_SECTION;
2357 break; 2364 break;
2358 case 0x81: 2365 case 0x81:
2359 pmt->es[idx].type = AUDIO_A52; 2366 pmt->es[idx].type = AUDIO_A52;
2360 break; 2367 break;
2368 case 0x8A:
2369 pmt->es[idx].type = AUDIO_DTS;
2370 break;
2361 default: 2371 default:
2362 mp_msg(MSGT_DEMUX, MSGL_DBG2, "UNKNOWN ES TYPE=0x%x\n", es_type); 2372 mp_msg(MSGT_DEMUX, MSGL_DBG2, "UNKNOWN ES TYPE=0x%x\n", es_type);
2363 pmt->es[idx].type = UNKNOWN; 2373 pmt->es[idx].type = UNKNOWN;
2364 } 2374 }
2365 2375