diff options
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r-- | drivers/media/video/v4l2-common.c | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index caa7ba0705a5..dbced906aa06 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -588,151 +588,6 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste | |||
588 | } | 588 | } |
589 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); | 589 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); |
590 | 590 | ||
591 | /* Fill in a struct v4l2_queryctrl with standard values based on | ||
592 | the control ID. */ | ||
593 | int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl) | ||
594 | { | ||
595 | switch (qctrl->id) { | ||
596 | /* USER controls */ | ||
597 | case V4L2_CID_USER_CLASS: | ||
598 | case V4L2_CID_MPEG_CLASS: | ||
599 | case V4L2_CID_CAMERA_CLASS: | ||
600 | return v4l2_ctrl_query_fill(qctrl, 0, 0, 0, 0); | ||
601 | case V4L2_CID_AUDIO_VOLUME: | ||
602 | return v4l2_ctrl_query_fill(qctrl, 0, 65535, 65535 / 100, 58880); | ||
603 | case V4L2_CID_AUDIO_MUTE: | ||
604 | case V4L2_CID_AUDIO_LOUDNESS: | ||
605 | return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0); | ||
606 | case V4L2_CID_AUDIO_BALANCE: | ||
607 | case V4L2_CID_AUDIO_BASS: | ||
608 | case V4L2_CID_AUDIO_TREBLE: | ||
609 | return v4l2_ctrl_query_fill(qctrl, 0, 65535, 65535 / 100, 32768); | ||
610 | case V4L2_CID_BRIGHTNESS: | ||
611 | return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 128); | ||
612 | case V4L2_CID_CONTRAST: | ||
613 | case V4L2_CID_SATURATION: | ||
614 | return v4l2_ctrl_query_fill(qctrl, 0, 127, 1, 64); | ||
615 | case V4L2_CID_HUE: | ||
616 | return v4l2_ctrl_query_fill(qctrl, -128, 127, 1, 0); | ||
617 | case V4L2_CID_COLORFX: | ||
618 | return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0); | ||
619 | |||
620 | /* MPEG controls */ | ||
621 | case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: | ||
622 | return v4l2_ctrl_query_fill(qctrl, | ||
623 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100, | ||
624 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000, 1, | ||
625 | V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000); | ||
626 | case V4L2_CID_MPEG_AUDIO_ENCODING: | ||
627 | return v4l2_ctrl_query_fill(qctrl, | ||
628 | V4L2_MPEG_AUDIO_ENCODING_LAYER_1, | ||
629 | V4L2_MPEG_AUDIO_ENCODING_AC3, 1, | ||
630 | V4L2_MPEG_AUDIO_ENCODING_LAYER_2); | ||
631 | case V4L2_CID_MPEG_AUDIO_L1_BITRATE: | ||
632 | return v4l2_ctrl_query_fill(qctrl, | ||
633 | V4L2_MPEG_AUDIO_L1_BITRATE_32K, | ||
634 | V4L2_MPEG_AUDIO_L1_BITRATE_448K, 1, | ||
635 | V4L2_MPEG_AUDIO_L1_BITRATE_256K); | ||
636 | case V4L2_CID_MPEG_AUDIO_L2_BITRATE: | ||
637 | return v4l2_ctrl_query_fill(qctrl, | ||
638 | V4L2_MPEG_AUDIO_L2_BITRATE_32K, | ||
639 | V4L2_MPEG_AUDIO_L2_BITRATE_384K, 1, | ||
640 | V4L2_MPEG_AUDIO_L2_BITRATE_224K); | ||
641 | case V4L2_CID_MPEG_AUDIO_L3_BITRATE: | ||
642 | return v4l2_ctrl_query_fill(qctrl, | ||
643 | V4L2_MPEG_AUDIO_L3_BITRATE_32K, | ||
644 | V4L2_MPEG_AUDIO_L3_BITRATE_320K, 1, | ||
645 | V4L2_MPEG_AUDIO_L3_BITRATE_192K); | ||
646 | case V4L2_CID_MPEG_AUDIO_AAC_BITRATE: | ||
647 | return v4l2_ctrl_query_fill(qctrl, 0, 6400, 1, 3200000); | ||
648 | case V4L2_CID_MPEG_AUDIO_AC3_BITRATE: | ||
649 | return v4l2_ctrl_query_fill(qctrl, | ||
650 | V4L2_MPEG_AUDIO_AC3_BITRATE_32K, | ||
651 | V4L2_MPEG_AUDIO_AC3_BITRATE_640K, 1, | ||
652 | V4L2_MPEG_AUDIO_AC3_BITRATE_384K); | ||
653 | case V4L2_CID_MPEG_AUDIO_MODE: | ||
654 | return v4l2_ctrl_query_fill(qctrl, | ||
655 | V4L2_MPEG_AUDIO_MODE_STEREO, | ||
656 | V4L2_MPEG_AUDIO_MODE_MONO, 1, | ||
657 | V4L2_MPEG_AUDIO_MODE_STEREO); | ||
658 | case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION: | ||
659 | return v4l2_ctrl_query_fill(qctrl, | ||
660 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4, | ||
661 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16, 1, | ||
662 | V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4); | ||
663 | case V4L2_CID_MPEG_AUDIO_EMPHASIS: | ||
664 | return v4l2_ctrl_query_fill(qctrl, | ||
665 | V4L2_MPEG_AUDIO_EMPHASIS_NONE, | ||
666 | V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17, 1, | ||
667 | V4L2_MPEG_AUDIO_EMPHASIS_NONE); | ||
668 | case V4L2_CID_MPEG_AUDIO_CRC: | ||
669 | return v4l2_ctrl_query_fill(qctrl, | ||
670 | V4L2_MPEG_AUDIO_CRC_NONE, | ||
671 | V4L2_MPEG_AUDIO_CRC_CRC16, 1, | ||
672 | V4L2_MPEG_AUDIO_CRC_NONE); | ||
673 | case V4L2_CID_MPEG_AUDIO_MUTE: | ||
674 | return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0); | ||
675 | case V4L2_CID_MPEG_VIDEO_ENCODING: | ||
676 | return v4l2_ctrl_query_fill(qctrl, | ||
677 | V4L2_MPEG_VIDEO_ENCODING_MPEG_1, | ||
678 | V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 1, | ||
679 | V4L2_MPEG_VIDEO_ENCODING_MPEG_2); | ||
680 | case V4L2_CID_MPEG_VIDEO_ASPECT: | ||
681 | return v4l2_ctrl_query_fill(qctrl, | ||
682 | V4L2_MPEG_VIDEO_ASPECT_1x1, | ||
683 | V4L2_MPEG_VIDEO_ASPECT_221x100, 1, | ||
684 | V4L2_MPEG_VIDEO_ASPECT_4x3); | ||
685 | case V4L2_CID_MPEG_VIDEO_B_FRAMES: | ||
686 | return v4l2_ctrl_query_fill(qctrl, 0, 33, 1, 2); | ||
687 | case V4L2_CID_MPEG_VIDEO_GOP_SIZE: | ||
688 | return v4l2_ctrl_query_fill(qctrl, 1, 34, 1, 12); | ||
689 | case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE: | ||
690 | return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 1); | ||
691 | case V4L2_CID_MPEG_VIDEO_PULLDOWN: | ||
692 | return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0); | ||
693 | case V4L2_CID_MPEG_VIDEO_BITRATE_MODE: | ||
694 | return v4l2_ctrl_query_fill(qctrl, | ||
695 | V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, | ||
696 | V4L2_MPEG_VIDEO_BITRATE_MODE_CBR, 1, | ||
697 | V4L2_MPEG_VIDEO_BITRATE_MODE_VBR); | ||
698 | case V4L2_CID_MPEG_VIDEO_BITRATE: | ||
699 | return v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 6000000); | ||
700 | case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK: | ||
701 | return v4l2_ctrl_query_fill(qctrl, 0, 27000000, 1, 8000000); | ||
702 | case V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION: | ||
703 | return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0); | ||
704 | case V4L2_CID_MPEG_VIDEO_MUTE: | ||
705 | return v4l2_ctrl_query_fill(qctrl, 0, 1, 1, 0); | ||
706 | case V4L2_CID_MPEG_VIDEO_MUTE_YUV: /* Init YUV (really YCbCr) to black */ | ||
707 | return v4l2_ctrl_query_fill(qctrl, 0, 0xffffff, 1, 0x008080); | ||
708 | case V4L2_CID_MPEG_STREAM_TYPE: | ||
709 | return v4l2_ctrl_query_fill(qctrl, | ||
710 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS, | ||
711 | V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD, 1, | ||
712 | V4L2_MPEG_STREAM_TYPE_MPEG2_PS); | ||
713 | case V4L2_CID_MPEG_STREAM_PID_PMT: | ||
714 | return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 16); | ||
715 | case V4L2_CID_MPEG_STREAM_PID_AUDIO: | ||
716 | return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 260); | ||
717 | case V4L2_CID_MPEG_STREAM_PID_VIDEO: | ||
718 | return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 256); | ||
719 | case V4L2_CID_MPEG_STREAM_PID_PCR: | ||
720 | return v4l2_ctrl_query_fill(qctrl, 0, (1 << 14) - 1, 1, 259); | ||
721 | case V4L2_CID_MPEG_STREAM_PES_ID_AUDIO: | ||
722 | return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0); | ||
723 | case V4L2_CID_MPEG_STREAM_PES_ID_VIDEO: | ||
724 | return v4l2_ctrl_query_fill(qctrl, 0, 255, 1, 0); | ||
725 | case V4L2_CID_MPEG_STREAM_VBI_FMT: | ||
726 | return v4l2_ctrl_query_fill(qctrl, | ||
727 | V4L2_MPEG_STREAM_VBI_FMT_NONE, | ||
728 | V4L2_MPEG_STREAM_VBI_FMT_IVTV, 1, | ||
729 | V4L2_MPEG_STREAM_VBI_FMT_NONE); | ||
730 | default: | ||
731 | return -EINVAL; | ||
732 | } | ||
733 | } | ||
734 | EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); | ||
735 | |||
736 | /* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and | 591 | /* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and |
737 | the menu. The qctrl pointer may be NULL, in which case it is ignored. | 592 | the menu. The qctrl pointer may be NULL, in which case it is ignored. |
738 | If menu_items is NULL, then the menu items are retrieved using | 593 | If menu_items is NULL, then the menu items are retrieved using |