Browse Source

Add ff_ prefixes to exported symbols in libavformat/riff.h.

patch by Daniel Verkamp, aniel drv nu

Originally committed as revision 19254 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Daniel Verkamp Diego Biurrun 16 years ago
parent
commit
1a40491ef2
28 changed files with 136 additions and 136 deletions
  1. +1
    -1
      libavformat/aiff.c
  2. +2
    -2
      libavformat/asfdec.c
  3. +4
    -4
      libavformat/asfenc.c
  4. +1
    -1
      libavformat/au.c
  5. +2
    -2
      libavformat/avidec.c
  6. +31
    -31
      libavformat/avienc.c
  7. +2
    -2
      libavformat/avisynth.c
  8. +1
    -1
      libavformat/dxa.c
  9. +1
    -1
      libavformat/gxfenc.c
  10. +6
    -6
      libavformat/libnut.c
  11. +4
    -4
      libavformat/matroskadec.c
  12. +9
    -9
      libavformat/matroskaenc.c
  13. +2
    -2
      libavformat/mmf.c
  14. +9
    -9
      libavformat/mov.c
  15. +9
    -9
      libavformat/movenc.c
  16. +2
    -2
      libavformat/nsvdec.c
  17. +3
    -3
      libavformat/nutdec.c
  18. +1
    -1
      libavformat/nutenc.c
  19. +2
    -2
      libavformat/nuv.c
  20. +4
    -4
      libavformat/oggparseogm.c
  21. +1
    -1
      libavformat/oma.c
  22. +10
    -10
      libavformat/riff.c
  23. +10
    -10
      libavformat/riff.h
  24. +2
    -2
      libavformat/swfdec.c
  25. +1
    -1
      libavformat/swfenc.c
  26. +4
    -4
      libavformat/utils.c
  27. +2
    -2
      libavformat/vocdec.c
  28. +10
    -10
      libavformat/wav.c

+ 1
- 1
libavformat/aiff.c View File

@@ -119,7 +119,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
/* Got an AIFF-C? */ /* Got an AIFF-C? */
if (version == AIFF_C_VERSION1) { if (version == AIFF_C_VERSION1) {
codec->codec_tag = get_le32(pb); codec->codec_tag = get_le32(pb);
codec->codec_id = codec_get_id(codec_aiff_tags, codec->codec_tag);
codec->codec_id = ff_codec_get_id(codec_aiff_tags, codec->codec_tag);


switch (codec->codec_id) { switch (codec->codec_id) {
case CODEC_ID_PCM_S16BE: case CODEC_ID_PCM_S16BE:


+ 2
- 2
libavformat/asfdec.c View File

@@ -289,7 +289,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)


st->codec->codec_type = type; st->codec->codec_type = type;
if (type == CODEC_TYPE_AUDIO) { if (type == CODEC_TYPE_AUDIO) {
get_wav_header(pb, st->codec, type_specific_size);
ff_get_wav_header(pb, st->codec, type_specific_size);
if (is_dvr_ms_audio) { if (is_dvr_ms_audio) {
// codec_id and codec_tag are unreliable in dvr_ms // codec_id and codec_tag are unreliable in dvr_ms
// files. Set them later by probing stream. // files. Set them later by probing stream.
@@ -375,7 +375,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
} }


st->codec->codec_tag = tag1; st->codec->codec_tag = tag1;
st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1);
if(tag1 == MKTAG('D', 'V', 'R', ' ')) if(tag1 == MKTAG('D', 'V', 'R', ' '))
st->need_parsing = AVSTREAM_PARSE_FULL; st->need_parsing = AVSTREAM_PARSE_FULL;
} }


+ 4
- 4
libavformat/asfenc.c View File

@@ -405,7 +405,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data


if (enc->codec_type == CODEC_TYPE_AUDIO) { if (enc->codec_type == CODEC_TYPE_AUDIO) {
/* WAVEFORMATEX header */ /* WAVEFORMATEX header */
int wavsize = put_wav_header(pb, enc);
int wavsize = ff_put_wav_header(pb, enc);
if ((enc->codec_id != CODEC_ID_MP3) && (enc->codec_id != CODEC_ID_MP2) && (enc->codec_id != CODEC_ID_ADPCM_IMA_WAV) && (enc->extradata_size==0)) { if ((enc->codec_id != CODEC_ID_MP3) && (enc->codec_id != CODEC_ID_MP2) && (enc->codec_id != CODEC_ID_ADPCM_IMA_WAV) && (enc->extradata_size==0)) {
wavsize += 2; wavsize += 2;
put_le16(pb, 0); put_le16(pb, 0);
@@ -437,7 +437,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
put_le16(pb, 40 + enc->extradata_size); /* size */ put_le16(pb, 40 + enc->extradata_size); /* size */


/* BITMAPINFOHEADER header */ /* BITMAPINFOHEADER header */
put_bmp_header(pb, enc, codec_bmp_tags, 1);
ff_put_bmp_header(pb, enc, ff_codec_bmp_tags, 1);
} }
end_header(pb, hpos); end_header(pb, hpos);
} }
@@ -854,7 +854,7 @@ AVOutputFormat asf_muxer = {
asf_write_packet, asf_write_packet,
asf_write_trailer, asf_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0},
.metadata_conv = ff_asf_metadata_conv, .metadata_conv = ff_asf_metadata_conv,
}; };
#endif #endif
@@ -876,7 +876,7 @@ AVOutputFormat asf_stream_muxer = {
asf_write_packet, asf_write_packet,
asf_write_trailer, asf_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, codec_bmp_tags, codec_wav_tags, 0},
.codec_tag= (const AVCodecTag* const []){codec_asf_bmp_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0},
.metadata_conv = ff_asf_metadata_conv, .metadata_conv = ff_asf_metadata_conv,
}; };
#endif //CONFIG_ASF_STREAM_MUXER #endif //CONFIG_ASF_STREAM_MUXER

+ 1
- 1
libavformat/au.c View File

@@ -137,7 +137,7 @@ static int au_read_header(AVFormatContext *s,
rate = get_be32(pb); rate = get_be32(pb);
channels = get_be32(pb); channels = get_be32(pb);


codec = codec_get_id(codec_au_tags, id);
codec = ff_codec_get_id(codec_au_tags, id);


if (size >= 24) { if (size >= 24) {
/* skip unused data */ /* skip unused data */


+ 2
- 2
libavformat/avidec.c View File

@@ -504,7 +504,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
#endif #endif
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_tag = tag1; st->codec->codec_tag = tag1;
st->codec->codec_id = codec_get_id(codec_bmp_tags, tag1);
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1);
st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts. st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts.


if(st->codec->codec_tag==0 && st->codec->height > 0 && st->codec->extradata_size < 1U<<30){ if(st->codec->codec_tag==0 && st->codec->height > 0 && st->codec->extradata_size < 1U<<30){
@@ -518,7 +518,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
// url_fskip(pb, size - 5 * 4); // url_fskip(pb, size - 5 * 4);
break; break;
case CODEC_TYPE_AUDIO: case CODEC_TYPE_AUDIO:
get_wav_header(pb, st->codec, size);
ff_get_wav_header(pb, st->codec, size);
if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){ if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){
av_log(s, AV_LOG_WARNING, "sample size (%d) != block align (%d)\n", ast->sample_size, st->codec->block_align); av_log(s, AV_LOG_WARNING, "sample size (%d) != block align (%d)\n", ast->sample_size, st->codec->block_align);
ast->sample_size= st->codec->block_align; ast->sample_size= st->codec->block_align;


+ 31
- 31
libavformat/avienc.c View File

@@ -67,9 +67,9 @@ static int64_t avi_start_new_riff(AVIContext *avi, ByteIOContext *pb,
for (i=0; i<MAX_STREAMS; i++) for (i=0; i<MAX_STREAMS; i++)
avi->indexes[i].entry = 0; avi->indexes[i].entry = 0;


avi->riff_start = start_tag(pb, "RIFF");
avi->riff_start = ff_start_tag(pb, "RIFF");
put_tag(pb, riff_tag); put_tag(pb, riff_tag);
loff = start_tag(pb, "LIST");
loff = ff_start_tag(pb, "LIST");
put_tag(pb, list_tag); put_tag(pb, list_tag);
return loff; return loff;
} }
@@ -204,13 +204,13 @@ static int avi_write_header(AVFormatContext *s)


/* stream list */ /* stream list */
for(i=0;i<n;i++) { for(i=0;i<n;i++) {
list2 = start_tag(pb, "LIST");
list2 = ff_start_tag(pb, "LIST");
put_tag(pb, "strl"); put_tag(pb, "strl");


stream = s->streams[i]->codec; stream = s->streams[i]->codec;


/* stream generic header */ /* stream generic header */
strh = start_tag(pb, "strh");
strh = ff_start_tag(pb, "strh");
switch(stream->codec_type) { switch(stream->codec_type) {
case CODEC_TYPE_SUBTITLE: case CODEC_TYPE_SUBTITLE:
// XSUB subtitles behave like video tracks, other subtitles // XSUB subtitles behave like video tracks, other subtitles
@@ -256,27 +256,27 @@ static int avi_write_header(AVFormatContext *s)
put_le32(pb, 0); put_le32(pb, 0);
put_le16(pb, stream->width); put_le16(pb, stream->width);
put_le16(pb, stream->height); put_le16(pb, stream->height);
end_tag(pb, strh);
ff_end_tag(pb, strh);


if(stream->codec_type != CODEC_TYPE_DATA){ if(stream->codec_type != CODEC_TYPE_DATA){
strf = start_tag(pb, "strf");
strf = ff_start_tag(pb, "strf");
switch(stream->codec_type) { switch(stream->codec_type) {
case CODEC_TYPE_SUBTITLE: case CODEC_TYPE_SUBTITLE:
// XSUB subtitles behave like video tracks, other subtitles // XSUB subtitles behave like video tracks, other subtitles
// are not (yet) supported. // are not (yet) supported.
if (stream->codec_id != CODEC_ID_XSUB) break; if (stream->codec_id != CODEC_ID_XSUB) break;
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
put_bmp_header(pb, stream, codec_bmp_tags, 0);
ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0);
break; break;
case CODEC_TYPE_AUDIO: case CODEC_TYPE_AUDIO:
if (put_wav_header(pb, stream) < 0) {
if (ff_put_wav_header(pb, stream) < 0) {
return -1; return -1;
} }
break; break;
default: default:
return -1; return -1;
} }
end_tag(pb, strf);
ff_end_tag(pb, strf);
} }


if (!url_is_streamed(pb)) { if (!url_is_streamed(pb)) {
@@ -289,7 +289,7 @@ static int avi_write_header(AVFormatContext *s)
* for compatibility reasons. * for compatibility reasons.
*/ */
avi->indexes[i].entry = avi->indexes[i].ents_allocated = 0; avi->indexes[i].entry = avi->indexes[i].ents_allocated = 0;
avi->indexes[i].indx_start = start_tag(pb, "JUNK");
avi->indexes[i].indx_start = ff_start_tag(pb, "JUNK");
put_le16(pb, 4); /* wLongsPerEntry */ put_le16(pb, 4); /* wLongsPerEntry */
put_byte(pb, 0); /* bIndexSubType (0 == frame index) */ put_byte(pb, 0); /* bIndexSubType (0 == frame index) */
put_byte(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */ put_byte(pb, 0); /* bIndexType (0 == AVI_INDEX_OF_INDEXES) */
@@ -300,13 +300,13 @@ static int avi_write_header(AVFormatContext *s)
put_le32(pb, 0); Must be 0. */ put_le32(pb, 0); Must be 0. */
for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++) for (j=0; j < AVI_MASTER_INDEX_SIZE * 2; j++)
put_le64(pb, 0); put_le64(pb, 0);
end_tag(pb, avi->indexes[i].indx_start);
ff_end_tag(pb, avi->indexes[i].indx_start);
} }


if( stream->codec_type == CODEC_TYPE_VIDEO if( stream->codec_type == CODEC_TYPE_VIDEO
&& s->streams[i]->sample_aspect_ratio.num>0 && s->streams[i]->sample_aspect_ratio.num>0
&& s->streams[i]->sample_aspect_ratio.den>0){ && s->streams[i]->sample_aspect_ratio.den>0){
int vprp= start_tag(pb, "vprp");
int vprp= ff_start_tag(pb, "vprp");
AVRational dar = av_mul_q(s->streams[i]->sample_aspect_ratio, AVRational dar = av_mul_q(s->streams[i]->sample_aspect_ratio,
(AVRational){stream->width, stream->height}); (AVRational){stream->width, stream->height});
int num, den; int num, den;
@@ -332,26 +332,26 @@ static int avi_write_header(AVFormatContext *s)


put_le32(pb, 0); put_le32(pb, 0);
put_le32(pb, 0); put_le32(pb, 0);
end_tag(pb, vprp);
ff_end_tag(pb, vprp);
} }


end_tag(pb, list2);
ff_end_tag(pb, list2);
} }


if (!url_is_streamed(pb)) { if (!url_is_streamed(pb)) {
/* AVI could become an OpenDML one, if it grows beyond 2Gb range */ /* AVI could become an OpenDML one, if it grows beyond 2Gb range */
avi->odml_list = start_tag(pb, "JUNK");
avi->odml_list = ff_start_tag(pb, "JUNK");
put_tag(pb, "odml"); put_tag(pb, "odml");
put_tag(pb, "dmlh"); put_tag(pb, "dmlh");
put_le32(pb, 248); put_le32(pb, 248);
for (i = 0; i < 248; i+= 4) for (i = 0; i < 248; i+= 4)
put_le32(pb, 0); put_le32(pb, 0);
end_tag(pb, avi->odml_list);
ff_end_tag(pb, avi->odml_list);
} }


end_tag(pb, list1);
ff_end_tag(pb, list1);


list2 = start_tag(pb, "LIST");
list2 = ff_start_tag(pb, "LIST");
put_tag(pb, "INFO"); put_tag(pb, "INFO");
avi_write_info_tag2(s, "INAM", "Title", NULL); avi_write_info_tag2(s, "INAM", "Title", NULL);
avi_write_info_tag2(s, "IART", "Artist", "Author"); avi_write_info_tag2(s, "IART", "Artist", "Author");
@@ -362,15 +362,15 @@ static int avi_write_header(AVFormatContext *s)
avi_write_info_tag2(s, "IPRT", "Track", NULL); avi_write_info_tag2(s, "IPRT", "Track", NULL);
if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) if(!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT))
avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT); avi_write_info_tag(pb, "ISFT", LIBAVFORMAT_IDENT);
end_tag(pb, list2);
ff_end_tag(pb, list2);


/* some padding for easier tag editing */ /* some padding for easier tag editing */
list2 = start_tag(pb, "JUNK");
list2 = ff_start_tag(pb, "JUNK");
for (i = 0; i < 1016; i += 4) for (i = 0; i < 1016; i += 4)
put_le32(pb, 0); put_le32(pb, 0);
end_tag(pb, list2);
ff_end_tag(pb, list2);


avi->movi_list = start_tag(pb, "LIST");
avi->movi_list = ff_start_tag(pb, "LIST");
put_tag(pb, "movi"); put_tag(pb, "movi");


put_flush_packet(pb); put_flush_packet(pb);
@@ -448,7 +448,7 @@ static int avi_write_idx1(AVFormatContext *s)
int entry[MAX_STREAMS]; int entry[MAX_STREAMS];
int empty, stream_id = -1; int empty, stream_id = -1;


idx_chunk = start_tag(pb, "idx1");
idx_chunk = ff_start_tag(pb, "idx1");
memset(&entry[0], 0, sizeof(entry)); memset(&entry[0], 0, sizeof(entry));
do { do {
empty = 1; empty = 1;
@@ -473,7 +473,7 @@ static int avi_write_idx1(AVFormatContext *s)
entry[stream_id]++; entry[stream_id]++;
} }
} while (!empty); } while (!empty);
end_tag(pb, idx_chunk);
ff_end_tag(pb, idx_chunk);


avi_write_counters(s, avi->riff_id); avi_write_counters(s, avi->riff_id);
} }
@@ -508,12 +508,12 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
(url_ftell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) { (url_ftell(pb) - avi->riff_start > AVI_MAX_RIFF_SIZE)) {


avi_write_ix(s); avi_write_ix(s);
end_tag(pb, avi->movi_list);
ff_end_tag(pb, avi->movi_list);


if (avi->riff_id == 1) if (avi->riff_id == 1)
avi_write_idx1(s); avi_write_idx1(s);


end_tag(pb, avi->riff_start);
ff_end_tag(pb, avi->riff_start);
avi->movi_list = avi_start_new_riff(avi, pb, "AVIX", "movi"); avi->movi_list = avi_start_new_riff(avi, pb, "AVIX", "movi");
} }


@@ -564,13 +564,13 @@ static int avi_write_trailer(AVFormatContext *s)


if (!url_is_streamed(pb)){ if (!url_is_streamed(pb)){
if (avi->riff_id == 1) { if (avi->riff_id == 1) {
end_tag(pb, avi->movi_list);
ff_end_tag(pb, avi->movi_list);
res = avi_write_idx1(s); res = avi_write_idx1(s);
end_tag(pb, avi->riff_start);
ff_end_tag(pb, avi->riff_start);
} else { } else {
avi_write_ix(s); avi_write_ix(s);
end_tag(pb, avi->movi_list);
end_tag(pb, avi->riff_start);
ff_end_tag(pb, avi->movi_list);
ff_end_tag(pb, avi->riff_start);


file_size = url_ftell(pb); file_size = url_ftell(pb);
url_fseek(pb, avi->odml_list - 8, SEEK_SET); url_fseek(pb, avi->odml_list - 8, SEEK_SET);
@@ -617,6 +617,6 @@ AVOutputFormat avi_muxer = {
avi_write_header, avi_write_header,
avi_write_packet, avi_write_packet,
avi_write_trailer, avi_write_trailer,
.codec_tag= (const AVCodecTag* const []){codec_bmp_tags, codec_wav_tags, 0},
.codec_tag= (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, 0},
.flags= AVFMT_VARIABLE_FPS, .flags= AVFMT_VARIABLE_FPS,
}; };

+ 2
- 2
libavformat/avisynth.c View File

@@ -97,7 +97,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
stream->chunck_size = stream->chunck_samples * wvfmt.nChannels * wvfmt.wBitsPerSample / 8; stream->chunck_size = stream->chunck_samples * wvfmt.nChannels * wvfmt.wBitsPerSample / 8;


st->codec->codec_tag = wvfmt.wFormatTag; st->codec->codec_tag = wvfmt.wFormatTag;
st->codec->codec_id = wav_codec_get_id(wvfmt.wFormatTag, st->codec->bits_per_coded_sample);
st->codec->codec_id = ff_wav_codec_get_id(wvfmt.wFormatTag, st->codec->bits_per_coded_sample);
} }
else if (stream->info.fccType == streamtypeVIDEO) else if (stream->info.fccType == streamtypeVIDEO)
{ {
@@ -121,7 +121,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->bits_per_coded_sample = imgfmt.bmiHeader.biBitCount; st->codec->bits_per_coded_sample = imgfmt.bmiHeader.biBitCount;
st->codec->bit_rate = (uint64_t)stream->info.dwSampleSize * (uint64_t)stream->info.dwRate * 8 / (uint64_t)stream->info.dwScale; st->codec->bit_rate = (uint64_t)stream->info.dwSampleSize * (uint64_t)stream->info.dwRate * 8 / (uint64_t)stream->info.dwScale;
st->codec->codec_tag = imgfmt.bmiHeader.biCompression; st->codec->codec_tag = imgfmt.bmiHeader.biCompression;
st->codec->codec_id = codec_get_id(codec_bmp_tags, imgfmt.bmiHeader.biCompression);
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, imgfmt.bmiHeader.biCompression);


st->duration = stream->info.dwLength; st->duration = stream->info.dwLength;
} }


+ 1
- 1
libavformat/dxa.c View File

@@ -96,7 +96,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
ast = av_new_stream(s, 0); ast = av_new_stream(s, 0);
if (!ast) if (!ast)
return -1; return -1;
get_wav_header(pb, ast->codec, fsize);
ff_get_wav_header(pb, ast->codec, fsize);
// find 'data' chunk // find 'data' chunk
while(url_ftell(pb) < c->vidpos && !url_feof(pb)){ while(url_ftell(pb) < c->vidpos && !url_feof(pb)){
tag = get_le32(pb); tag = get_le32(pb);


+ 1
- 1
libavformat/gxfenc.c View File

@@ -643,7 +643,7 @@ static int gxf_write_header(AVFormatContext *s)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
st->priv_data = sc; st->priv_data = sc;


sc->media_type = codec_get_tag(gxf_media_types, st->codec->codec_id);
sc->media_type = ff_codec_get_tag(gxf_media_types, st->codec->codec_id);
if (st->codec->codec_type == CODEC_TYPE_AUDIO) { if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
if (st->codec->codec_id != CODEC_ID_PCM_S16LE) { if (st->codec->codec_id != CODEC_ID_PCM_S16LE) {
av_log(s, AV_LOG_ERROR, "only 16 BIT PCM LE allowed for now\n"); av_log(s, AV_LOG_ERROR, "only 16 BIT PCM LE allowed for now\n");


+ 6
- 6
libavformat/libnut.c View File

@@ -80,11 +80,11 @@ static int nut_write_header(AVFormatContext * avf) {
s[i].type = codec->codec_type == CODEC_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS; s[i].type = codec->codec_type == CODEC_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS;


if (codec->codec_tag) fourcc = codec->codec_tag; if (codec->codec_tag) fourcc = codec->codec_tag;
else fourcc = codec_get_tag(nut_tags, codec->codec_id);
else fourcc = ff_codec_get_tag(nut_tags, codec->codec_id);


if (!fourcc) { if (!fourcc) {
if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = codec_get_tag(codec_bmp_tags, codec->codec_id);
if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = codec_get_tag(codec_wav_tags, codec->codec_id);
if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
} }


s[i].fourcc_len = 4; s[i].fourcc_len = 4;
@@ -230,19 +230,19 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
st->start_time = 0; st->start_time = 0;
st->duration = s[i].max_pts; st->duration = s[i].max_pts;


st->codec->codec_id = codec_get_id(nut_tags, st->codec->codec_tag);
st->codec->codec_id = ff_codec_get_id(nut_tags, st->codec->codec_tag);


switch(s[i].type) { switch(s[i].type) {
case NUT_AUDIO_CLASS: case NUT_AUDIO_CLASS:
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_type = CODEC_TYPE_AUDIO;
if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_id(codec_wav_tags, st->codec->codec_tag);
if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, st->codec->codec_tag);


st->codec->channels = s[i].channel_count; st->codec->channels = s[i].channel_count;
st->codec->sample_rate = s[i].samplerate_num / s[i].samplerate_denom; st->codec->sample_rate = s[i].samplerate_num / s[i].samplerate_denom;
break; break;
case NUT_VIDEO_CLASS: case NUT_VIDEO_CLASS:
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_id(codec_bmp_tags, st->codec->codec_tag);
if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, st->codec->codec_tag);


st->codec->width = s[i].width; st->codec->width = s[i].width;
st->codec->height = s[i].height; st->codec->height = s[i].height;


+ 4
- 4
libavformat/matroskadec.c View File

@@ -30,7 +30,7 @@


#include <stdio.h> #include <stdio.h>
#include "avformat.h" #include "avformat.h"
/* For codec_get_id(). */
/* For ff_codec_get_id(). */
#include "riff.h" #include "riff.h"
#include "isom.h" #include "isom.h"
#include "matroska.h" #include "matroska.h"
@@ -1243,13 +1243,13 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
&& track->codec_priv.size >= 40 && track->codec_priv.size >= 40
&& track->codec_priv.data != NULL) { && track->codec_priv.data != NULL) {
track->video.fourcc = AV_RL32(track->codec_priv.data + 16); track->video.fourcc = AV_RL32(track->codec_priv.data + 16);
codec_id = codec_get_id(codec_bmp_tags, track->video.fourcc);
codec_id = ff_codec_get_id(ff_codec_bmp_tags, track->video.fourcc);
} else if (!strcmp(track->codec_id, "A_MS/ACM") } else if (!strcmp(track->codec_id, "A_MS/ACM")
&& track->codec_priv.size >= 18 && track->codec_priv.size >= 18
&& track->codec_priv.data != NULL) { && track->codec_priv.data != NULL) {
init_put_byte(&b, track->codec_priv.data, track->codec_priv.size, init_put_byte(&b, track->codec_priv.data, track->codec_priv.size,
URL_RDONLY, NULL, NULL, NULL, NULL); URL_RDONLY, NULL, NULL, NULL, NULL);
get_wav_header(&b, st->codec, track->codec_priv.size);
ff_get_wav_header(&b, st->codec, track->codec_priv.size);
codec_id = st->codec->codec_id; codec_id = st->codec->codec_id;
extradata_offset = 18; extradata_offset = 18;
track->codec_priv.size -= extradata_offset; track->codec_priv.size -= extradata_offset;
@@ -1257,7 +1257,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
&& (track->codec_priv.size >= 86) && (track->codec_priv.size >= 86)
&& (track->codec_priv.data != NULL)) { && (track->codec_priv.data != NULL)) {
track->video.fourcc = AV_RL32(track->codec_priv.data); track->video.fourcc = AV_RL32(track->codec_priv.data);
codec_id=codec_get_id(codec_movvideo_tags, track->video.fourcc);
codec_id=ff_codec_get_id(codec_movvideo_tags, track->video.fourcc);
} else if (codec_id == CODEC_ID_PCM_S16BE) { } else if (codec_id == CODEC_ID_PCM_S16BE) {
switch (track->audio.bitdepth) { switch (track->audio.bitdepth) {
case 8: codec_id = CODEC_ID_PCM_U8; break; case 8: codec_id = CODEC_ID_PCM_U8; break;


+ 9
- 9
libavformat/matroskaenc.c View File

@@ -470,29 +470,29 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec
} else if (codec->codec_type == CODEC_TYPE_VIDEO) { } else if (codec->codec_type == CODEC_TYPE_VIDEO) {
if (qt_id) { if (qt_id) {
if (!codec->codec_tag) if (!codec->codec_tag)
codec->codec_tag = codec_get_tag(codec_movvideo_tags, codec->codec_id);
codec->codec_tag = ff_codec_get_tag(codec_movvideo_tags, codec->codec_id);
if (codec->extradata_size) if (codec->extradata_size)
put_buffer(dyn_cp, codec->extradata, codec->extradata_size); put_buffer(dyn_cp, codec->extradata, codec->extradata_size);
} else { } else {
if (!codec->codec_tag) if (!codec->codec_tag)
codec->codec_tag = codec_get_tag(codec_bmp_tags, codec->codec_id);
codec->codec_tag = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
if (!codec->codec_tag) { if (!codec->codec_tag) {
av_log(s, AV_LOG_ERROR, "No bmp codec ID found."); av_log(s, AV_LOG_ERROR, "No bmp codec ID found.");
ret = -1; ret = -1;
} }


put_bmp_header(dyn_cp, codec, codec_bmp_tags, 0);
ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0);
} }


} else if (codec->codec_type == CODEC_TYPE_AUDIO) { } else if (codec->codec_type == CODEC_TYPE_AUDIO) {
if (!codec->codec_tag) if (!codec->codec_tag)
codec->codec_tag = codec_get_tag(codec_wav_tags, codec->codec_id);
codec->codec_tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
if (!codec->codec_tag) { if (!codec->codec_tag) {
av_log(s, AV_LOG_ERROR, "No wav codec ID found."); av_log(s, AV_LOG_ERROR, "No wav codec ID found.");
ret = -1; ret = -1;
} }


put_wav_header(dyn_cp, codec);
ff_put_wav_header(dyn_cp, codec);
} }


codecpriv_size = url_close_dyn_buf(dyn_cp, &codecpriv); codecpriv_size = url_close_dyn_buf(dyn_cp, &codecpriv);
@@ -558,8 +558,8 @@ static int mkv_write_tracks(AVFormatContext *s)
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO); put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO);


if (!native_id && if (!native_id &&
codec_get_tag(codec_movvideo_tags, codec->codec_id) &&
(!codec_get_tag(codec_bmp_tags, codec->codec_id)
ff_codec_get_tag(codec_movvideo_tags, codec->codec_id) &&
(!ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id)
|| codec->codec_id == CODEC_ID_SVQ1 || codec->codec_id == CODEC_ID_SVQ1
|| codec->codec_id == CODEC_ID_SVQ3 || codec->codec_id == CODEC_ID_SVQ3
|| codec->codec_id == CODEC_ID_CINEPAK)) || codec->codec_id == CODEC_ID_CINEPAK))
@@ -889,7 +889,7 @@ AVOutputFormat matroska_muxer = {
mkv_write_packet, mkv_write_packet,
mkv_write_trailer, mkv_write_trailer,
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
.codec_tag = (const AVCodecTag* const []){codec_bmp_tags, codec_wav_tags, 0},
.codec_tag = (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, 0},
.subtitle_codec = CODEC_ID_TEXT, .subtitle_codec = CODEC_ID_TEXT,
}; };


@@ -905,5 +905,5 @@ AVOutputFormat matroska_audio_muxer = {
mkv_write_packet, mkv_write_packet,
mkv_write_trailer, mkv_write_trailer,
.flags = AVFMT_GLOBALHEADER, .flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){codec_wav_tags, 0},
.codec_tag = (const AVCodecTag* const []){ff_codec_wav_tags, 0},
}; };

+ 2
- 2
libavformat/mmf.c View File

@@ -72,7 +72,7 @@ static int mmf_write_header(AVFormatContext *s)


put_tag(pb, "MMMD"); put_tag(pb, "MMMD");
put_be32(pb, 0); put_be32(pb, 0);
pos = start_tag(pb, "CNTI");
pos = ff_start_tag(pb, "CNTI");
put_byte(pb, 0); /* class */ put_byte(pb, 0); /* class */
put_byte(pb, 0); /* type */ put_byte(pb, 0); /* type */
put_byte(pb, 0); /* code type */ put_byte(pb, 0); /* code type */
@@ -97,7 +97,7 @@ static int mmf_write_header(AVFormatContext *s)
/* Will be filled on close */ /* Will be filled on close */
put_buffer(pb, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16); put_buffer(pb, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16);


mmf->awapos = start_tag(pb, "Awa\x01");
mmf->awapos = ff_start_tag(pb, "Awa\x01");


av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate); av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);




+ 9
- 9
libavformat/mov.c View File

@@ -409,7 +409,7 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_be32(pb); /* max bitrate */ get_be32(pb); /* max bitrate */
get_be32(pb); /* avg bitrate */ get_be32(pb); /* avg bitrate */


st->codec->codec_id= codec_get_id(ff_mp4_obj_type, object_type_id);
st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
dprintf(c->fc, "esds object type id %d\n", object_type_id); dprintf(c->fc, "esds object type id %d\n", object_type_id);
len = mp4_read_descr(c, pb, &tag); len = mp4_read_descr(c, pb, &tag);
if (tag == MP4DecSpecificDescrTag) { if (tag == MP4DecSpecificDescrTag) {
@@ -436,8 +436,8 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
"sample rate %d ext sample rate %d\n", st->codec->channels, "sample rate %d ext sample rate %d\n", st->codec->channels,
cfg.object_type, cfg.ext_object_type, cfg.object_type, cfg.ext_object_type,
cfg.sample_rate, cfg.ext_sample_rate); cfg.sample_rate, cfg.ext_sample_rate);
if (!(st->codec->codec_id = codec_get_id(mp4_audio_types,
cfg.object_type)))
if (!(st->codec->codec_id = ff_codec_get_id(mp4_audio_types,
cfg.object_type)))
st->codec->codec_id = CODEC_ID_AAC; st->codec->codec_id = CODEC_ID_AAC;
} }
} }
@@ -777,7 +777,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)


if (st->codec->codec_tag && if (st->codec->codec_tag &&
st->codec->codec_tag != format && st->codec->codec_tag != format &&
(c->fc->video_codec_id ? codec_get_id(codec_movvideo_tags, format) != c->fc->video_codec_id
(c->fc->video_codec_id ? ff_codec_get_id(codec_movvideo_tags, format) != c->fc->video_codec_id
: st->codec->codec_tag != MKTAG('j','p','e','g')) : st->codec->codec_tag != MKTAG('j','p','e','g'))
){ ){
/* Multiple fourcc, we skip JPEG. This is not correct, we should /* Multiple fourcc, we skip JPEG. This is not correct, we should
@@ -791,21 +791,21 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
sc->dref_id= dref_id; sc->dref_id= dref_id;


st->codec->codec_tag = format; st->codec->codec_tag = format;
id = codec_get_id(codec_movaudio_tags, format);
id = ff_codec_get_id(codec_movaudio_tags, format);
if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8))) if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8)))
id = codec_get_id(codec_wav_tags, bswap_32(format)&0xFFFF);
id = ff_codec_get_id(ff_codec_wav_tags, bswap_32(format)&0xFFFF);


if (st->codec->codec_type != CODEC_TYPE_VIDEO && id > 0) { if (st->codec->codec_type != CODEC_TYPE_VIDEO && id > 0) {
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_type = CODEC_TYPE_AUDIO;
} else if (st->codec->codec_type != CODEC_TYPE_AUDIO && /* do not overwrite codec type */ } else if (st->codec->codec_type != CODEC_TYPE_AUDIO && /* do not overwrite codec type */
format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */ format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */
id = codec_get_id(codec_movvideo_tags, format);
id = ff_codec_get_id(codec_movvideo_tags, format);
if (id <= 0) if (id <= 0)
id = codec_get_id(codec_bmp_tags, format);
id = ff_codec_get_id(ff_codec_bmp_tags, format);
if (id > 0) if (id > 0)
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
else if(st->codec->codec_type == CODEC_TYPE_DATA){ else if(st->codec->codec_type == CODEC_TYPE_DATA){
id = codec_get_id(ff_codec_movsubtitle_tags, format);
id = ff_codec_get_id(ff_codec_movsubtitle_tags, format);
if(id > 0) if(id > 0)
st->codec->codec_type = CODEC_TYPE_SUBTITLE; st->codec->codec_type = CODEC_TYPE_SUBTITLE;
} }


+ 9
- 9
libavformat/movenc.c View File

@@ -330,7 +330,7 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic
track->enc->sample_rate > 24000) track->enc->sample_rate > 24000)
put_byte(pb, 0x6B); // 11172-3 put_byte(pb, 0x6B); // 11172-3
else else
put_byte(pb, codec_get_tag(ff_mp4_obj_type, track->enc->codec_id));
put_byte(pb, ff_codec_get_tag(ff_mp4_obj_type, track->enc->codec_id));


// the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio) // the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio)
// plus 1 bit to indicate upstream and 1 bit set to 1 (reserved) // plus 1 bit to indicate upstream and 1 bit set to 1 (reserved)
@@ -555,7 +555,7 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track)
{ {
int tag = track->enc->codec_tag; int tag = track->enc->codec_tag;


if (!codec_get_tag(ff_mp4_obj_type, track->enc->codec_id))
if (!ff_codec_get_tag(ff_mp4_obj_type, track->enc->codec_id))
return 0; return 0;


if (track->enc->codec_id == CODEC_ID_H264) tag = MKTAG('a','v','c','1'); if (track->enc->codec_id == CODEC_ID_H264) tag = MKTAG('a','v','c','1');
@@ -587,7 +587,7 @@ static int ipod_get_codec_tag(AVFormatContext *s, MOVTrack *track)
if (!(track->enc->codec_type == CODEC_TYPE_SUBTITLE && if (!(track->enc->codec_type == CODEC_TYPE_SUBTITLE &&
(tag == MKTAG('t','x','3','g') || (tag == MKTAG('t','x','3','g') ||
tag == MKTAG('t','e','x','t')))) tag == MKTAG('t','e','x','t'))))
tag = codec_get_tag(codec_ipod_tags, track->enc->codec_id);
tag = ff_codec_get_tag(codec_ipod_tags, track->enc->codec_id);


if (!match_ext(s->filename, "m4a") && !match_ext(s->filename, "m4v")) if (!match_ext(s->filename, "m4a") && !match_ext(s->filename, "m4v"))
av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v " av_log(s, AV_LOG_WARNING, "Warning, extension is not .m4a nor .m4v "
@@ -657,17 +657,17 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
else if (track->enc->codec_id == CODEC_ID_RAWVIDEO) else if (track->enc->codec_id == CODEC_ID_RAWVIDEO)
tag = mov_get_rawvideo_codec_tag(s, track); tag = mov_get_rawvideo_codec_tag(s, track);
else if (track->enc->codec_type == CODEC_TYPE_VIDEO) { else if (track->enc->codec_type == CODEC_TYPE_VIDEO) {
tag = codec_get_tag(codec_movvideo_tags, track->enc->codec_id);
tag = ff_codec_get_tag(codec_movvideo_tags, track->enc->codec_id);
if (!tag) { // if no mac fcc found, try with Microsoft tags if (!tag) { // if no mac fcc found, try with Microsoft tags
tag = codec_get_tag(codec_bmp_tags, track->enc->codec_id);
tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id);
if (tag) if (tag)
av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, " av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, "
"the file may be unplayable!\n"); "the file may be unplayable!\n");
} }
} else if (track->enc->codec_type == CODEC_TYPE_AUDIO) { } else if (track->enc->codec_type == CODEC_TYPE_AUDIO) {
tag = codec_get_tag(codec_movaudio_tags, track->enc->codec_id);
tag = ff_codec_get_tag(codec_movaudio_tags, track->enc->codec_id);
if (!tag) { // if no mac fcc found, try with Microsoft tags if (!tag) { // if no mac fcc found, try with Microsoft tags
int ms_tag = codec_get_tag(codec_wav_tags, track->enc->codec_id);
int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id);
if (ms_tag) { if (ms_tag) {
tag = MKTAG('m', 's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff)); tag = MKTAG('m', 's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));
av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, " av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, "
@@ -675,7 +675,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)
} }
} }
} else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE)
tag = codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id);
tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id);
} }


return tag; return tag;
@@ -701,7 +701,7 @@ static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track)
else if (track->mode == MODE_IPOD) else if (track->mode == MODE_IPOD)
tag = ipod_get_codec_tag(s, track); tag = ipod_get_codec_tag(s, track);
else if (track->mode & MODE_3GP) else if (track->mode & MODE_3GP)
tag = codec_get_tag(codec_3gp_tags, track->enc->codec_id);
tag = ff_codec_get_tag(codec_3gp_tags, track->enc->codec_id);
else else
tag = mov_get_codec_tag(s, track); tag = mov_get_codec_tag(s, track);




+ 2
- 2
libavformat/nsvdec.c View File

@@ -458,7 +458,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap)
st->priv_data = nst; st->priv_data = nst;
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_tag = vtag; st->codec->codec_tag = vtag;
st->codec->codec_id = codec_get_id(nsv_codec_video_tags, vtag);
st->codec->codec_id = ff_codec_get_id(nsv_codec_video_tags, vtag);
st->codec->width = vwidth; st->codec->width = vwidth;
st->codec->height = vheight; st->codec->height = vheight;
st->codec->bits_per_coded_sample = 24; /* depth XXX */ st->codec->bits_per_coded_sample = 24; /* depth XXX */
@@ -489,7 +489,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap)
st->priv_data = nst; st->priv_data = nst;
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_tag = atag; st->codec->codec_tag = atag;
st->codec->codec_id = codec_get_id(nsv_codec_audio_tags, atag);
st->codec->codec_id = ff_codec_get_id(nsv_codec_audio_tags, atag);


st->need_parsing = AVSTREAM_PARSE_FULL; /* for PCM we will read a chunk later and put correct info */ st->need_parsing = AVSTREAM_PARSE_FULL; /* for PCM we will read a chunk later and put correct info */




+ 3
- 3
libavformat/nutdec.c View File

@@ -316,15 +316,15 @@ static int decode_stream_header(NUTContext *nut){
{ {
case 0: case 0:
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = codec_get_id(codec_bmp_tags, tmp);
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tmp);
break; break;
case 1: case 1:
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = codec_get_id(codec_wav_tags, tmp);
st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp);
break; break;
case 2: case 2:
st->codec->codec_type = CODEC_TYPE_SUBTITLE; st->codec->codec_type = CODEC_TYPE_SUBTITLE;
st->codec->codec_id = codec_get_id(ff_nut_subtitle_tags, tmp);
st->codec->codec_id = ff_codec_get_id(ff_nut_subtitle_tags, tmp);
break; break;
case 3: case 3:
st->codec->codec_type = CODEC_TYPE_DATA; st->codec->codec_type = CODEC_TYPE_DATA;


+ 1
- 1
libavformat/nutenc.c View File

@@ -826,5 +826,5 @@ AVOutputFormat nut_muxer = {
write_packet, write_packet,
write_trailer, write_trailer,
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
.codec_tag= (const AVCodecTag* const []){codec_bmp_tags, codec_wav_tags, ff_nut_subtitle_tags, 0},
.codec_tag= (const AVCodecTag* const []){ff_codec_bmp_tags, ff_codec_wav_tags, ff_nut_subtitle_tags, 0},
}; };

+ 2
- 2
libavformat/nuv.c View File

@@ -86,7 +86,7 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst,
if (vst) { if (vst) {
vst->codec->codec_tag = get_le32(pb); vst->codec->codec_tag = get_le32(pb);
vst->codec->codec_id = vst->codec->codec_id =
codec_get_id(codec_bmp_tags, vst->codec->codec_tag);
ff_codec_get_id(ff_codec_bmp_tags, vst->codec->codec_tag);
if (vst->codec->codec_tag == MKTAG('R', 'J', 'P', 'G')) if (vst->codec->codec_tag == MKTAG('R', 'J', 'P', 'G'))
vst->codec->codec_id = CODEC_ID_NUV; vst->codec->codec_id = CODEC_ID_NUV;
} else } else
@@ -98,7 +98,7 @@ static int get_codec_data(ByteIOContext *pb, AVStream *vst,
ast->codec->bits_per_coded_sample = get_le32(pb); ast->codec->bits_per_coded_sample = get_le32(pb);
ast->codec->channels = get_le32(pb); ast->codec->channels = get_le32(pb);
ast->codec->codec_id = ast->codec->codec_id =
wav_codec_get_id(ast->codec->codec_tag,
ff_wav_codec_get_id(ast->codec->codec_tag,
ast->codec->bits_per_coded_sample); ast->codec->bits_per_coded_sample);
ast->need_parsing = AVSTREAM_PARSE_FULL; ast->need_parsing = AVSTREAM_PARSE_FULL;
} else } else


+ 4
- 4
libavformat/oggparseogm.c View File

@@ -53,7 +53,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
p += 8; p += 8;
tag = bytestream_get_le32(&p); tag = bytestream_get_le32(&p);
st->codec->codec_id = codec_get_id(codec_bmp_tags, tag);
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag);
st->codec->codec_tag = tag; st->codec->codec_tag = tag;
} else if (*p == 't') { } else if (*p == 't') {
st->codec->codec_type = CODEC_TYPE_SUBTITLE; st->codec->codec_type = CODEC_TYPE_SUBTITLE;
@@ -67,7 +67,7 @@ ogm_header(AVFormatContext *s, int idx)
bytestream_get_buffer(&p, acid, 4); bytestream_get_buffer(&p, acid, 4);
acid[4] = 0; acid[4] = 0;
cid = strtol(acid, NULL, 16); cid = strtol(acid, NULL, 16);
st->codec->codec_id = codec_get_id(codec_wav_tags, cid);
st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, cid);
st->need_parsing = AVSTREAM_PARSE_FULL; st->need_parsing = AVSTREAM_PARSE_FULL;
} }


@@ -115,14 +115,14 @@ ogm_dshow_header(AVFormatContext *s, int idx)


if(t == 0x05589f80){ if(t == 0x05589f80){
st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = codec_get_id(codec_bmp_tags, AV_RL32(p + 68));
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68));
st->codec->time_base.den = 10000000; st->codec->time_base.den = 10000000;
st->codec->time_base.num = AV_RL64(p + 164); st->codec->time_base.num = AV_RL64(p + 164);
st->codec->width = AV_RL32(p + 176); st->codec->width = AV_RL32(p + 176);
st->codec->height = AV_RL32(p + 180); st->codec->height = AV_RL32(p + 180);
} else if(t == 0x05589f81){ } else if(t == 0x05589f81){
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_id = codec_get_id(codec_wav_tags, AV_RL16(p + 124));
st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, AV_RL16(p + 124));
st->codec->channels = AV_RL16(p + 126); st->codec->channels = AV_RL16(p + 126);
st->codec->sample_rate = AV_RL32(p + 128); st->codec->sample_rate = AV_RL32(p + 128);
st->codec->bit_rate = AV_RL32(p + 132) * 8; st->codec->bit_rate = AV_RL32(p + 132) * 8;


+ 1
- 1
libavformat/oma.c View File

@@ -109,7 +109,7 @@ static int oma_read_header(AVFormatContext *s,
st->start_time = 0; st->start_time = 0;
st->codec->codec_type = CODEC_TYPE_AUDIO; st->codec->codec_type = CODEC_TYPE_AUDIO;
st->codec->codec_tag = buf[32]; st->codec->codec_tag = buf[32];
st->codec->codec_id = codec_get_id(codec_oma_tags, st->codec->codec_tag);
st->codec->codec_id = ff_codec_get_id(codec_oma_tags, st->codec->codec_tag);


switch (buf[32]) { switch (buf[32]) {
case OMA_CODECID_ATRAC3: case OMA_CODECID_ATRAC3:


+ 10
- 10
libavformat/riff.c View File

@@ -26,7 +26,7 @@


/* Note: when encoding, the first matching tag is used, so order is /* Note: when encoding, the first matching tag is used, so order is
important if multiple tags possible for a given codec. */ important if multiple tags possible for a given codec. */
const AVCodecTag codec_bmp_tags[] = {
const AVCodecTag ff_codec_bmp_tags[] = {
{ CODEC_ID_H264, MKTAG('H', '2', '6', '4') }, { CODEC_ID_H264, MKTAG('H', '2', '6', '4') },
{ CODEC_ID_H264, MKTAG('h', '2', '6', '4') }, { CODEC_ID_H264, MKTAG('h', '2', '6', '4') },
{ CODEC_ID_H264, MKTAG('X', '2', '6', '4') }, { CODEC_ID_H264, MKTAG('X', '2', '6', '4') },
@@ -218,7 +218,7 @@ const AVCodecTag codec_bmp_tags[] = {
{ CODEC_ID_NONE, 0 } { CODEC_ID_NONE, 0 }
}; };


const AVCodecTag codec_wav_tags[] = {
const AVCodecTag ff_codec_wav_tags[] = {
{ CODEC_ID_PCM_S16LE, 0x0001 }, { CODEC_ID_PCM_S16LE, 0x0001 },
{ CODEC_ID_PCM_U8, 0x0001 }, /* must come after s16le in this list */ { CODEC_ID_PCM_U8, 0x0001 }, /* must come after s16le in this list */
{ CODEC_ID_PCM_S24LE, 0x0001 }, { CODEC_ID_PCM_S24LE, 0x0001 },
@@ -272,14 +272,14 @@ const AVCodecTag codec_wav_tags[] = {
}; };


#if CONFIG_MUXERS #if CONFIG_MUXERS
int64_t start_tag(ByteIOContext *pb, const char *tag)
int64_t ff_start_tag(ByteIOContext *pb, const char *tag)
{ {
put_tag(pb, tag); put_tag(pb, tag);
put_le32(pb, 0); put_le32(pb, 0);
return url_ftell(pb); return url_ftell(pb);
} }


void end_tag(ByteIOContext *pb, int64_t start)
void ff_end_tag(ByteIOContext *pb, int64_t start)
{ {
int64_t pos; int64_t pos;


@@ -291,7 +291,7 @@ void end_tag(ByteIOContext *pb, int64_t start)


/* WAVEFORMATEX header */ /* WAVEFORMATEX header */
/* returns the size or -1 on error */ /* returns the size or -1 on error */
int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
{ {
int bps, blkalign, bytespersec; int bps, blkalign, bytespersec;
int hdrsize = 18; int hdrsize = 18;
@@ -394,7 +394,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
} }


/* BITMAPINFOHEADER header */ /* BITMAPINFOHEADER header */
void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
void ff_put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf)
{ {
put_le32(pb, 40 + enc->extradata_size); /* size */ put_le32(pb, 40 + enc->extradata_size); /* size */
put_le32(pb, enc->width); put_le32(pb, enc->width);
@@ -426,7 +426,7 @@ void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *ta
* WAVEFORMATEX adds 'WORD cbSize' and basically makes itself * WAVEFORMATEX adds 'WORD cbSize' and basically makes itself
* an openended structure. * an openended structure.
*/ */
void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
void ff_get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
{ {
int id; int id;


@@ -464,14 +464,14 @@ void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size)
if (size > 0) if (size > 0)
url_fskip(pb, size); url_fskip(pb, size);
} }
codec->codec_id = wav_codec_get_id(id, codec->bits_per_coded_sample);
codec->codec_id = ff_wav_codec_get_id(id, codec->bits_per_coded_sample);
} }




enum CodecID wav_codec_get_id(unsigned int tag, int bps)
enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps)
{ {
enum CodecID id; enum CodecID id;
id = codec_get_id(codec_wav_tags, tag);
id = ff_codec_get_id(ff_codec_wav_tags, tag);
if (id <= 0) if (id <= 0)
return id; return id;
/* handle specific u8 codec */ /* handle specific u8 codec */


+ 10
- 10
libavformat/riff.h View File

@@ -31,24 +31,24 @@
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "avio.h" #include "avio.h"


int64_t start_tag(ByteIOContext *pb, const char *tag);
void end_tag(ByteIOContext *pb, int64_t start);
int64_t ff_start_tag(ByteIOContext *pb, const char *tag);
void ff_end_tag(ByteIOContext *pb, int64_t start);


typedef struct AVCodecTag { typedef struct AVCodecTag {
int id; int id;
unsigned int tag; unsigned int tag;
} AVCodecTag; } AVCodecTag;


void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
int put_wav_header(ByteIOContext *pb, AVCodecContext *enc);
enum CodecID wav_codec_get_id(unsigned int tag, int bps);
void get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size);
void ff_put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
int ff_put_wav_header(ByteIOContext *pb, AVCodecContext *enc);
enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps);
void ff_get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size);


extern const AVCodecTag codec_bmp_tags[];
extern const AVCodecTag codec_wav_tags[];
extern const AVCodecTag ff_codec_bmp_tags[];
extern const AVCodecTag ff_codec_wav_tags[];


unsigned int codec_get_tag(const AVCodecTag *tags, int id);
enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag);
unsigned int ff_codec_get_tag(const AVCodecTag *tags, int id);
enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag);
void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale); void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssize, int *au_scale);


#endif /* AVFORMAT_RIFF_H */ #endif /* AVFORMAT_RIFF_H */

+ 2
- 2
libavformat/swfdec.c View File

@@ -110,7 +110,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (!vst) if (!vst)
return -1; return -1;
vst->codec->codec_type = CODEC_TYPE_VIDEO; vst->codec->codec_type = CODEC_TYPE_VIDEO;
vst->codec->codec_id = codec_get_id(swf_codec_tags, get_byte(pb));
vst->codec->codec_id = ff_codec_get_id(swf_codec_tags, get_byte(pb));
av_set_pts_info(vst, 16, 256, swf->frame_rate); av_set_pts_info(vst, 16, 256, swf->frame_rate);
vst->codec->time_base = (AVRational){ 256, swf->frame_rate }; vst->codec->time_base = (AVRational){ 256, swf->frame_rate };
len -= 8; len -= 8;
@@ -132,7 +132,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
return -1; return -1;
ast->codec->channels = 1 + (v&1); ast->codec->channels = 1 + (v&1);
ast->codec->codec_type = CODEC_TYPE_AUDIO; ast->codec->codec_type = CODEC_TYPE_AUDIO;
ast->codec->codec_id = codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15);
ast->need_parsing = AVSTREAM_PARSE_FULL; ast->need_parsing = AVSTREAM_PARSE_FULL;
sample_rate_code= (v>>2) & 3; sample_rate_code= (v>>2) & 3;
if (!sample_rate_code) if (!sample_rate_code)


+ 1
- 1
libavformat/swfenc.c View File

@@ -351,7 +351,7 @@ static int swf_write_video(AVFormatContext *s,
put_le16(pb, enc->width); put_le16(pb, enc->width);
put_le16(pb, enc->height); put_le16(pb, enc->height);
put_byte(pb, 0); put_byte(pb, 0);
put_byte(pb,codec_get_tag(swf_codec_tags,enc->codec_id));
put_byte(pb,ff_codec_get_tag(swf_codec_tags,enc->codec_id));
put_swf_end_tag(s); put_swf_end_tag(s);


/* place the video object for the first time */ /* place the video object for the first time */


+ 4
- 4
libavformat/utils.c View File

@@ -1904,7 +1904,7 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt)
return ret; return ret;
} }


unsigned int codec_get_tag(const AVCodecTag *tags, int id)
unsigned int ff_codec_get_tag(const AVCodecTag *tags, int id)
{ {
while (tags->id != CODEC_ID_NONE) { while (tags->id != CODEC_ID_NONE) {
if (tags->id == id) if (tags->id == id)
@@ -1914,7 +1914,7 @@ unsigned int codec_get_tag(const AVCodecTag *tags, int id)
return 0; return 0;
} }


enum CodecID codec_get_id(const AVCodecTag *tags, unsigned int tag)
enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
{ {
int i; int i;
for(i=0; tags[i].id != CODEC_ID_NONE;i++) { for(i=0; tags[i].id != CODEC_ID_NONE;i++) {
@@ -1935,7 +1935,7 @@ unsigned int av_codec_get_tag(const AVCodecTag * const *tags, enum CodecID id)
{ {
int i; int i;
for(i=0; tags && tags[i]; i++){ for(i=0; tags && tags[i]; i++){
int tag= codec_get_tag(tags[i], id);
int tag= ff_codec_get_tag(tags[i], id);
if(tag) return tag; if(tag) return tag;
} }
return 0; return 0;
@@ -1945,7 +1945,7 @@ enum CodecID av_codec_get_id(const AVCodecTag * const *tags, unsigned int tag)
{ {
int i; int i;
for(i=0; tags && tags[i]; i++){ for(i=0; tags && tags[i]; i++){
enum CodecID id= codec_get_id(tags[i], tag);
enum CodecID id= ff_codec_get_id(tags[i], tag);
if(id!=CODEC_ID_NONE) return id; if(id!=CODEC_ID_NONE) return id;
} }
return CODEC_ID_NONE; return CODEC_ID_NONE;


+ 2
- 2
libavformat/vocdec.c View File

@@ -84,7 +84,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
if (sample_rate) if (sample_rate)
dec->sample_rate = sample_rate; dec->sample_rate = sample_rate;
dec->channels = channels; dec->channels = channels;
dec->codec_id = codec_get_id(ff_voc_codec_tags, get_byte(pb));
dec->codec_id = ff_codec_get_id(ff_voc_codec_tags, get_byte(pb));
dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id); dec->bits_per_coded_sample = av_get_bits_per_sample(dec->codec_id);
voc->remaining_size -= 2; voc->remaining_size -= 2;
max_size -= 2; max_size -= 2;
@@ -107,7 +107,7 @@ voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
dec->sample_rate = get_le32(pb); dec->sample_rate = get_le32(pb);
dec->bits_per_coded_sample = get_byte(pb); dec->bits_per_coded_sample = get_byte(pb);
dec->channels = get_byte(pb); dec->channels = get_byte(pb);
dec->codec_id = codec_get_id(ff_voc_codec_tags, get_le16(pb));
dec->codec_id = ff_codec_get_id(ff_voc_codec_tags, get_le16(pb));
url_fskip(pb, 4); url_fskip(pb, 4);
voc->remaining_size -= 12; voc->remaining_size -= 12;
max_size -= 12; max_size -= 12;


+ 10
- 10
libavformat/wav.c View File

@@ -42,20 +42,20 @@ static int wav_write_header(AVFormatContext *s)
put_tag(pb, "WAVE"); put_tag(pb, "WAVE");


/* format header */ /* format header */
fmt = start_tag(pb, "fmt ");
if (put_wav_header(pb, s->streams[0]->codec) < 0) {
fmt = ff_start_tag(pb, "fmt ");
if (ff_put_wav_header(pb, s->streams[0]->codec) < 0) {
av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n", av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n",
s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE"); s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
av_free(wav); av_free(wav);
return -1; return -1;
} }
end_tag(pb, fmt);
ff_end_tag(pb, fmt);


if(s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */ if(s->streams[0]->codec->codec_tag != 0x01 /* hence for all other than PCM */
&& !url_is_streamed(s->pb)) { && !url_is_streamed(s->pb)) {
fact = start_tag(pb, "fact");
fact = ff_start_tag(pb, "fact");
put_le32(pb, 0); put_le32(pb, 0);
end_tag(pb, fact);
ff_end_tag(pb, fact);
} }


av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate); av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
@@ -63,7 +63,7 @@ static int wav_write_header(AVFormatContext *s)
wav->minpts = INT64_MAX; wav->minpts = INT64_MAX;


/* data header */ /* data header */
wav->data = start_tag(pb, "data");
wav->data = ff_start_tag(pb, "data");


put_flush_packet(pb); put_flush_packet(pb);


@@ -91,7 +91,7 @@ static int wav_write_trailer(AVFormatContext *s)
int64_t file_size; int64_t file_size;


if (!url_is_streamed(s->pb)) { if (!url_is_streamed(s->pb)) {
end_tag(pb, wav->data);
ff_end_tag(pb, wav->data);


/* update file size */ /* update file size */
file_size = url_ftell(pb); file_size = url_ftell(pb);
@@ -182,7 +182,7 @@ static int wav_read_header(AVFormatContext *s,
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);


get_wav_header(pb, st->codec, size);
ff_get_wav_header(pb, st->codec, size);
st->need_parsing = AVSTREAM_PARSE_FULL; st->need_parsing = AVSTREAM_PARSE_FULL;


av_set_pts_info(st, 64, 1, st->codec->sample_rate); av_set_pts_info(st, 64, 1, st->codec->sample_rate);
@@ -264,7 +264,7 @@ AVInputFormat wav_demuxer = {
NULL, NULL,
wav_read_seek, wav_read_seek,
.flags= AVFMT_GENERIC_INDEX, .flags= AVFMT_GENERIC_INDEX,
.codec_tag= (const AVCodecTag* const []){codec_wav_tags, 0},
.codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
}; };
#endif #endif
#if CONFIG_WAV_MUXER #if CONFIG_WAV_MUXER
@@ -279,6 +279,6 @@ AVOutputFormat wav_muxer = {
wav_write_header, wav_write_header,
wav_write_packet, wav_write_packet,
wav_write_trailer, wav_write_trailer,
.codec_tag= (const AVCodecTag* const []){codec_wav_tags, 0},
.codec_tag= (const AVCodecTag* const []){ff_codec_wav_tags, 0},
}; };
#endif #endif

Loading…
Cancel
Save