From 419f2d205280e6bf50b482762f8bc2d41a89817d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 28 Sep 2002 11:05:39 +0000 Subject: I'm such an idiot - these files should have been in a week ago Original commit message from CVS: I'm such an idiot - these files should have been in a week ago --- sys/v4l2/v4l2-overlay_calls.c | 73 ++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 50 deletions(-) (limited to 'sys/v4l2/v4l2-overlay_calls.c') diff --git a/sys/v4l2/v4l2-overlay_calls.c b/sys/v4l2/v4l2-overlay_calls.c index c8ee053c..7eecb49d 100644 --- a/sys/v4l2/v4l2-overlay_calls.c +++ b/sys/v4l2/v4l2-overlay_calls.c @@ -74,26 +74,6 @@ gst_v4l2_set_display (GstV4l2Element *v4l2element, } -/****************************************************** - * gst_v4l2_set_vwin(): - * does the VIDIOC_S_WIN ioctl() - * return value: TRUE on success, FALSE on error - ******************************************************/ - -static gboolean -gst_v4l2_set_vwin (GstV4l2Element *v4l2element) -{ - if (ioctl(v4l2element->video_fd, VIDIOC_S_WIN, &(v4l2element->vwin)) < 0) { - gst_element_error(GST_ELEMENT(v4l2element), - "Failed to set the video window on device %s: %s", - v4l2element->device, sys_errlist[errno]); - return FALSE; - } - - return TRUE; -} - - /****************************************************** * gst_v4l2_set_window(): * sets the window where to display the video overlay @@ -101,43 +81,36 @@ gst_v4l2_set_vwin (GstV4l2Element *v4l2element) ******************************************************/ gboolean -gst_v4l2_set_window (GstV4l2Element *v4l2element, - gint x, gint y, - gint w, gint h) +gst_v4l2_set_window (GstV4l2Element *v4l2element, + gint x, + gint y, + gint w, + gint h, + struct v4l2_clip *clips, + gint num_clips) { + struct v4l2_window vwin; + DEBUG("trying to set video window to %dx%d,%d,%d", x,y,w,h); GST_V4L2_CHECK_OVERLAY(v4l2element); GST_V4L2_CHECK_OPEN(v4l2element); - v4l2element->vwin.clipcount = 0; - v4l2element->vwin.x = x; - v4l2element->vwin.y = y; - v4l2element->vwin.width = w; - v4l2element->vwin.height = h; - - return gst_v4l2_set_vwin(v4l2element); -} - + vwin.clipcount = 0; + vwin.x = x; + vwin.y = y; + vwin.width = w; + vwin.height = h; + vwin.clips = clips; + vwin.clipcount = num_clips; -/****************************************************** - * gst_v4l_set_clips(): - * sets video overlay clips - * return value: TRUE on success, FALSE on error - ******************************************************/ - -gboolean -gst_v4l2_set_clips (GstV4l2Element *v4l2element, - struct v4l2_clip *clips, - gint num_clips) -{ - DEBUG("trying to set video clipping information"); - GST_V4L2_CHECK_OPEN(v4l2element); - GST_V4L2_CHECK_OVERLAY(v4l2element); - - v4l2element->vwin.clips = clips; - v4l2element->vwin.clipcount = num_clips; + if (ioctl(v4l2element->video_fd, VIDIOC_S_WIN, &vwin) < 0) { + gst_element_error(GST_ELEMENT(v4l2element), + "Failed to set the video window on device %s: %s", + v4l2element->device, sys_errlist[errno]); + return FALSE; + } - return gst_v4l2_set_vwin(v4l2element); + return TRUE; } -- cgit v1.2.1