From: Javier Viguera Date: Tue, 13 Mar 2012 19:05:39 +0100 Subject: [PATCH] gplay_rotate * Fix 'rotate' gplay command Signed-off-by: Javier Viguera --- src/misc/v4l_sink/src/mfw_gst_v4l.c | 5 ++++- src/misc/v4l_sink/src/mfw_gst_v4lsink.c | 1 + src/misc/v4l_sink/src/mfw_gst_v4lsink.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/misc/v4l_sink/src/mfw_gst_v4l.c b/src/misc/v4l_sink/src/mfw_gst_v4l.c index d773f6a..cb999d2 100755 --- a/src/misc/v4l_sink/src/mfw_gst_v4l.c +++ b/src/misc/v4l_sink/src/mfw_gst_v4l.c @@ -845,6 +845,7 @@ mfw_gst_v4l2_set_rotation (MFW_GST_V4LSINK_INFO_T * v4l_info) /* Set the rotation */ ctrl.id = V4L2_CID_PRIVATE_BASE; ctrl.value = v4l_info->rotate; + v4l_info->changedRotate = (v4l_info->prevRotate != v4l_info->rotate) ? TRUE : FALSE; v4l_info->prevRotate = v4l_info->rotate; if (ioctl (v4l_info->v4l_id, VIDIOC_S_CTRL, &ctrl) < 0) { GST_ERROR ("set ctrl failed"); @@ -1288,7 +1289,7 @@ mfw_gst_v4l2_set_crop (MFW_GST_V4LSINK_INFO_T * v4l_info, crop->c.left, crop->c.top, crop->c.width, crop->c.height); if ((!memcmp (crop, prevCrop, sizeof (struct v4l2_crop))) - && (v4l_info->rotate == v4l_info->prevRotate)) { + && !v4l_info->changedRotate) { // mfw_gst_v4l2_streamoff(v4l_info); return FALSE; @@ -1303,6 +1304,8 @@ mfw_gst_v4l2_set_crop (MFW_GST_V4LSINK_INFO_T * v4l_info, } + /* Reset changedRotate flag */ + v4l_info->changedRotate = FALSE; if (ioctl (v4l_info->v4l_id, VIDIOC_S_CROP, crop) < 0) { GST_ERROR ("set crop failed"); diff --git a/src/misc/v4l_sink/src/mfw_gst_v4lsink.c b/src/misc/v4l_sink/src/mfw_gst_v4lsink.c index d7943c1..e4f6aa0 100755 --- a/src/misc/v4l_sink/src/mfw_gst_v4lsink.c +++ b/src/misc/v4l_sink/src/mfw_gst_v4lsink.c @@ -1540,6 +1540,7 @@ mfw_gst_v4lsink_init (MFW_GST_V4LSINK_INFO_T * v4l_info, v4l_info->axis_left = 0; v4l_info->rotate = 0; v4l_info->prevRotate = 0; + v4l_info->changedRotate = FALSE; v4l_info->crop_left = 0; v4l_info->crop_top = 0; diff --git a/src/misc/v4l_sink/src/mfw_gst_v4lsink.h b/src/misc/v4l_sink/src/mfw_gst_v4lsink.h index 28cd6b7..159d3e7 100755 --- a/src/misc/v4l_sink/src/mfw_gst_v4lsink.h +++ b/src/misc/v4l_sink/src/mfw_gst_v4lsink.h @@ -255,6 +255,7 @@ typedef struct MFW_GST_V4LSINK_INFO_S gint axis_left; /* diplay left co-ordinate */ gint rotate; /* display rotate angle */ gint prevRotate; /* Previous display rotate angle */ + gboolean changedRotate; /* There was a rotation change */ gint v4l_id; /* device ID */ gint cr_left_bypixel; /* crop left offset set by decoder in caps */ gint cr_right_bypixel; /* crop right offset set by decoder in caps */