Mercurial > mplayer.hg
comparison stream/tvi_v4l2.c @ 28940:7406e7f30d4e
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.
author | reimar |
---|---|
date | Mon, 16 Mar 2009 17:12:29 +0000 |
parents | 8f7c8a1cb8b7 |
children | bae666342ba9 |
comparison
equal
deleted
inserted
replaced
28939:cbf56e4c9662 | 28940:7406e7f30d4e |
---|---|
778 mp_msg(MSGT_TV, MSGL_V, "%s: get width: %d\n", info.short_name, | 778 mp_msg(MSGT_TV, MSGL_V, "%s: get width: %d\n", info.short_name, |
779 *(int *)arg); | 779 *(int *)arg); |
780 return TVI_CONTROL_TRUE; | 780 return TVI_CONTROL_TRUE; |
781 case TVI_CONTROL_VID_CHK_WIDTH: | 781 case TVI_CONTROL_VID_CHK_WIDTH: |
782 return TVI_CONTROL_TRUE; | 782 return TVI_CONTROL_TRUE; |
783 case TVI_CONTROL_VID_SET_WIDTH_HEIGHT: | |
784 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; | |
785 priv->format.fmt.pix.width = ((int *)arg)[0]; | |
786 priv->format.fmt.pix.height = ((int *)arg)[1]; | |
787 priv->format.fmt.pix.field = V4L2_FIELD_ANY; | |
788 if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) | |
789 return TVI_CONTROL_FALSE; | |
790 return TVI_CONTROL_TRUE; | |
783 case TVI_CONTROL_VID_SET_WIDTH: | 791 case TVI_CONTROL_VID_SET_WIDTH: |
784 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; | 792 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; |
785 priv->format.fmt.pix.width = *(int *)arg; | 793 priv->format.fmt.pix.width = *(int *)arg; |
786 mp_msg(MSGT_TV, MSGL_V, "%s: set width: %d\n", info.short_name, | 794 mp_msg(MSGT_TV, MSGL_V, "%s: set width: %d\n", info.short_name, |
787 *(int *)arg); | 795 *(int *)arg); |