summaryrefslogtreecommitdiffstats
path: root/stream/tvi_v4l2.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-01 02:26:34 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-04-01 02:43:47 +0300
commitcf9edda1d370d39bc8a3d020a9c2bc4090d2457e (patch)
tree1d1bbc529a4e8109fb6aa5cadf0dbbb7bd61013a /stream/tvi_v4l2.c
parent7af8417ae7beb409f54849956a7037bc66c4c334 (diff)
parent1c37a6427abef0827c608d328d37ca1b1a0a022d (diff)
downloadmpv-cf9edda1d370d39bc8a3d020a9c2bc4090d2457e.tar.bz2
mpv-cf9edda1d370d39bc8a3d020a9c2bc4090d2457e.tar.xz
Merge svn changes up to r29117
Diffstat (limited to 'stream/tvi_v4l2.c')
-rw-r--r--stream/tvi_v4l2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/stream/tvi_v4l2.c b/stream/tvi_v4l2.c
index 0742135740..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;
@@ -1126,7 +1134,7 @@ static int uninit(priv_t *priv)
struct v4l2_buffer buf;
/* get performance */
- frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / (1e6 * getfps(priv)));
+ frames = 1 + lrintf((double)(priv->curr_frame - priv->first_frame) / 1e6 * getfps(priv));
dropped = frames - priv->frames;
/* turn off streaming */