V4L/DVB (8634): v4l2: extend MPEG Encoding API with AVC and AAC
authorJanne Grunau <j@jannau.net>
Fri, 8 Aug 2008 10:21:00 +0000 (07:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Oct 2008 11:36:47 +0000 (09:36 -0200)
Adds Advanced Audio Coding (AAC) and MPEG-4 Advanced Video Coding
(AVC/H.264) as audio/video codecs to the extended controls API.
Updates cx2341x driver to the new values.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx2341x.c
drivers/media/video/v4l2-common.c
include/linux/videodev2.h

index 22847a0444f59d051acd3e3d68bcbc2ad6852c50..cbbe47fb87b7a7c6a836f0fee5e2422cb6e41a95 100644 (file)
@@ -508,7 +508,10 @@ int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params,
                /* this setting is read-only for the cx2341x since the
                   V4L2_CID_MPEG_STREAM_TYPE really determines the
                   MPEG-1/2 setting */
-               err = v4l2_ctrl_query_fill_std(qctrl);
+               err = v4l2_ctrl_query_fill(qctrl,
+                                          V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
+                                          V4L2_MPEG_VIDEO_ENCODING_MPEG_2, 1,
+                                          V4L2_MPEG_VIDEO_ENCODING_MPEG_2);
                if (err == 0)
                        qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
                return err;
index 88ca1310441767ff7314a546a02a8675b69f2cc5..893ac496c4b4913260b71a427653384738bd1fac 100644 (file)
@@ -187,9 +187,10 @@ const char **v4l2_ctrl_get_menu(u32 id)
                NULL
        };
        static const char *mpeg_audio_encoding[] = {
-               "Layer I",
-               "Layer II",
-               "Layer III",
+               "MPEG-1 Layer I",
+               "MPEG-1 Layer II",
+               "MPEG-1 Layer III",
+               "MPEG-4 AAC",
                NULL
        };
        static const char *mpeg_audio_l1_bitrate[] = {
@@ -271,6 +272,7 @@ const char **v4l2_ctrl_get_menu(u32 id)
        static const char *mpeg_video_encoding[] = {
                "MPEG-1",
                "MPEG-2",
+               "MPEG-4 AVC",
                NULL
        };
        static const char *mpeg_video_aspect[] = {
@@ -358,7 +360,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
        /* MPEG controls */
        case V4L2_CID_MPEG_CLASS:               name = "MPEG Encoder Controls"; break;
        case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: name = "Audio Sampling Frequency"; break;
-       case V4L2_CID_MPEG_AUDIO_ENCODING:      name = "Audio Encoding Layer"; break;
+       case V4L2_CID_MPEG_AUDIO_ENCODING:      name = "Audio Encoding"; break;
        case V4L2_CID_MPEG_AUDIO_L1_BITRATE:    name = "Audio Layer I Bitrate"; break;
        case V4L2_CID_MPEG_AUDIO_L2_BITRATE:    name = "Audio Layer II Bitrate"; break;
        case V4L2_CID_MPEG_AUDIO_L3_BITRATE:    name = "Audio Layer III Bitrate"; break;
@@ -493,7 +495,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
        case V4L2_CID_MPEG_AUDIO_ENCODING:
                return v4l2_ctrl_query_fill(qctrl,
                                V4L2_MPEG_AUDIO_ENCODING_LAYER_1,
-                               V4L2_MPEG_AUDIO_ENCODING_LAYER_3, 1,
+                               V4L2_MPEG_AUDIO_ENCODING_AAC, 1,
                                V4L2_MPEG_AUDIO_ENCODING_LAYER_2);
        case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
                return v4l2_ctrl_query_fill(qctrl,
@@ -535,7 +537,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
        case V4L2_CID_MPEG_VIDEO_ENCODING:
                return v4l2_ctrl_query_fill(qctrl,
                                V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
-                               V4L2_MPEG_VIDEO_ENCODING_MPEG_2, 1,
+                               V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 1,
                                V4L2_MPEG_VIDEO_ENCODING_MPEG_2);
        case V4L2_CID_MPEG_VIDEO_ASPECT:
                return v4l2_ctrl_query_fill(qctrl,
index 303d93ffd6b23c2ccdf42bb676799f8ee295ef23..350aba2714fc552457032f3f2868c2362645be8f 100644 (file)
@@ -910,6 +910,7 @@ enum v4l2_mpeg_audio_encoding {
        V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
        V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
        V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
+       V4L2_MPEG_AUDIO_ENCODING_AAC     = 3,
 };
 #define V4L2_CID_MPEG_AUDIO_L1_BITRATE                 (V4L2_CID_MPEG_BASE+102)
 enum v4l2_mpeg_audio_l1_bitrate {
@@ -992,8 +993,9 @@ enum v4l2_mpeg_audio_crc {
 /*  MPEG video */
 #define V4L2_CID_MPEG_VIDEO_ENCODING           (V4L2_CID_MPEG_BASE+200)
 enum v4l2_mpeg_video_encoding {
-       V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
-       V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
+       V4L2_MPEG_VIDEO_ENCODING_MPEG_1     = 0,
+       V4L2_MPEG_VIDEO_ENCODING_MPEG_2     = 1,
+       V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2,
 };
 #define V4L2_CID_MPEG_VIDEO_ASPECT             (V4L2_CID_MPEG_BASE+201)
 enum v4l2_mpeg_video_aspect {