vc1 in mpegts

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22180 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2007-02-09 19:39:31 +00:00
parent b847fc1727
commit 1f357e2f06
2 changed files with 14 additions and 4 deletions

View File

@ -70,6 +70,7 @@ typedef enum
VIDEO_MPEG4 = 0x10000004,
VIDEO_H264 = 0x10000005,
VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'),
VIDEO_VC1 = mmioFOURCC('W', 'V', 'C', '1'),
AUDIO_MP2 = 0x50,
AUDIO_A52 = 0x2000,
AUDIO_DTS = 0x2001,
@ -243,7 +244,7 @@ typedef struct {
#define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS))
#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC))
#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_VC1))
static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe);
@ -831,6 +832,8 @@ static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param)
mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO MPEG4(pid=%d) ", param->vpid);
else if(param->vtype == VIDEO_H264)
mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO H264(pid=%d) ", param->vpid);
else if(param->vtype == VIDEO_VC1)
mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO VC1(pid=%d) ", param->vpid);
else if(param->vtype == VIDEO_AVC)
mp_msg(MSGT_DEMUXER, MSGL_INFO, "VIDEO AVC(NAL-H264, pid=%d) ", param->vpid);
}
@ -1414,7 +1417,7 @@ static int pes_parse2(unsigned char *buf, uint16_t packet_len, ES_stream_t *es,
return 1;
}
}
else if((stream_id >= 0xe0) && (stream_id <= 0xef))
else if(((stream_id >= 0xe0) && (stream_id <= 0xef)) || (stream_id == 0xfd && type_from_pmt != UNKNOWN))
{
es->start = p;
es->size = packet_len;
@ -2199,6 +2202,10 @@ static int parse_descriptors(struct pmt_es_t *es, uint8_t *ptr)
{
es->type = AUDIO_DTS;
}
else if(d[0] == 'V' && d[1] == 'C' && d[2] == '-' && d[3] == '1')
{
es->type = AUDIO_DTS;
}
else
es->type = UNKNOWN;
mp_msg(MSGT_DEMUX, MSGL_DBG2, "FORMAT %s\n", es->format_descriptor);
@ -2393,6 +2400,9 @@ static int parse_pmt(ts_priv_t * priv, uint16_t progid, uint16_t pid, int is_sta
case 0x8A:
pmt->es[idx].type = AUDIO_DTS;
break;
case 0xEA:
pmt->es[idx].type = VIDEO_VC1;
break;
default:
mp_msg(MSGT_DEMUX, MSGL_DBG2, "UNKNOWN ES TYPE=0x%x\n", es_type);
pmt->es[idx].type = UNKNOWN;

View File

@ -75,7 +75,7 @@ if((d_video->demuxer->file_format == DEMUXER_TYPE_PVA) ||
((d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_PS) && (sh_video->format==0x10000005))
)
video_codec = VIDEO_H264;
else if((d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_PS) && (sh_video->format==mmioFOURCC('W', 'V', 'C', '1')))
else if((d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_PS || d_video->demuxer->file_format == DEMUXER_TYPE_MPEG_TS) && (sh_video->format==mmioFOURCC('W', 'V', 'C', '1')))
video_codec = VIDEO_VC1;
else
video_codec = VIDEO_OTHER;
@ -613,7 +613,7 @@ int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char**
*start=videobuffer; in_size=videobuf_len;
videobuf_len=0;
} else if((demuxer->file_format==DEMUXER_TYPE_MPEG_PS) && (sh_video->format==mmioFOURCC('W', 'V', 'C', '1'))) {
} else if((demuxer->file_format==DEMUXER_TYPE_MPEG_PS || demuxer->file_format==DEMUXER_TYPE_MPEG_TS) && (sh_video->format==mmioFOURCC('W', 'V', 'C', '1'))) {
while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE) {
int i=sync_video_packet(d_video);
if(!i) return -1;