From b397b28b31e8a57b71f90ef31dbdafad25fd5820 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 16 Mar 2009 17:12:29 +0000 Subject: Add TVI_CONTROL_VID_SET_WIDTH_HEIGHT to set width and height together for v4l2, otherwise some drivers will always stay stuck in the lowest resolution. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28975 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_v4l2.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'stream/tvi_v4l2.c') diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c index a5485bf07f..c890d7a51e 100644 --- a/stream/tvi_v4l2.c +++ b/stream/tvi_v4l2.c @@ -780,6 +780,14 @@ static int control(priv_t *priv, int cmd, void *arg) return TVI_CONTROL_TRUE; case TVI_CONTROL_VID_CHK_WIDTH: return TVI_CONTROL_TRUE; + case TVI_CONTROL_VID_SET_WIDTH_HEIGHT: + if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; + priv->format.fmt.pix.width = ((int *)arg)[0]; + priv->format.fmt.pix.height = ((int *)arg)[1]; + priv->format.fmt.pix.field = V4L2_FIELD_ANY; + if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) + return TVI_CONTROL_FALSE; + return TVI_CONTROL_TRUE; case TVI_CONTROL_VID_SET_WIDTH: if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; priv->format.fmt.pix.width = *(int *)arg; -- cgit v1.2.3