Mercurial > mplayer.hg
comparison libmpdemux/demux_lavf.c @ 21966:d9494ca70ca7
Simplify by using av_codec_get_id and include riff.h only in demux_lavf.c
author | reimar |
---|---|
date | Sun, 21 Jan 2007 15:44:58 +0000 |
parents | b60906a5ab6e |
children | f615c862f862 |
comparison
equal
deleted
inserted
replaced
21965:5a2311125dc4 | 21966:d9494ca70ca7 |
---|---|
65 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); | 65 extern void print_wave_header(WAVEFORMATEX *h, int verbose_level); |
66 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); | 66 extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level); |
67 | 67 |
68 int64_t ff_gcd(int64_t a, int64_t b); | 68 int64_t ff_gcd(int64_t a, int64_t b); |
69 | 69 |
70 const AVCodecTag mp_wav_tags[] = { | 70 static const AVCodecTag mp_wav_tags[] = { |
71 { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')}, | 71 { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')}, |
72 { CODEC_ID_ADPCM_EA, MKTAG('A', 'D', 'E', 'A')}, | 72 { CODEC_ID_ADPCM_EA, MKTAG('A', 'D', 'E', 'A')}, |
73 { CODEC_ID_ADPCM_IMA_WS, MKTAG('A', 'I', 'W', 'S')}, | 73 { CODEC_ID_ADPCM_IMA_WS, MKTAG('A', 'I', 'W', 'S')}, |
74 { CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)}, | 74 { CODEC_ID_AMR_NB, MKTAG('n', 'b', 0, 0)}, |
75 { CODEC_ID_DSICINAUDIO, MKTAG('D', 'C', 'I', 'A')}, | 75 { CODEC_ID_DSICINAUDIO, MKTAG('D', 'C', 'I', 'A')}, |
84 { CODEC_ID_WESTWOOD_SND1, MKTAG('S', 'N', 'D', '1')}, | 84 { CODEC_ID_WESTWOOD_SND1, MKTAG('S', 'N', 'D', '1')}, |
85 { CODEC_ID_XAN_DPCM, MKTAG('A', 'x', 'a', 'n')}, | 85 { CODEC_ID_XAN_DPCM, MKTAG('A', 'x', 'a', 'n')}, |
86 { 0, 0 }, | 86 { 0, 0 }, |
87 }; | 87 }; |
88 | 88 |
89 const AVCodecTag mp_bmp_tags[] = { | 89 const struct AVCodecTag *mp_wav_taglists[] = {codec_wav_tags, mp_wav_tags, 0}; |
90 | |
91 static const AVCodecTag mp_bmp_tags[] = { | |
90 { CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')}, | 92 { CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')}, |
91 { CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')}, | 93 { CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')}, |
92 { CODEC_ID_IDCIN, MKTAG('I', 'D', 'C', 'I')}, | 94 { CODEC_ID_IDCIN, MKTAG('I', 'D', 'C', 'I')}, |
93 { CODEC_ID_INTERPLAY_VIDEO, MKTAG('I', 'N', 'P', 'V')}, | 95 { CODEC_ID_INTERPLAY_VIDEO, MKTAG('I', 'N', 'P', 'V')}, |
94 { CODEC_ID_ROQ, MKTAG('R', 'o', 'Q', 'V')}, | 96 { CODEC_ID_ROQ, MKTAG('R', 'o', 'Q', 'V')}, |
97 { CODEC_ID_WS_VQA, MKTAG('V', 'Q', 'A', 'V')}, | 99 { CODEC_ID_WS_VQA, MKTAG('V', 'Q', 'A', 'V')}, |
98 { CODEC_ID_XAN_WC3, MKTAG('W', 'C', '3', 'V')}, | 100 { CODEC_ID_XAN_WC3, MKTAG('W', 'C', '3', 'V')}, |
99 { 0, 0 }, | 101 { 0, 0 }, |
100 }; | 102 }; |
101 | 103 |
104 const struct AVCodecTag *mp_bmp_taglists[] = {codec_bmp_tags, mp_bmp_tags, 0}; | |
105 | |
102 static int mp_open(URLContext *h, const char *filename, int flags){ | 106 static int mp_open(URLContext *h, const char *filename, int flags){ |
103 return 0; | 107 return 0; |
104 } | 108 } |
105 | 109 |
106 static int mp_read(URLContext *h, unsigned char *buf, int size){ | 110 static int mp_read(URLContext *h, unsigned char *buf, int size){ |
250 if(!sh_audio) | 254 if(!sh_audio) |
251 break; | 255 break; |
252 priv->astreams[priv->audio_streams] = i; | 256 priv->astreams[priv->audio_streams] = i; |
253 priv->audio_streams++; | 257 priv->audio_streams++; |
254 if(!codec->codec_tag) | 258 if(!codec->codec_tag) |
255 codec->codec_tag= codec_get_wav_tag(codec->codec_id); | 259 codec->codec_tag= av_codec_get_tag(mp_wav_taglists, codec->codec_id); |
256 if(!codec->codec_tag) | |
257 codec->codec_tag= codec_get_tag(mp_wav_tags, codec->codec_id); | |
258 wf->wFormatTag= codec->codec_tag; | 260 wf->wFormatTag= codec->codec_tag; |
259 wf->nChannels= codec->channels; | 261 wf->nChannels= codec->channels; |
260 wf->nSamplesPerSec= codec->sample_rate; | 262 wf->nSamplesPerSec= codec->sample_rate; |
261 wf->nAvgBytesPerSec= codec->bit_rate/8; | 263 wf->nAvgBytesPerSec= codec->bit_rate/8; |
262 wf->nBlockAlign= codec->block_align; | 264 wf->nBlockAlign= codec->block_align; |
324 priv->vstreams[priv->video_streams] = i; | 326 priv->vstreams[priv->video_streams] = i; |
325 priv->video_streams++; | 327 priv->video_streams++; |
326 bih=calloc(sizeof(BITMAPINFOHEADER) + codec->extradata_size,1); | 328 bih=calloc(sizeof(BITMAPINFOHEADER) + codec->extradata_size,1); |
327 | 329 |
328 if(!codec->codec_tag) | 330 if(!codec->codec_tag) |
329 codec->codec_tag= codec_get_bmp_tag(codec->codec_id); | 331 codec->codec_tag= av_codec_get_tag(mp_bmp_taglists, codec->codec_id); |
330 if(!codec->codec_tag) | |
331 codec->codec_tag= codec_get_tag(mp_bmp_tags, codec->codec_id); | |
332 bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size; | 332 bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size; |
333 bih->biWidth= codec->width; | 333 bih->biWidth= codec->width; |
334 bih->biHeight= codec->height; | 334 bih->biHeight= codec->height; |
335 bih->biBitCount= codec->bits_per_sample; | 335 bih->biBitCount= codec->bits_per_sample; |
336 bih->biSizeImage = bih->biWidth * bih->biHeight * bih->biBitCount/8; | 336 bih->biSizeImage = bih->biWidth * bih->biHeight * bih->biBitCount/8; |