aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/cafenc.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/cafenc.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/cafenc.c')
-rw-r--r--libavformat/cafenc.c110
1 files changed, 55 insertions, 55 deletions
diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index c34705636d..4e51407fea 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -36,15 +36,15 @@ typedef struct {
static uint32_t codec_flags(enum CodecID codec_id) {
switch (codec_id) {
- case CODEC_ID_PCM_F32BE:
- case CODEC_ID_PCM_F64BE:
+ case AV_CODEC_ID_PCM_F32BE:
+ case AV_CODEC_ID_PCM_F64BE:
return 1; //< kCAFLinearPCMFormatFlagIsFloat
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S32LE:
+ case AV_CODEC_ID_PCM_S16LE:
+ case AV_CODEC_ID_PCM_S24LE:
+ case AV_CODEC_ID_PCM_S32LE:
return 2; //< kCAFLinearPCMFormatFlagIsLittleEndian
- case CODEC_ID_PCM_F32LE:
- case CODEC_ID_PCM_F64LE:
+ case AV_CODEC_ID_PCM_F32LE:
+ case AV_CODEC_ID_PCM_F64LE:
return 3; //< kCAFLinearPCMFormatFlagIsFloat | kCAFLinearPCMFormatFlagIsLittleEndian
default:
return 0;
@@ -53,44 +53,44 @@ static uint32_t codec_flags(enum CodecID codec_id) {
static uint32_t samples_per_packet(enum CodecID codec_id, int channels) {
switch (codec_id) {
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_F32LE:
- case CODEC_ID_PCM_F32BE:
- case CODEC_ID_PCM_F64LE:
- case CODEC_ID_PCM_F64BE:
- case CODEC_ID_PCM_ALAW:
- case CODEC_ID_PCM_MULAW:
+ case AV_CODEC_ID_PCM_S8:
+ case AV_CODEC_ID_PCM_S16LE:
+ case AV_CODEC_ID_PCM_S16BE:
+ case AV_CODEC_ID_PCM_S24LE:
+ case AV_CODEC_ID_PCM_S24BE:
+ case AV_CODEC_ID_PCM_S32LE:
+ case AV_CODEC_ID_PCM_S32BE:
+ case AV_CODEC_ID_PCM_F32LE:
+ case AV_CODEC_ID_PCM_F32BE:
+ case AV_CODEC_ID_PCM_F64LE:
+ case AV_CODEC_ID_PCM_F64BE:
+ case AV_CODEC_ID_PCM_ALAW:
+ case AV_CODEC_ID_PCM_MULAW:
return 1;
- case CODEC_ID_MACE3:
- case CODEC_ID_MACE6:
+ case AV_CODEC_ID_MACE3:
+ case AV_CODEC_ID_MACE6:
return 6;
- case CODEC_ID_ADPCM_IMA_QT:
+ case AV_CODEC_ID_ADPCM_IMA_QT:
return 64;
- case CODEC_ID_AMR_NB:
- case CODEC_ID_GSM:
- case CODEC_ID_QCELP:
+ case AV_CODEC_ID_AMR_NB:
+ case AV_CODEC_ID_GSM:
+ case AV_CODEC_ID_QCELP:
return 160;
- case CODEC_ID_GSM_MS:
+ case AV_CODEC_ID_GSM_MS:
return 320;
- case CODEC_ID_MP1:
+ case AV_CODEC_ID_MP1:
return 384;
- case CODEC_ID_MP2:
- case CODEC_ID_MP3:
+ case AV_CODEC_ID_MP2:
+ case AV_CODEC_ID_MP3:
return 1152;
- case CODEC_ID_AC3:
+ case AV_CODEC_ID_AC3:
return 1536;
- case CODEC_ID_ALAC:
- case CODEC_ID_QDM2:
+ case AV_CODEC_ID_ALAC:
+ case AV_CODEC_ID_QDM2:
return 4096;
- case CODEC_ID_ADPCM_IMA_WAV:
+ case AV_CODEC_ID_ADPCM_IMA_WAV:
return (1024 - 4 * channels) * 8 / (4 * channels) + 1;
- case CODEC_ID_ADPCM_MS:
+ case AV_CODEC_ID_ADPCM_MS:
return (1024 - 7 * channels) * 2 / channels + 2;
default:
return 0;
@@ -105,26 +105,26 @@ static int caf_write_header(AVFormatContext *s)
unsigned int codec_tag = ff_codec_get_tag(ff_codec_caf_tags, enc->codec_id);
switch (enc->codec_id) {
- case CODEC_ID_AAC:
- case CODEC_ID_AC3:
+ case AV_CODEC_ID_AAC:
+ case AV_CODEC_ID_AC3:
av_log(s, AV_LOG_ERROR, "muxing codec currently unsupported\n");
return AVERROR_PATCHWELCOME;
}
switch (enc->codec_id) {
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_S24LE:
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_S32LE:
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_F32LE:
- case CODEC_ID_PCM_F32BE:
- case CODEC_ID_PCM_F64LE:
- case CODEC_ID_PCM_F64BE:
- case CODEC_ID_PCM_ALAW:
- case CODEC_ID_PCM_MULAW:
+ case AV_CODEC_ID_PCM_S8:
+ case AV_CODEC_ID_PCM_S16LE:
+ case AV_CODEC_ID_PCM_S16BE:
+ case AV_CODEC_ID_PCM_S24LE:
+ case AV_CODEC_ID_PCM_S24BE:
+ case AV_CODEC_ID_PCM_S32LE:
+ case AV_CODEC_ID_PCM_S32BE:
+ case AV_CODEC_ID_PCM_F32LE:
+ case AV_CODEC_ID_PCM_F32BE:
+ case AV_CODEC_ID_PCM_F64LE:
+ case AV_CODEC_ID_PCM_F64BE:
+ case AV_CODEC_ID_PCM_ALAW:
+ case AV_CODEC_ID_PCM_MULAW:
codec_tag = MKTAG('l','p','c','m');
}
@@ -158,12 +158,12 @@ static int caf_write_header(AVFormatContext *s)
ff_mov_write_chan(pb, enc->channel_layout);
}
- if (enc->codec_id == CODEC_ID_ALAC) {
+ if (enc->codec_id == AV_CODEC_ID_ALAC) {
ffio_wfourcc(pb, "kuki");
avio_wb64(pb, 12 + enc->extradata_size);
avio_write(pb, "\0\0\0\14frmaalac", 12);
avio_write(pb, enc->extradata, enc->extradata_size);
- } else if (enc->codec_id == CODEC_ID_AMR_NB) {
+ } else if (enc->codec_id == AV_CODEC_ID_AMR_NB) {
ffio_wfourcc(pb, "kuki");
avio_wb64(pb, 29);
avio_write(pb, "\0\0\0\14frmasamr", 12);
@@ -174,7 +174,7 @@ static int caf_write_header(AVFormatContext *s)
avio_wb16(pb, 0x81FF); /* Mode set (all modes for AMR_NB) */
avio_w8(pb, 0x00); /* Mode change period (no restriction) */
avio_w8(pb, 0x01); /* Frames per sample */
- } else if (enc->codec_id == CODEC_ID_QDM2) {
+ } else if (enc->codec_id == AV_CODEC_ID_QDM2) {
ffio_wfourcc(pb, "kuki");
avio_wb64(pb, enc->extradata_size);
avio_write(pb, enc->extradata, enc->extradata_size);
@@ -253,8 +253,8 @@ AVOutputFormat ff_caf_muxer = {
.mime_type = "audio/x-caf",
.extensions = "caf",
.priv_data_size = sizeof(CAFContext),
- .audio_codec = CODEC_ID_PCM_S16BE,
- .video_codec = CODEC_ID_NONE,
+ .audio_codec = AV_CODEC_ID_PCM_S16BE,
+ .video_codec = AV_CODEC_ID_NONE,
.write_header = caf_write_header,
.write_packet = caf_write_packet,
.write_trailer = caf_write_trailer,