diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-07 22:45:46 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-07 22:45:46 +0200 |
commit | 7a72695c05f12f21a62dc99fa64d1726fc11b236 (patch) | |
tree | e8f1a2813c4cd1fd8bd0ac5f764c7fd676ab85af /libavdevice | |
parent | 49440853d0c1e740daee0e2df1e65d5e67b1ad6b (diff) | |
parent | 36ef5369ee9b336febc2c270f8718cec4476cb85 (diff) | |
download | ffmpeg-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 'libavdevice')
-rw-r--r-- | libavdevice/alsa-audio-common.c | 72 | ||||
-rw-r--r-- | libavdevice/alsa-audio-dec.c | 2 | ||||
-rw-r--r-- | libavdevice/alsa-audio-enc.c | 4 | ||||
-rw-r--r-- | libavdevice/alsa-audio.h | 10 | ||||
-rw-r--r-- | libavdevice/bktr.c | 2 | ||||
-rw-r--r-- | libavdevice/caca.c | 6 | ||||
-rw-r--r-- | libavdevice/dshow.c | 18 | ||||
-rw-r--r-- | libavdevice/fbdev.c | 2 | ||||
-rw-r--r-- | libavdevice/jack_audio.c | 4 | ||||
-rw-r--r-- | libavdevice/lavfi.c | 4 | ||||
-rw-r--r-- | libavdevice/libcdio.c | 4 | ||||
-rw-r--r-- | libavdevice/libdc1394.c | 2 | ||||
-rw-r--r-- | libavdevice/openal-dec.c | 8 | ||||
-rw-r--r-- | libavdevice/oss_audio.c | 10 | ||||
-rw-r--r-- | libavdevice/pulse.c | 28 | ||||
-rw-r--r-- | libavdevice/sdl.c | 6 | ||||
-rw-r--r-- | libavdevice/sndio_common.c | 2 | ||||
-rw-r--r-- | libavdevice/sndio_common.h | 2 | ||||
-rw-r--r-- | libavdevice/sndio_enc.c | 4 | ||||
-rw-r--r-- | libavdevice/v4l.c | 2 | ||||
-rw-r--r-- | libavdevice/v4l2.c | 62 | ||||
-rw-r--r-- | libavdevice/vfwcap.c | 12 | ||||
-rw-r--r-- | libavdevice/x11grab.c | 2 |
23 files changed, 134 insertions, 134 deletions
diff --git a/libavdevice/alsa-audio-common.c b/libavdevice/alsa-audio-common.c index cb7ba6654f..9da868ff6c 100644 --- a/libavdevice/alsa-audio-common.c +++ b/libavdevice/alsa-audio-common.c @@ -38,26 +38,26 @@ static av_cold snd_pcm_format_t codec_id_to_pcm_format(int codec_id) { switch(codec_id) { - case CODEC_ID_PCM_F64LE: return SND_PCM_FORMAT_FLOAT64_LE; - case CODEC_ID_PCM_F64BE: return SND_PCM_FORMAT_FLOAT64_BE; - case CODEC_ID_PCM_F32LE: return SND_PCM_FORMAT_FLOAT_LE; - case CODEC_ID_PCM_F32BE: return SND_PCM_FORMAT_FLOAT_BE; - case CODEC_ID_PCM_S32LE: return SND_PCM_FORMAT_S32_LE; - case CODEC_ID_PCM_S32BE: return SND_PCM_FORMAT_S32_BE; - case CODEC_ID_PCM_U32LE: return SND_PCM_FORMAT_U32_LE; - case CODEC_ID_PCM_U32BE: return SND_PCM_FORMAT_U32_BE; - case CODEC_ID_PCM_S24LE: return SND_PCM_FORMAT_S24_3LE; - case CODEC_ID_PCM_S24BE: return SND_PCM_FORMAT_S24_3BE; - case CODEC_ID_PCM_U24LE: return SND_PCM_FORMAT_U24_3LE; - case CODEC_ID_PCM_U24BE: return SND_PCM_FORMAT_U24_3BE; - case CODEC_ID_PCM_S16LE: return SND_PCM_FORMAT_S16_LE; - case CODEC_ID_PCM_S16BE: return SND_PCM_FORMAT_S16_BE; - case CODEC_ID_PCM_U16LE: return SND_PCM_FORMAT_U16_LE; - case CODEC_ID_PCM_U16BE: return SND_PCM_FORMAT_U16_BE; - case CODEC_ID_PCM_S8: return SND_PCM_FORMAT_S8; - case CODEC_ID_PCM_U8: return SND_PCM_FORMAT_U8; - case CODEC_ID_PCM_MULAW: return SND_PCM_FORMAT_MU_LAW; - case CODEC_ID_PCM_ALAW: return SND_PCM_FORMAT_A_LAW; + case AV_CODEC_ID_PCM_F64LE: return SND_PCM_FORMAT_FLOAT64_LE; + case AV_CODEC_ID_PCM_F64BE: return SND_PCM_FORMAT_FLOAT64_BE; + case AV_CODEC_ID_PCM_F32LE: return SND_PCM_FORMAT_FLOAT_LE; + case AV_CODEC_ID_PCM_F32BE: return SND_PCM_FORMAT_FLOAT_BE; + case AV_CODEC_ID_PCM_S32LE: return SND_PCM_FORMAT_S32_LE; + case AV_CODEC_ID_PCM_S32BE: return SND_PCM_FORMAT_S32_BE; + case AV_CODEC_ID_PCM_U32LE: return SND_PCM_FORMAT_U32_LE; + case AV_CODEC_ID_PCM_U32BE: return SND_PCM_FORMAT_U32_BE; + case AV_CODEC_ID_PCM_S24LE: return SND_PCM_FORMAT_S24_3LE; + case AV_CODEC_ID_PCM_S24BE: return SND_PCM_FORMAT_S24_3BE; + case AV_CODEC_ID_PCM_U24LE: return SND_PCM_FORMAT_U24_3LE; + case AV_CODEC_ID_PCM_U24BE: return SND_PCM_FORMAT_U24_3BE; + case AV_CODEC_ID_PCM_S16LE: return SND_PCM_FORMAT_S16_LE; + case AV_CODEC_ID_PCM_S16BE: return SND_PCM_FORMAT_S16_BE; + case AV_CODEC_ID_PCM_U16LE: return SND_PCM_FORMAT_U16_LE; + case AV_CODEC_ID_PCM_U16BE: return SND_PCM_FORMAT_U16_BE; + case AV_CODEC_ID_PCM_S8: return SND_PCM_FORMAT_S8; + case AV_CODEC_ID_PCM_U8: return SND_PCM_FORMAT_U8; + case AV_CODEC_ID_PCM_MULAW: return SND_PCM_FORMAT_MU_LAW; + case AV_CODEC_ID_PCM_ALAW: return SND_PCM_FORMAT_A_LAW; default: return SND_PCM_FORMAT_UNKNOWN; } } @@ -156,20 +156,20 @@ static av_cold int find_reorder_func(AlsaData *s, int codec_id, uint64_t layout, return 0; switch (codec_id) { - case CODEC_ID_PCM_S8: - case CODEC_ID_PCM_U8: - case CODEC_ID_PCM_ALAW: - case CODEC_ID_PCM_MULAW: format = FORMAT_I8; break; - case CODEC_ID_PCM_S16LE: - case CODEC_ID_PCM_S16BE: - case CODEC_ID_PCM_U16LE: - case CODEC_ID_PCM_U16BE: format = FORMAT_I16; break; - case CODEC_ID_PCM_S32LE: - case CODEC_ID_PCM_S32BE: - case CODEC_ID_PCM_U32LE: - case CODEC_ID_PCM_U32BE: format = FORMAT_I32; break; - case CODEC_ID_PCM_F32LE: - case CODEC_ID_PCM_F32BE: format = FORMAT_F32; break; + case AV_CODEC_ID_PCM_S8: + case AV_CODEC_ID_PCM_U8: + case AV_CODEC_ID_PCM_ALAW: + case AV_CODEC_ID_PCM_MULAW: format = FORMAT_I8; break; + case AV_CODEC_ID_PCM_S16LE: + case AV_CODEC_ID_PCM_S16BE: + case AV_CODEC_ID_PCM_U16LE: + case AV_CODEC_ID_PCM_U16BE: format = FORMAT_I16; break; + case AV_CODEC_ID_PCM_S32LE: + case AV_CODEC_ID_PCM_S32BE: + case AV_CODEC_ID_PCM_U32LE: + case AV_CODEC_ID_PCM_U32BE: format = FORMAT_I32; break; + case AV_CODEC_ID_PCM_F32LE: + case AV_CODEC_ID_PCM_F32BE: format = FORMAT_F32; break; default: return AVERROR(ENOSYS); } @@ -185,7 +185,7 @@ static av_cold int find_reorder_func(AlsaData *s, int codec_id, uint64_t layout, av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, unsigned int *sample_rate, - int channels, enum CodecID *codec_id) + int channels, enum AVCodecID *codec_id) { AlsaData *s = ctx->priv_data; const char *audio_device; @@ -199,7 +199,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode, if (ctx->filename[0] == 0) audio_device = "default"; else audio_device = ctx->filename; - if (*codec_id == CODEC_ID_NONE) + if (*codec_id == AV_CODEC_ID_NONE) *codec_id = DEFAULT_CODEC_ID; format = codec_id_to_pcm_format(*codec_id); if (format == SND_PCM_FORMAT_UNKNOWN) { diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c index e0e0954430..0f182485ff 100644 --- a/libavdevice/alsa-audio-dec.c +++ b/libavdevice/alsa-audio-dec.c @@ -58,7 +58,7 @@ static av_cold int audio_read_header(AVFormatContext *s1) AlsaData *s = s1->priv_data; AVStream *st; int ret; - enum CodecID codec_id; + enum AVCodecID codec_id; st = avformat_new_stream(s1, NULL); if (!st) { diff --git a/libavdevice/alsa-audio-enc.c b/libavdevice/alsa-audio-enc.c index fd013160d6..403a44fcb0 100644 --- a/libavdevice/alsa-audio-enc.c +++ b/libavdevice/alsa-audio-enc.c @@ -48,7 +48,7 @@ static av_cold int audio_write_header(AVFormatContext *s1) AlsaData *s = s1->priv_data; AVStream *st; unsigned int sample_rate; - enum CodecID codec_id; + enum AVCodecID codec_id; int res; st = s1->streams[0]; @@ -119,7 +119,7 @@ AVOutputFormat ff_alsa_muxer = { .long_name = NULL_IF_CONFIG_SMALL("ALSA audio output"), .priv_data_size = sizeof(AlsaData), .audio_codec = DEFAULT_CODEC_ID, - .video_codec = CODEC_ID_NONE, + .video_codec = AV_CODEC_ID_NONE, .write_header = audio_write_header, .write_packet = audio_write_packet, .write_trailer = ff_alsa_close, diff --git a/libavdevice/alsa-audio.h b/libavdevice/alsa-audio.h index 6719384d84..00acf9f3ee 100644 --- a/libavdevice/alsa-audio.h +++ b/libavdevice/alsa-audio.h @@ -39,7 +39,7 @@ /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ -#define DEFAULT_CODEC_ID AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE) +#define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE) typedef void (*ff_reorder_func)(const void *, void *, int); @@ -67,15 +67,15 @@ typedef struct { * @param sample_rate in: requested sample rate; * out: actually selected sample rate * @param channels number of channels - * @param codec_id in: requested CodecID or CODEC_ID_NONE; - * out: actually selected CodecID, changed only if - * CODEC_ID_NONE was requested + * @param codec_id in: requested AVCodecID or AV_CODEC_ID_NONE; + * out: actually selected AVCodecID, changed only if + * AV_CODEC_ID_NONE was requested * * @return 0 if OK, AVERROR_xxx on error */ int ff_alsa_open(AVFormatContext *s, snd_pcm_stream_t mode, unsigned int *sample_rate, - int channels, enum CodecID *codec_id); + int channels, enum AVCodecID *codec_id); /** * Close the ALSA PCM. diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index 4bb80a890a..58a6a7a205 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -274,7 +274,7 @@ static int grab_read_header(AVFormatContext *s1) st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->pix_fmt = PIX_FMT_YUV420P; - st->codec->codec_id = CODEC_ID_RAWVIDEO; + st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->codec->width = s->width; st->codec->height = s->height; st->codec->time_base.den = framerate.num; diff --git a/libavdevice/caca.c b/libavdevice/caca.c index 173a28bad9..bd5dde5f22 100644 --- a/libavdevice/caca.c +++ b/libavdevice/caca.c @@ -121,7 +121,7 @@ static int caca_write_header(AVFormatContext *s) if ( s->nb_streams > 1 || encctx->codec_type != AVMEDIA_TYPE_VIDEO - || encctx->codec_id != CODEC_ID_RAWVIDEO) { + || encctx->codec_id != AV_CODEC_ID_RAWVIDEO) { av_log(s, AV_LOG_ERROR, "Only supports one rawvideo stream\n"); return AVERROR(EINVAL); } @@ -230,8 +230,8 @@ AVOutputFormat ff_caca_muxer = { .name = "caca", .long_name = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"), .priv_data_size = sizeof(CACAContext), - .audio_codec = CODEC_ID_NONE, - .video_codec = CODEC_ID_RAWVIDEO, + .audio_codec = AV_CODEC_ID_NONE, + .video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = caca_write_header, .write_packet = caca_write_packet, .write_trailer = caca_write_trailer, diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 2a7cdd1aa6..be8b592e26 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -96,12 +96,12 @@ static enum CodecID dshow_codecid(DWORD biCompression) { switch(biCompression) { case MKTAG('d', 'v', 's', 'd'): - return CODEC_ID_DVVIDEO; + return AV_CODEC_ID_DVVIDEO; case MKTAG('M', 'J', 'P', 'G'): case MKTAG('m', 'j', 'p', 'g'): - return CODEC_ID_MJPEG; + return AV_CODEC_ID_MJPEG; } - return CODEC_ID_NONE; + return AV_CODEC_ID_NONE; } static int @@ -642,10 +642,10 @@ error: static enum CodecID waveform_codec_id(enum AVSampleFormat sample_fmt) { switch (sample_fmt) { - case AV_SAMPLE_FMT_U8: return CODEC_ID_PCM_U8; - case AV_SAMPLE_FMT_S16: return CODEC_ID_PCM_S16LE; - case AV_SAMPLE_FMT_S32: return CODEC_ID_PCM_S32LE; - default: return CODEC_ID_NONE; /* Should never happen. */ + case AV_SAMPLE_FMT_U8: return AV_CODEC_ID_PCM_U8; + case AV_SAMPLE_FMT_S16: return AV_CODEC_ID_PCM_S16LE; + case AV_SAMPLE_FMT_S32: return AV_CODEC_ID_PCM_S32LE; + default: return AV_CODEC_ID_NONE; /* Should never happen. */ } } @@ -706,7 +706,7 @@ dshow_add_device(AVFormatContext *avctx, codec->pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount); if (codec->pix_fmt == PIX_FMT_NONE) { codec->codec_id = dshow_codecid(bih->biCompression); - if (codec->codec_id == CODEC_ID_NONE) { + if (codec->codec_id == AV_CODEC_ID_NONE) { av_log(avctx, AV_LOG_ERROR, "Unknown compression type. " "Please report verbose (-v 9) debug information.\n"); dshow_read_close(avctx); @@ -714,7 +714,7 @@ dshow_add_device(AVFormatContext *avctx, } codec->bits_per_coded_sample = bih->biBitCount; } else { - codec->codec_id = CODEC_ID_RAWVIDEO; + codec->codec_id = AV_CODEC_ID_RAWVIDEO; if (bih->biCompression == BI_RGB || bih->biCompression == BI_BITFIELDS) { codec->bits_per_coded_sample = bih->biBitCount; codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE); diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c index 6d6bff5d0a..d97749576d 100644 --- a/libavdevice/fbdev.c +++ b/libavdevice/fbdev.c @@ -160,7 +160,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx) } st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->codec_id = CODEC_ID_RAWVIDEO; + st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->codec->width = fbdev->width; st->codec->height = fbdev->height; st->codec->pix_fmt = pix_fmt; diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c index c9ef23e68a..59cabe3685 100644 --- a/libavdevice/jack_audio.c +++ b/libavdevice/jack_audio.c @@ -243,9 +243,9 @@ static int audio_read_header(AVFormatContext *context) stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; #if HAVE_BIGENDIAN - stream->codec->codec_id = CODEC_ID_PCM_F32BE; + stream->codec->codec_id = AV_CODEC_ID_PCM_F32BE; #else - stream->codec->codec_id = CODEC_ID_PCM_F32LE; + stream->codec->codec_id = AV_CODEC_ID_PCM_F32LE; #endif stream->codec->sample_rate = self->sample_rate; stream->codec->channels = self->nports; diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 65632e302d..20fa3e69b2 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -239,7 +239,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) st->codec->codec_type = link->type; avpriv_set_pts_info(st, 64, link->time_base.num, link->time_base.den); if (link->type == AVMEDIA_TYPE_VIDEO) { - st->codec->codec_id = CODEC_ID_RAWVIDEO; + st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->codec->pix_fmt = link->format; st->codec->time_base = link->time_base; st->codec->width = link->w; @@ -253,7 +253,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) st->codec->sample_rate = link->sample_rate; st->codec->time_base = link->time_base; st->codec->channel_layout = link->channel_layout; - if (st->codec->codec_id == CODEC_ID_NONE) + if (st->codec->codec_id == AV_CODEC_ID_NONE) av_log(avctx, AV_LOG_ERROR, "Could not find PCM codec for sample format %s.\n", av_get_sample_fmt_name(link->format)); diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c index c590995561..bcef7fbe21 100644 --- a/libavdevice/libcdio.c +++ b/libavdevice/libcdio.c @@ -83,9 +83,9 @@ static av_cold int read_header(AVFormatContext *ctx) st->codec->codec_type = AVMEDIA_TYPE_AUDIO; if (s->drive->bigendianp) - st->codec->codec_id = CODEC_ID_PCM_S16BE; + st->codec->codec_id = AV_CODEC_ID_PCM_S16BE; else - st->codec->codec_id = CODEC_ID_PCM_S16LE; + st->codec->codec_id = AV_CODEC_ID_PCM_S16LE; st->codec->sample_rate = 44100; st->codec->channels = 2; if (s->drive->audio_last_sector != CDIO_INVALID_LSN && diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index f4c37cc214..e86a2ed800 100644 --- a/libavdevice/libdc1394.c +++ b/libavdevice/libdc1394.c @@ -168,7 +168,7 @@ static inline int dc1394_read_common(AVFormatContext *c, } avpriv_set_pts_info(vst, 64, 1, 1000); vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; - vst->codec->codec_id = CODEC_ID_RAWVIDEO; + vst->codec->codec_id = AV_CODEC_ID_RAWVIDEO; vst->codec->time_base.den = framerate.num; vst->codec->time_base.num = framerate.den; vst->codec->width = fmt->width; diff --git a/libavdevice/openal-dec.c b/libavdevice/openal-dec.c index 2227d6350b..f927b260f7 100644 --- a/libavdevice/openal-dec.c +++ b/libavdevice/openal-dec.c @@ -62,10 +62,10 @@ typedef struct { static inline al_format_info* get_al_format_info(ALCenum al_fmt) { static al_format_info info_table[] = { - [AL_FORMAT_MONO8-LOWEST_AL_FORMAT] = {AL_FORMAT_MONO8, CODEC_ID_PCM_U8, 1}, - [AL_FORMAT_MONO16-LOWEST_AL_FORMAT] = {AL_FORMAT_MONO16, AV_NE (CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), 1}, - [AL_FORMAT_STEREO8-LOWEST_AL_FORMAT] = {AL_FORMAT_STEREO8, CODEC_ID_PCM_U8, 2}, - [AL_FORMAT_STEREO16-LOWEST_AL_FORMAT] = {AL_FORMAT_STEREO16, AV_NE (CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), 2}, + [AL_FORMAT_MONO8-LOWEST_AL_FORMAT] = {AL_FORMAT_MONO8, AV_CODEC_ID_PCM_U8, 1}, + [AL_FORMAT_MONO16-LOWEST_AL_FORMAT] = {AL_FORMAT_MONO16, AV_NE (AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), 1}, + [AL_FORMAT_STEREO8-LOWEST_AL_FORMAT] = {AL_FORMAT_STEREO8, AV_CODEC_ID_PCM_U8, 2}, + [AL_FORMAT_STEREO16-LOWEST_AL_FORMAT] = {AL_FORMAT_STEREO16, AV_NE (AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), 2}, }; return &info_table[al_fmt-LOWEST_AL_FORMAT]; diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index f8843a37f9..7942bde264 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -49,7 +49,7 @@ typedef struct { int sample_rate; int channels; int frame_size; /* in bytes ! */ - enum CodecID codec_id; + enum AVCodecID codec_id; unsigned int flip_left : 1; uint8_t buffer[AUDIO_BLOCK_SIZE]; int buffer_ptr; @@ -104,10 +104,10 @@ static int audio_open(AVFormatContext *s1, int is_output, const char *audio_devi switch(tmp) { case AFMT_S16_LE: - s->codec_id = CODEC_ID_PCM_S16LE; + s->codec_id = AV_CODEC_ID_PCM_S16LE; break; case AFMT_S16_BE: - s->codec_id = CODEC_ID_PCM_S16BE; + s->codec_id = AV_CODEC_ID_PCM_S16BE; break; default: av_log(s1, AV_LOG_ERROR, "Soundcard does not support 16 bit sample format\n"); @@ -314,8 +314,8 @@ AVOutputFormat ff_oss_muxer = { /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ - .audio_codec = AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), - .video_codec = CODEC_ID_NONE, + .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .video_codec = AV_CODEC_ID_NONE, .write_header = audio_write_header, .write_packet = audio_write_packet, .write_trailer = audio_write_trailer, diff --git a/libavdevice/pulse.c b/libavdevice/pulse.c index 044ec3178d..8179712b25 100644 --- a/libavdevice/pulse.c +++ b/libavdevice/pulse.c @@ -33,7 +33,7 @@ #include "libavformat/internal.h" #include "libavutil/opt.h" -#define DEFAULT_CODEC_ID AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE) +#define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE) typedef struct PulseData { AVClass *class; @@ -51,17 +51,17 @@ typedef struct PulseData { static pa_sample_format_t codec_id_to_pulse_format(int codec_id) { switch (codec_id) { - case CODEC_ID_PCM_U8: return PA_SAMPLE_U8; - case CODEC_ID_PCM_ALAW: return PA_SAMPLE_ALAW; - case CODEC_ID_PCM_MULAW: return PA_SAMPLE_ULAW; - case CODEC_ID_PCM_S16LE: return PA_SAMPLE_S16LE; - case CODEC_ID_PCM_S16BE: return PA_SAMPLE_S16BE; - case CODEC_ID_PCM_F32LE: return PA_SAMPLE_FLOAT32LE; - case CODEC_ID_PCM_F32BE: return PA_SAMPLE_FLOAT32BE; - case CODEC_ID_PCM_S32LE: return PA_SAMPLE_S32LE; - case CODEC_ID_PCM_S32BE: return PA_SAMPLE_S32BE; - case CODEC_ID_PCM_S24LE: return PA_SAMPLE_S24LE; - case CODEC_ID_PCM_S24BE: return PA_SAMPLE_S24BE; + case AV_CODEC_ID_PCM_U8: return PA_SAMPLE_U8; + case AV_CODEC_ID_PCM_ALAW: return PA_SAMPLE_ALAW; + case AV_CODEC_ID_PCM_MULAW: return PA_SAMPLE_ULAW; + case AV_CODEC_ID_PCM_S16LE: return PA_SAMPLE_S16LE; + case AV_CODEC_ID_PCM_S16BE: return PA_SAMPLE_S16BE; + case AV_CODEC_ID_PCM_F32LE: return PA_SAMPLE_FLOAT32LE; + case AV_CODEC_ID_PCM_F32BE: return PA_SAMPLE_FLOAT32BE; + case AV_CODEC_ID_PCM_S32LE: return PA_SAMPLE_S32LE; + case AV_CODEC_ID_PCM_S32BE: return PA_SAMPLE_S32BE; + case AV_CODEC_ID_PCM_S24LE: return PA_SAMPLE_S24LE; + case AV_CODEC_ID_PCM_S24BE: return PA_SAMPLE_S24BE; default: return PA_SAMPLE_INVALID; } } @@ -72,8 +72,8 @@ static av_cold int pulse_read_header(AVFormatContext *s) AVStream *st; char *device = NULL; int ret; - enum CodecID codec_id = - s->audio_codec_id == CODEC_ID_NONE ? DEFAULT_CODEC_ID : s->audio_codec_id; + enum AVCodecID codec_id = + s->audio_codec_id == AV_CODEC_ID_NONE ? DEFAULT_CODEC_ID : s->audio_codec_id; const pa_sample_spec ss = { codec_id_to_pulse_format(codec_id), pd->sample_rate, pd->channels }; diff --git a/libavdevice/sdl.c b/libavdevice/sdl.c index 0ad610cda1..7783f66013 100644 --- a/libavdevice/sdl.c +++ b/libavdevice/sdl.c @@ -98,7 +98,7 @@ static int sdl_write_header(AVFormatContext *s) if ( s->nb_streams > 1 || encctx->codec_type != AVMEDIA_TYPE_VIDEO - || encctx->codec_id != CODEC_ID_RAWVIDEO) { + || encctx->codec_id != AV_CODEC_ID_RAWVIDEO) { av_log(s, AV_LOG_ERROR, "Only supports one rawvideo stream\n"); ret = AVERROR(EINVAL); goto fail; @@ -223,8 +223,8 @@ AVOutputFormat ff_sdl_muxer = { .name = "sdl", .long_name = NULL_IF_CONFIG_SMALL("SDL output device"), .priv_data_size = sizeof(SDLContext), - .audio_codec = CODEC_ID_NONE, - .video_codec = CODEC_ID_RAWVIDEO, + .audio_codec = AV_CODEC_ID_NONE, + .video_codec = AV_CODEC_ID_RAWVIDEO, .write_header = sdl_write_header, .write_packet = sdl_write_packet, .write_trailer = sdl_write_trailer, diff --git a/libavdevice/sndio_common.c b/libavdevice/sndio_common.c index 048e72e8a2..19f39be780 100644 --- a/libavdevice/sndio_common.c +++ b/libavdevice/sndio_common.c @@ -84,7 +84,7 @@ av_cold int ff_sndio_open(AVFormatContext *s1, int is_output, } } - s->codec_id = par.le ? CODEC_ID_PCM_S16LE : CODEC_ID_PCM_S16BE; + s->codec_id = par.le ? AV_CODEC_ID_PCM_S16LE : AV_CODEC_ID_PCM_S16BE; s->channels = is_output ? par.pchan : par.rchan; s->sample_rate = par.rate; s->bps = par.bps; diff --git a/libavdevice/sndio_common.h b/libavdevice/sndio_common.h index 12218b4b24..5111dc7a92 100644 --- a/libavdevice/sndio_common.h +++ b/libavdevice/sndio_common.h @@ -31,7 +31,7 @@ typedef struct { AVClass *class; struct sio_hdl *hdl; - enum CodecID codec_id; + enum AVCodecID codec_id; int64_t hwpos; int64_t softpos; uint8_t *buffer; diff --git a/libavdevice/sndio_enc.c b/libavdevice/sndio_enc.c index 9ad5cad08a..84d070e89c 100644 --- a/libavdevice/sndio_enc.c +++ b/libavdevice/sndio_enc.c @@ -83,8 +83,8 @@ AVOutputFormat ff_sndio_muxer = { /* XXX: we make the assumption that the soundcard accepts this format */ /* XXX: find better solution with "preinit" method, needed also in other formats */ - .audio_codec = AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE), - .video_codec = CODEC_ID_NONE, + .audio_codec = AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE), + .video_codec = AV_CODEC_ID_NONE, .write_header = audio_write_header, .write_packet = audio_write_packet, .write_trailer = audio_write_trailer, diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index 2d260726bf..63047f9220 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -241,7 +241,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) s->fd = video_fd; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->codec_id = CODEC_ID_RAWVIDEO; + st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->codec->width = s->video_win.width; st->codec->height = s->video_win.height; st->codec->time_base = s->time_base; diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 2808e13ac3..867c363533 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -125,31 +125,31 @@ struct buff_data { struct fmt_map { enum PixelFormat ff_fmt; - enum CodecID codec_id; + enum AVCodecID codec_id; uint32_t v4l2_fmt; }; static struct fmt_map fmt_conversion_table[] = { //ff_fmt codec_id v4l2_fmt - { PIX_FMT_YUV420P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 }, - { PIX_FMT_YUV420P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 }, - { PIX_FMT_YUV422P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P }, - { PIX_FMT_YUYV422, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV }, - { PIX_FMT_UYVY422, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY }, - { PIX_FMT_YUV411P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P }, - { PIX_FMT_YUV410P, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 }, - { PIX_FMT_RGB555LE,CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 }, - { PIX_FMT_RGB555BE,CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X }, - { PIX_FMT_RGB565LE,CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 }, - { PIX_FMT_RGB565BE,CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X }, - { PIX_FMT_BGR24, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 }, - { PIX_FMT_RGB24, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 }, - { PIX_FMT_BGR0, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 }, - { PIX_FMT_0RGB, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 }, - { PIX_FMT_GRAY8, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY }, - { PIX_FMT_NV12, CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 }, - { PIX_FMT_NONE, CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG }, - { PIX_FMT_NONE, CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG }, + { PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 }, + { PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 }, + { PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P }, + { PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV }, + { PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY }, + { PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P }, + { PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 }, + { PIX_FMT_RGB555LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 }, + { PIX_FMT_RGB555BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X }, + { PIX_FMT_RGB565LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 }, + { PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X }, + { PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 }, + { PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 }, + { PIX_FMT_BGR0, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 }, + { PIX_FMT_0RGB, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 }, + { PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY }, + { PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 }, + { PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG }, + { PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG }, }; static int device_open(AVFormatContext *ctx) @@ -264,12 +264,12 @@ static int first_field(int fd) return 1; } -static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum CodecID codec_id) +static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum AVCodecID codec_id) { int i; for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) { - if ((codec_id == CODEC_ID_NONE || + if ((codec_id == AV_CODEC_ID_NONE || fmt_conversion_table[i].codec_id == codec_id) && (pix_fmt == PIX_FMT_NONE || fmt_conversion_table[i].ff_fmt == pix_fmt)) { @@ -280,7 +280,7 @@ static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum CodecID codec_id) return 0; } -static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum CodecID codec_id) +static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id) { int i; @@ -294,7 +294,7 @@ static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum CodecID codec_id) return PIX_FMT_NONE; } -static enum CodecID fmt_v4l2codec(uint32_t v4l2_fmt) +static enum AVCodecID fmt_v4l2codec(uint32_t v4l2_fmt) { int i; @@ -304,7 +304,7 @@ static enum CodecID fmt_v4l2codec(uint32_t v4l2_fmt) } } - return CODEC_ID_NONE; + return AV_CODEC_ID_NONE; } #if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE @@ -338,7 +338,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type) struct v4l2_fmtdesc vfd = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE }; while(!ioctl(fd, VIDIOC_ENUM_FMT, &vfd)) { - enum CodecID codec_id = fmt_v4l2codec(vfd.pixelformat); + enum AVCodecID codec_id = fmt_v4l2codec(vfd.pixelformat); enum PixelFormat pix_fmt = fmt_v4l2ff(vfd.pixelformat, codec_id); vfd.index++; @@ -732,7 +732,7 @@ static uint32_t device_try_init(AVFormatContext *s1, enum PixelFormat pix_fmt, int *width, int *height, - enum CodecID *codec_id) + enum AVCodecID *codec_id) { uint32_t desired_format = fmt_ff2v4l(pix_fmt, s1->video_codec_id); @@ -742,7 +742,7 @@ static uint32_t device_try_init(AVFormatContext *s1, desired_format = 0; for (i = 0; i<FF_ARRAY_ELEMS(fmt_conversion_table); i++) { - if (s1->video_codec_id == CODEC_ID_NONE || + if (s1->video_codec_id == AV_CODEC_ID_NONE || fmt_conversion_table[i].codec_id == s1->video_codec_id) { desired_format = fmt_conversion_table[i].v4l2_fmt; if (device_init(s1, width, height, desired_format) >= 0) { @@ -755,7 +755,7 @@ static uint32_t device_try_init(AVFormatContext *s1, if (desired_format != 0) { *codec_id = fmt_v4l2codec(desired_format); - av_assert0(*codec_id != CODEC_ID_NONE); + av_assert0(*codec_id != AV_CODEC_ID_NONE); } return desired_format; @@ -767,7 +767,7 @@ static int v4l2_read_header(AVFormatContext *s1) AVStream *st; int res = 0; uint32_t desired_format; - enum CodecID codec_id; + enum AVCodecID codec_id; enum PixelFormat pix_fmt = PIX_FMT_NONE; st = avformat_new_stream(s1, NULL); @@ -858,7 +858,7 @@ static int v4l2_read_header(AVFormatContext *s1) st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = codec_id; - if (codec_id == CODEC_ID_RAWVIDEO) + if (codec_id == AV_CODEC_ID_RAWVIDEO) st->codec->codec_tag = avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); if (desired_format == V4L2_PIX_FMT_YVU420) diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 2809c56702..3b348ffade 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -73,16 +73,16 @@ static enum PixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount) return PIX_FMT_NONE; } -static enum CodecID vfw_codecid(DWORD biCompression) +static enum AVCodecID vfw_codecid(DWORD biCompression) { switch(biCompression) { case MKTAG('d', 'v', 's', 'd'): - return CODEC_ID_DVVIDEO; + return AV_CODEC_ID_DVVIDEO; case MKTAG('M', 'J', 'P', 'G'): case MKTAG('m', 'j', 'p', 'g'): - return CODEC_ID_MJPEG; + return AV_CODEC_ID_MJPEG; } - return CODEC_ID_NONE; + return AV_CODEC_ID_NONE; } #define dstruct(pctx, sname, var, type) \ @@ -379,7 +379,7 @@ static int vfw_read_header(AVFormatContext *s) codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount); if(codec->pix_fmt == PIX_FMT_NONE) { codec->codec_id = vfw_codecid(biCompression); - if(codec->codec_id == CODEC_ID_NONE) { + if(codec->codec_id == AV_CODEC_ID_NONE) { av_log(s, AV_LOG_ERROR, "Unknown compression type. " "Please report verbose (-v 9) debug information.\n"); vfw_read_close(s); @@ -387,7 +387,7 @@ static int vfw_read_header(AVFormatContext *s) } codec->bits_per_coded_sample = biBitCount; } else { - codec->codec_id = CODEC_ID_RAWVIDEO; + codec->codec_id = AV_CODEC_ID_RAWVIDEO; if(biCompression == BI_RGB) { codec->bits_per_coded_sample = biBitCount; codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE); diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 566889cb16..633ac6a33e 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -310,7 +310,7 @@ x11grab_read_header(AVFormatContext *s1) x11grab->use_shm = use_shm; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->codec_id = CODEC_ID_RAWVIDEO; + st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->codec->width = x11grab->width; st->codec->height = x11grab->height; st->codec->pix_fmt = input_pixfmt; |