[PATCH 14/18] media: allegro: handle dependency of bitrate and bitrate_peak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The peak bitrate must not be smaller than the configured bitrate. Update
the other control whenever one of the controls changes to reflect this
dependency.

Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
---
 drivers/staging/media/allegro-dvt/allegro-core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c
index 8c26158eab93..cedb09ea649f 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -2403,9 +2403,15 @@ static int allegro_s_ctrl(struct v4l2_ctrl *ctrl)
 		break;
 	case V4L2_CID_MPEG_VIDEO_BITRATE:
 		channel->bitrate = ctrl->val;
+		if (channel->bitrate > channel->bitrate_peak)
+			__v4l2_ctrl_s_ctrl(channel->mpeg_video_bitrate_peak,
+					   channel->bitrate);
 		break;
 	case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
 		channel->bitrate_peak = ctrl->val;
+		if (channel->bitrate_peak < channel->bitrate)
+			__v4l2_ctrl_s_ctrl(channel->mpeg_video_bitrate,
+					   channel->bitrate_peak);
 		break;
 	case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE:
 		channel->cpb_size = ctrl->val;
-- 
2.20.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux