comparison libmpdemux/demux_ts.c @ 22162:1ca423133265

vc1 in mpegts
author nicodvb
date Fri, 09 Feb 2007 19:39:31 +0000
parents 1bd2bb5369ce
children 0e60f69c9dc4
comparison
equal deleted inserted replaced
22161:f5a72835fbee 22162:1ca423133265
68 VIDEO_MPEG1 = 0x10000001, 68 VIDEO_MPEG1 = 0x10000001,
69 VIDEO_MPEG2 = 0x10000002, 69 VIDEO_MPEG2 = 0x10000002,
70 VIDEO_MPEG4 = 0x10000004, 70 VIDEO_MPEG4 = 0x10000004,
71 VIDEO_H264 = 0x10000005, 71 VIDEO_H264 = 0x10000005,
72 VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'), 72 VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'),
73 VIDEO_VC1 = mmioFOURCC('W', 'V', 'C', '1'),
73 AUDIO_MP2 = 0x50, 74 AUDIO_MP2 = 0x50,
74 AUDIO_A52 = 0x2000, 75 AUDIO_A52 = 0x2000,
75 AUDIO_DTS = 0x2001, 76 AUDIO_DTS = 0x2001,
76 AUDIO_LPCM_BE = 0x10001, 77 AUDIO_LPCM_BE = 0x10001,
77 AUDIO_AAC = mmioFOURCC('M', 'P', '4', 'A'), 78 AUDIO_AAC = mmioFOURCC('M', 'P', '4', 'A'),
241 ts_section_t section; 242 ts_section_t section;
242 } TS_pids_t; 243 } TS_pids_t;
243 244
244 245
245 #define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS)) 246 #define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS))
246 #define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC)) 247 #define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_VC1))
247 248
248 static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe); 249 static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe);
249 250
250 static uint8_t get_packet_size(const unsigned char *buf, int size) 251 static uint8_t get_packet_size(const unsigned char *buf, int size)
251 { 252 {
829 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO MPEG2(pid=%d) ", param->vpid); 830 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO MPEG2(pid=%d) ", param->vpid);
830 else if(param->vtype == VIDEO_MPEG4) 831 else if(param->vtype == VIDEO_MPEG4)
831 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO MPEG4(pid=%d) ", param->vpid); 832 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO MPEG4(pid=%d) ", param->vpid);
832 else if(param->vtype == VIDEO_H264) 833 else if(param->vtype == VIDEO_H264)
833 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO H264(pid=%d) ", param->vpid); 834 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO H264(pid=%d) ", param->vpid);
835 else if(param->vtype == VIDEO_VC1)
836 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO VC1(pid=%d) ", param->vpid);
834 else if(param->vtype == VIDEO_AVC) 837 else if(param->vtype == VIDEO_AVC)
835 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO AVC(NAL-H264, pid=%d) ", param->vpid); 838 mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO AVC(NAL-H264, pid=%d) ", param->vpid);
836 } 839 }
837 else 840 else
838 { 841 {
1412 es->payload_size -= packet_len; 1415 es->payload_size -= packet_len;
1413 1416
1414 return 1; 1417 return 1;
1415 } 1418 }
1416 } 1419 }
1417 else if((stream_id >= 0xe0) && (stream_id <= 0xef)) 1420 else if(((stream_id >= 0xe0) && (stream_id <= 0xef)) || (stream_id == 0xfd && type_from_pmt != UNKNOWN))
1418 { 1421 {
1419 es->start = p; 1422 es->start = p;
1420 es->size = packet_len; 1423 es->size = packet_len;
1421 if(type_from_pmt != UNKNOWN) 1424 if(type_from_pmt != UNKNOWN)
1422 es->type = type_from_pmt; 1425 es->type = type_from_pmt;
2194 if(d[0] == 'A' && d[1] == 'C' && d[2] == '-' && d[3] == '3') 2197 if(d[0] == 'A' && d[1] == 'C' && d[2] == '-' && d[3] == '3')
2195 { 2198 {
2196 es->type = AUDIO_A52; 2199 es->type = AUDIO_A52;
2197 } 2200 }
2198 else if(d[0] == 'D' && d[1] == 'T' && d[2] == 'S' && d[3] == '2') 2201 else if(d[0] == 'D' && d[1] == 'T' && d[2] == 'S' && d[3] == '2')
2202 {
2203 es->type = AUDIO_DTS;
2204 }
2205 else if(d[0] == 'V' && d[1] == 'C' && d[2] == '-' && d[3] == '1')
2199 { 2206 {
2200 es->type = AUDIO_DTS; 2207 es->type = AUDIO_DTS;
2201 } 2208 }
2202 else 2209 else
2203 es->type = UNKNOWN; 2210 es->type = UNKNOWN;
2391 pmt->es[idx].type = AUDIO_A52; 2398 pmt->es[idx].type = AUDIO_A52;
2392 break; 2399 break;
2393 case 0x8A: 2400 case 0x8A:
2394 pmt->es[idx].type = AUDIO_DTS; 2401 pmt->es[idx].type = AUDIO_DTS;
2395 break; 2402 break;
2403 case 0xEA:
2404 pmt->es[idx].type = VIDEO_VC1;
2405 break;
2396 default: 2406 default:
2397 mp_msg(MSGT_DEMUX, MSGL_DBG2, "UNKNOWN ES TYPE=0x%x\n", es_type); 2407 mp_msg(MSGT_DEMUX, MSGL_DBG2, "UNKNOWN ES TYPE=0x%x\n", es_type);
2398 pmt->es[idx].type = UNKNOWN; 2408 pmt->es[idx].type = UNKNOWN;
2399 } 2409 }
2400 2410