aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-common.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-08 06:38:07 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:48 -0400
commite6b5da88fb24c5c1e52707faea7c46df09da42f0 (patch)
tree0ddf04f57c6c1c4da9d986d66f2869250d93a0a5 /drivers/media/video/v4l2-common.c
parent188919ac57810e39138749338d5a33ba1e970e23 (diff)
V4L/DVB (8635): v4l: add AC-3 audio support to the MPEG Encoding API
Some models of the saa6752hs support AC-3. Extend the API with the necessary controls for AC-3. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r--drivers/media/video/v4l2-common.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 893ac496c4b4..0a96cc35738c 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -187,10 +187,11 @@ const char **v4l2_ctrl_get_menu(u32 id)
187 NULL 187 NULL
188 }; 188 };
189 static const char *mpeg_audio_encoding[] = { 189 static const char *mpeg_audio_encoding[] = {
190 "MPEG-1 Layer I", 190 "MPEG-1/2 Layer I",
191 "MPEG-1 Layer II", 191 "MPEG-1/2 Layer II",
192 "MPEG-1 Layer III", 192 "MPEG-1/2 Layer III",
193 "MPEG-4 AAC", 193 "MPEG-2/4 AAC",
194 "AC-3",
194 NULL 195 NULL
195 }; 196 };
196 static const char *mpeg_audio_l1_bitrate[] = { 197 static const char *mpeg_audio_l1_bitrate[] = {
@@ -244,6 +245,28 @@ const char **v4l2_ctrl_get_menu(u32 id)
244 "320 kbps", 245 "320 kbps",
245 NULL 246 NULL
246 }; 247 };
248 static const char *mpeg_audio_ac3_bitrate[] = {
249 "32 kbps",
250 "40 kbps",
251 "48 kbps",
252 "56 kbps",
253 "64 kbps",
254 "80 kbps",
255 "96 kbps",
256 "112 kbps",
257 "128 kbps",
258 "160 kbps",
259 "192 kbps",
260 "224 kbps",
261 "256 kbps",
262 "320 kbps",
263 "384 kbps",
264 "448 kbps",
265 "512 kbps",
266 "576 kbps",
267 "640 kbps",
268 NULL
269 };
247 static const char *mpeg_audio_mode[] = { 270 static const char *mpeg_audio_mode[] = {
248 "Stereo", 271 "Stereo",
249 "Joint Stereo", 272 "Joint Stereo",
@@ -313,6 +336,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
313 return mpeg_audio_l2_bitrate; 336 return mpeg_audio_l2_bitrate;
314 case V4L2_CID_MPEG_AUDIO_L3_BITRATE: 337 case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
315 return mpeg_audio_l3_bitrate; 338 return mpeg_audio_l3_bitrate;
339 case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
340 return mpeg_audio_ac3_bitrate;
316 case V4L2_CID_MPEG_AUDIO_MODE: 341 case V4L2_CID_MPEG_AUDIO_MODE:
317 return mpeg_audio_mode; 342 return mpeg_audio_mode;
318 case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION: 343 case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
@@ -364,6 +389,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
364 case V4L2_CID_MPEG_AUDIO_L1_BITRATE: name = "Audio Layer I Bitrate"; break; 389 case V4L2_CID_MPEG_AUDIO_L1_BITRATE: name = "Audio Layer I Bitrate"; break;
365 case V4L2_CID_MPEG_AUDIO_L2_BITRATE: name = "Audio Layer II Bitrate"; break; 390 case V4L2_CID_MPEG_AUDIO_L2_BITRATE: name = "Audio Layer II Bitrate"; break;
366 case V4L2_CID_MPEG_AUDIO_L3_BITRATE: name = "Audio Layer III Bitrate"; break; 391 case V4L2_CID_MPEG_AUDIO_L3_BITRATE: name = "Audio Layer III Bitrate"; break;
392 case V4L2_CID_MPEG_AUDIO_AC3_BITRATE: name = "Audio AC-3 Bitrate"; break;
367 case V4L2_CID_MPEG_AUDIO_MODE: name = "Audio Stereo Mode"; break; 393 case V4L2_CID_MPEG_AUDIO_MODE: name = "Audio Stereo Mode"; break;
368 case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION: name = "Audio Stereo Mode Extension"; break; 394 case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION: name = "Audio Stereo Mode Extension"; break;
369 case V4L2_CID_MPEG_AUDIO_EMPHASIS: name = "Audio Emphasis"; break; 395 case V4L2_CID_MPEG_AUDIO_EMPHASIS: name = "Audio Emphasis"; break;
@@ -409,6 +435,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
409 case V4L2_CID_MPEG_AUDIO_L1_BITRATE: 435 case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
410 case V4L2_CID_MPEG_AUDIO_L2_BITRATE: 436 case V4L2_CID_MPEG_AUDIO_L2_BITRATE:
411 case V4L2_CID_MPEG_AUDIO_L3_BITRATE: 437 case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
438 case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
412 case V4L2_CID_MPEG_AUDIO_MODE: 439 case V4L2_CID_MPEG_AUDIO_MODE:
413 case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION: 440 case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
414 case V4L2_CID_MPEG_AUDIO_EMPHASIS: 441 case V4L2_CID_MPEG_AUDIO_EMPHASIS:
@@ -495,7 +522,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
495 case V4L2_CID_MPEG_AUDIO_ENCODING: 522 case V4L2_CID_MPEG_AUDIO_ENCODING:
496 return v4l2_ctrl_query_fill(qctrl, 523 return v4l2_ctrl_query_fill(qctrl,
497 V4L2_MPEG_AUDIO_ENCODING_LAYER_1, 524 V4L2_MPEG_AUDIO_ENCODING_LAYER_1,
498 V4L2_MPEG_AUDIO_ENCODING_AAC, 1, 525 V4L2_MPEG_AUDIO_ENCODING_AC3, 1,
499 V4L2_MPEG_AUDIO_ENCODING_LAYER_2); 526 V4L2_MPEG_AUDIO_ENCODING_LAYER_2);
500 case V4L2_CID_MPEG_AUDIO_L1_BITRATE: 527 case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
501 return v4l2_ctrl_query_fill(qctrl, 528 return v4l2_ctrl_query_fill(qctrl,
@@ -512,6 +539,11 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
512 V4L2_MPEG_AUDIO_L3_BITRATE_32K, 539 V4L2_MPEG_AUDIO_L3_BITRATE_32K,
513 V4L2_MPEG_AUDIO_L3_BITRATE_320K, 1, 540 V4L2_MPEG_AUDIO_L3_BITRATE_320K, 1,
514 V4L2_MPEG_AUDIO_L3_BITRATE_192K); 541 V4L2_MPEG_AUDIO_L3_BITRATE_192K);
542 case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
543 return v4l2_ctrl_query_fill(qctrl,
544 V4L2_MPEG_AUDIO_AC3_BITRATE_32K,
545 V4L2_MPEG_AUDIO_AC3_BITRATE_640K, 1,
546 V4L2_MPEG_AUDIO_AC3_BITRATE_384K);
515 case V4L2_CID_MPEG_AUDIO_MODE: 547 case V4L2_CID_MPEG_AUDIO_MODE:
516 return v4l2_ctrl_query_fill(qctrl, 548 return v4l2_ctrl_query_fill(qctrl,
517 V4L2_MPEG_AUDIO_MODE_STEREO, 549 V4L2_MPEG_AUDIO_MODE_STEREO,