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/v4l2.c | |
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/v4l2.c')
-rw-r--r-- | libavdevice/v4l2.c | 62 |
1 files changed, 31 insertions, 31 deletions
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) |