aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-07 22:45:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-07 22:45:46 +0200
commit7a72695c05f12f21a62dc99fa64d1726fc11b236 (patch)
treee8f1a2813c4cd1fd8bd0ac5f764c7fd676ab85af /libavformat/mov.c
parent49440853d0c1e740daee0e2df1e65d5e67b1ad6b (diff)
parent36ef5369ee9b336febc2c270f8718cec4476cb85 (diff)
downloadffmpeg-7a72695c05f12f21a62dc99fa64d1726fc11b236.tar.gz
Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c138
1 files changed, 69 insertions, 69 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f0aa85c5e3..786bfcf0fb 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -173,13 +173,13 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
AVPacket pkt;
AVStream *st;
MOVStreamContext *sc;
- enum CodecID id;
+ enum AVCodecID id;
int ret;
switch (type) {
- case 0xd: id = CODEC_ID_MJPEG; break;
- case 0xe: id = CODEC_ID_PNG; break;
- case 0x1b: id = CODEC_ID_BMP; break;
+ case 0xd: id = AV_CODEC_ID_MJPEG; break;
+ case 0xe: id = AV_CODEC_ID_PNG; break;
+ case 0x1b: id = AV_CODEC_ID_BMP; break;
default:
av_log(c->fc, AV_LOG_WARNING, "Unknown cover type: 0x%x.\n", type);
avio_skip(pb, len);
@@ -491,7 +491,7 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
else if (type == MKTAG('s','o','u','n'))
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
else if (type == MKTAG('m','1','a',' '))
- st->codec->codec_id = CODEC_ID_MP2;
+ st->codec->codec_id = AV_CODEC_ID_MP2;
else if ((type == MKTAG('s','u','b','p')) || (type == MKTAG('c','l','c','p')))
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
@@ -815,17 +815,17 @@ static int mov_read_enda(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_dlog(c->fc, "enda %d\n", little_endian);
if (little_endian == 1) {
switch (st->codec->codec_id) {
- case CODEC_ID_PCM_S24BE:
- st->codec->codec_id = CODEC_ID_PCM_S24LE;
+ case AV_CODEC_ID_PCM_S24BE:
+ st->codec->codec_id = AV_CODEC_ID_PCM_S24LE;
break;
- case CODEC_ID_PCM_S32BE:
- st->codec->codec_id = CODEC_ID_PCM_S32LE;
+ case AV_CODEC_ID_PCM_S32BE:
+ st->codec->codec_id = AV_CODEC_ID_PCM_S32LE;
break;
- case CODEC_ID_PCM_F32BE:
- st->codec->codec_id = CODEC_ID_PCM_F32LE;
+ case AV_CODEC_ID_PCM_F32BE:
+ st->codec->codec_id = AV_CODEC_ID_PCM_F32LE;
break;
- case CODEC_ID_PCM_F64BE:
- st->codec->codec_id = CODEC_ID_PCM_F64LE;
+ case AV_CODEC_ID_PCM_F64BE:
+ st->codec->codec_id = AV_CODEC_ID_PCM_F64LE;
break;
default:
break;
@@ -901,27 +901,27 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,
/* wrapper functions for reading ALAC/AVS/MJPEG/MJPEG2000 extradata atoms only for those codecs */
static int mov_read_alac(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- return mov_read_extradata(c, pb, atom, CODEC_ID_ALAC);
+ return mov_read_extradata(c, pb, atom, AV_CODEC_ID_ALAC);
}
static int mov_read_avss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- return mov_read_extradata(c, pb, atom, CODEC_ID_AVS);
+ return mov_read_extradata(c, pb, atom, AV_CODEC_ID_AVS);
}
static int mov_read_jp2h(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- return mov_read_extradata(c, pb, atom, CODEC_ID_JPEG2000);
+ return mov_read_extradata(c, pb, atom, AV_CODEC_ID_JPEG2000);
}
static int mov_read_avid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- return mov_read_extradata(c, pb, atom, CODEC_ID_AVUI);
+ return mov_read_extradata(c, pb, atom, AV_CODEC_ID_AVUI);
}
static int mov_read_svq3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- return mov_read_extradata(c, pb, atom, CODEC_ID_SVQ3);
+ return mov_read_extradata(c, pb, atom, AV_CODEC_ID_SVQ3);
}
static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
@@ -935,7 +935,7 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if ((uint64_t)atom.size > (1<<30))
return AVERROR_INVALIDDATA;
- if (st->codec->codec_id == CODEC_ID_QDM2 || st->codec->codec_id == CODEC_ID_QDMC) {
+ if (st->codec->codec_id == AV_CODEC_ID_QDM2 || st->codec->codec_id == AV_CODEC_ID_QDMC) {
// pass all frma atom to codec, needed at least for QDMC and QDM2
av_free(st->codec->extradata);
st->codec->extradata_size = 0;
@@ -1085,35 +1085,35 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
* Compute codec id for 'lpcm' tag.
* See CoreAudioTypes and AudioStreamBasicDescription at Apple.
*/
-enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
+enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags)
{
if (flags & 1) { // floating point
if (flags & 2) { // big endian
- if (bps == 32) return CODEC_ID_PCM_F32BE;
- else if (bps == 64) return CODEC_ID_PCM_F64BE;
+ if (bps == 32) return AV_CODEC_ID_PCM_F32BE;
+ else if (bps == 64) return AV_CODEC_ID_PCM_F64BE;
} else {
- if (bps == 32) return CODEC_ID_PCM_F32LE;
- else if (bps == 64) return CODEC_ID_PCM_F64LE;
+ if (bps == 32) return AV_CODEC_ID_PCM_F32LE;
+ else if (bps == 64) return AV_CODEC_ID_PCM_F64LE;
}
} else {
if (flags & 2) {
if (bps == 8)
// signed integer
- if (flags & 4) return CODEC_ID_PCM_S8;
- else return CODEC_ID_PCM_U8;
- else if (bps == 16) return CODEC_ID_PCM_S16BE;
- else if (bps == 24) return CODEC_ID_PCM_S24BE;
- else if (bps == 32) return CODEC_ID_PCM_S32BE;
+ if (flags & 4) return AV_CODEC_ID_PCM_S8;
+ else return AV_CODEC_ID_PCM_U8;
+ else if (bps == 16) return AV_CODEC_ID_PCM_S16BE;
+ else if (bps == 24) return AV_CODEC_ID_PCM_S24BE;
+ else if (bps == 32) return AV_CODEC_ID_PCM_S32BE;
} else {
if (bps == 8)
- if (flags & 4) return CODEC_ID_PCM_S8;
- else return CODEC_ID_PCM_U8;
- else if (bps == 16) return CODEC_ID_PCM_S16LE;
- else if (bps == 24) return CODEC_ID_PCM_S24LE;
- else if (bps == 32) return CODEC_ID_PCM_S32LE;
+ if (flags & 4) return AV_CODEC_ID_PCM_S8;
+ else return AV_CODEC_ID_PCM_U8;
+ else if (bps == 16) return AV_CODEC_ID_PCM_S16LE;
+ else if (bps == 24) return AV_CODEC_ID_PCM_S24LE;
+ else if (bps == 32) return AV_CODEC_ID_PCM_S32LE;
}
}
- return CODEC_ID_NONE;
+ return AV_CODEC_ID_NONE;
}
int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
@@ -1129,7 +1129,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
for (pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) {
//Parsing Sample description table
- enum CodecID id;
+ enum AVCodecID id;
int dref_id = 1;
MOVAtom a = { AV_RL32("stsd") };
int64_t start_pos = avio_tell(pb);
@@ -1179,7 +1179,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
else if (st->codec->codec_type == AVMEDIA_TYPE_DATA ||
(st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE &&
- st->codec->codec_id == CODEC_ID_NONE)){
+ st->codec->codec_id == AV_CODEC_ID_NONE)){
id = ff_codec_get_id(ff_codec_movsubtitle_tags, format);
if (id > 0)
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
@@ -1243,7 +1243,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
color_index = 255;
color_dec = 256 / (color_count - 1);
for (j = 0; j < color_count; j++) {
- if (id == CODEC_ID_CINEPAK){
+ if (id == AV_CODEC_ID_CINEPAK){
r = g = b = color_count - 1 - color_index;
}else
r = g = b = color_index;
@@ -1336,34 +1336,34 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
}
switch (st->codec->codec_id) {
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_U8:
+ case AV_CODEC_ID_PCM_S8:
+ case AV_CODEC_ID_PCM_U8:
if (st->codec->bits_per_coded_sample == 16)
- st->codec->codec_id = CODEC_ID_PCM_S16BE;
+ st->codec->codec_id = AV_CODEC_ID_PCM_S16BE;
break;
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
+ case AV_CODEC_ID_PCM_S16LE:
+ case AV_CODEC_ID_PCM_S16BE:
if (st->codec->bits_per_coded_sample == 8)
- st->codec->codec_id = CODEC_ID_PCM_S8;
+ st->codec->codec_id = AV_CODEC_ID_PCM_S8;
else if (st->codec->bits_per_coded_sample == 24)
st->codec->codec_id =
- st->codec->codec_id == CODEC_ID_PCM_S16BE ?
- CODEC_ID_PCM_S24BE : CODEC_ID_PCM_S24LE;
+ st->codec->codec_id == AV_CODEC_ID_PCM_S16BE ?
+ AV_CODEC_ID_PCM_S24BE : AV_CODEC_ID_PCM_S24LE;
break;
/* set values for old format before stsd version 1 appeared */
- case CODEC_ID_MACE3:
+ case AV_CODEC_ID_MACE3:
sc->samples_per_frame = 6;
sc->bytes_per_frame = 2*st->codec->channels;
break;
- case CODEC_ID_MACE6:
+ case AV_CODEC_ID_MACE6:
sc->samples_per_frame = 6;
sc->bytes_per_frame = 1*st->codec->channels;
break;
- case CODEC_ID_ADPCM_IMA_QT:
+ case AV_CODEC_ID_ADPCM_IMA_QT:
sc->samples_per_frame = 64;
sc->bytes_per_frame = 34*st->codec->channels;
break;
- case CODEC_ID_GSM:
+ case AV_CODEC_ID_GSM:
sc->samples_per_frame = 160;
sc->bytes_per_frame = 33;
break;
@@ -1418,7 +1418,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
/* special codec parameters handling */
switch (st->codec->codec_id) {
#if CONFIG_DV_DEMUXER
- case CODEC_ID_DVAUDIO:
+ case AV_CODEC_ID_DVAUDIO:
c->dv_fctx = avformat_alloc_context();
c->dv_demux = avpriv_dv_init_demux(c->dv_fctx);
if (!c->dv_demux) {
@@ -1426,49 +1426,49 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
return AVERROR(ENOMEM);
}
sc->dv_audio_container = 1;
- st->codec->codec_id = CODEC_ID_PCM_S16LE;
+ st->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
break;
#endif
/* no ifdef since parameters are always those */
- case CODEC_ID_QCELP:
+ case AV_CODEC_ID_QCELP:
// force sample rate for qcelp when not stored in mov
if (st->codec->codec_tag != MKTAG('Q','c','l','p'))
st->codec->sample_rate = 8000;
st->codec->channels= 1; /* really needed */
break;
- case CODEC_ID_AMR_NB:
+ case AV_CODEC_ID_AMR_NB:
st->codec->channels= 1; /* really needed */
/* force sample rate for amr, stsd in 3gp does not store sample rate */
st->codec->sample_rate = 8000;
break;
- case CODEC_ID_AMR_WB:
+ case AV_CODEC_ID_AMR_WB:
st->codec->channels = 1;
st->codec->sample_rate = 16000;
break;
- case CODEC_ID_MP2:
- case CODEC_ID_MP3:
+ case AV_CODEC_ID_MP2:
+ case AV_CODEC_ID_MP3:
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; /* force type after stsd for m1a hdlr */
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
- case CODEC_ID_GSM:
- case CODEC_ID_ADPCM_MS:
- case CODEC_ID_ADPCM_IMA_WAV:
- case CODEC_ID_ILBC:
+ case AV_CODEC_ID_GSM:
+ case AV_CODEC_ID_ADPCM_MS:
+ case AV_CODEC_ID_ADPCM_IMA_WAV:
+ case AV_CODEC_ID_ILBC:
st->codec->block_align = sc->bytes_per_frame;
break;
- case CODEC_ID_ALAC:
+ case AV_CODEC_ID_ALAC:
if (st->codec->extradata_size == 36) {
st->codec->channels = AV_RB8 (st->codec->extradata+21);
st->codec->sample_rate = AV_RB32(st->codec->extradata+32);
}
break;
- case CODEC_ID_AC3:
+ case AV_CODEC_ID_AC3:
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
- case CODEC_ID_MPEG1VIDEO:
+ case AV_CODEC_ID_MPEG1VIDEO:
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
- case CODEC_ID_VC1:
+ case AV_CODEC_ID_VC1:
st->need_parsing = AVSTREAM_PARSE_FULL;
break;
default:
@@ -2074,13 +2074,13 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
switch (st->codec->codec_id) {
#if CONFIG_H261_DECODER
- case CODEC_ID_H261:
+ case AV_CODEC_ID_H261:
#endif
#if CONFIG_H263_DECODER
- case CODEC_ID_H263:
+ case AV_CODEC_ID_H263:
#endif
#if CONFIG_MPEG4_DECODER
- case CODEC_ID_MPEG4:
+ case AV_CODEC_ID_MPEG4:
#endif
st->codec->width = 0; /* let decoder init width/height */
st->codec->height= 0;
@@ -2962,7 +2962,7 @@ static int mov_read_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data;
- if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->codec->codec_id == CODEC_ID_AAC) {
+ if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->codec->codec_id == AV_CODEC_ID_AAC) {
sc->start_pad = 2112;
st->skip_samples = sc->start_pad;
}