diff options
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index eca36b8539fa..fac67d98a745 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -781,6 +781,7 @@ static const int BITRATES_SIZE = ARRAY_SIZE(mpeg_audio_bitrates); | |||
781 | static void blackbird_set_default_params(struct cx8802_dev *dev) | 781 | static void blackbird_set_default_params(struct cx8802_dev *dev) |
782 | { | 782 | { |
783 | struct v4l2_mpeg_compression *params = &dev->params; | 783 | struct v4l2_mpeg_compression *params = &dev->params; |
784 | u32 au_params; | ||
784 | 785 | ||
785 | /* assign stream type */ | 786 | /* assign stream type */ |
786 | if( params->st_type >= ARRAY_SIZE(mpeg_stream_types) ) | 787 | if( params->st_type >= ARRAY_SIZE(mpeg_stream_types) ) |
@@ -827,7 +828,7 @@ static void blackbird_set_default_params(struct cx8802_dev *dev) | |||
827 | 828 | ||
828 | /* assign audio properties */ | 829 | /* assign audio properties */ |
829 | /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ | 830 | /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ |
830 | u32 au_params = BLACKBIRD_AUDIO_BITS_STEREO | | 831 | au_params = BLACKBIRD_AUDIO_BITS_STEREO | |
831 | /* BLACKBIRD_AUDIO_BITS_BOUND_4 | */ | 832 | /* BLACKBIRD_AUDIO_BITS_BOUND_4 | */ |
832 | BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE | | 833 | BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE | |
833 | BLACKBIRD_AUDIO_BITS_CRC_OFF | | 834 | BLACKBIRD_AUDIO_BITS_CRC_OFF | |
@@ -861,12 +862,14 @@ static void blackbird_set_default_params(struct cx8802_dev *dev) | |||
861 | } | 862 | } |
862 | if( params->au_bitrate.mode ) | 863 | if( params->au_bitrate.mode ) |
863 | { | 864 | { |
865 | int layer; | ||
866 | |||
864 | if( params->au_bitrate.mode == V4L2_BITRATE_CBR ) | 867 | if( params->au_bitrate.mode == V4L2_BITRATE_CBR ) |
865 | params->au_bitrate.max = params->vi_bitrate.target; | 868 | params->au_bitrate.max = params->vi_bitrate.target; |
866 | else | 869 | else |
867 | params->au_bitrate.target = params->vi_bitrate.max; | 870 | params->au_bitrate.target = params->vi_bitrate.max; |
868 | 871 | ||
869 | int layer = params->au_type; | 872 | layer = params->au_type; |
870 | if( params->au_bitrate.target == 0 ) | 873 | if( params->au_bitrate.target == 0 ) |
871 | { | 874 | { |
872 | /* TODO: use the minimum possible bitrate instead of 0 ? */ | 875 | /* TODO: use the minimum possible bitrate instead of 0 ? */ |
@@ -946,6 +949,8 @@ static void blackbird_set_default_params(struct cx8802_dev *dev) | |||
946 | #define UPDATE_PARAM( name ) dev->params.name = params->name | 949 | #define UPDATE_PARAM( name ) dev->params.name = params->name |
947 | void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression *params) | 950 | void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression *params) |
948 | { | 951 | { |
952 | u32 au_params; | ||
953 | |||
949 | /* assign stream type */ | 954 | /* assign stream type */ |
950 | if( params->st_type >= ARRAY_SIZE(mpeg_stream_types) ) | 955 | if( params->st_type >= ARRAY_SIZE(mpeg_stream_types) ) |
951 | params->st_type = V4L2_MPEG_PS_2; | 956 | params->st_type = V4L2_MPEG_PS_2; |
@@ -1015,7 +1020,7 @@ void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression * | |||
1015 | 1020 | ||
1016 | /* assign audio properties */ | 1021 | /* assign audio properties */ |
1017 | /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ | 1022 | /* note: it's not necessary to set the samplerate, the mpeg encoder seems to autodetect/adjust */ |
1018 | u32 au_params = BLACKBIRD_AUDIO_BITS_STEREO | | 1023 | au_params = BLACKBIRD_AUDIO_BITS_STEREO | |
1019 | /* BLACKBIRD_AUDIO_BITS_BOUND_4 | */ | 1024 | /* BLACKBIRD_AUDIO_BITS_BOUND_4 | */ |
1020 | BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE | | 1025 | BLACKBIRD_AUDIO_BITS_EMPHASIS_NONE | |
1021 | BLACKBIRD_AUDIO_BITS_CRC_OFF | | 1026 | BLACKBIRD_AUDIO_BITS_CRC_OFF | |
@@ -1049,12 +1054,14 @@ void blackbird_set_params(struct cx8802_dev *dev, struct v4l2_mpeg_compression * | |||
1049 | } | 1054 | } |
1050 | if( params->au_bitrate.mode ) | 1055 | if( params->au_bitrate.mode ) |
1051 | { | 1056 | { |
1057 | int layer; | ||
1058 | |||
1052 | if( params->au_bitrate.mode == V4L2_BITRATE_CBR ) | 1059 | if( params->au_bitrate.mode == V4L2_BITRATE_CBR ) |
1053 | params->au_bitrate.max = params->vi_bitrate.target; | 1060 | params->au_bitrate.max = params->vi_bitrate.target; |
1054 | else | 1061 | else |
1055 | params->au_bitrate.target = params->vi_bitrate.max; | 1062 | params->au_bitrate.target = params->vi_bitrate.max; |
1056 | 1063 | ||
1057 | int layer = params->au_type; | 1064 | layer = params->au_type; |
1058 | if( params->au_bitrate.target == 0 ) | 1065 | if( params->au_bitrate.target == 0 ) |
1059 | { | 1066 | { |
1060 | /* TODO: use the minimum possible bitrate instead of 0 ? */ | 1067 | /* TODO: use the minimum possible bitrate instead of 0 ? */ |