mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 19:20:35 +00:00
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
This commit is contained in:
parent
6de50e694b
commit
419f2d2052
5 changed files with 30 additions and 92 deletions
|
@ -61,7 +61,6 @@ enum {
|
|||
ARG_DEVICE_HAS_CODEC,
|
||||
ARG_DISPLAY,
|
||||
ARG_VIDEOWINDOW,
|
||||
ARG_CLIPPING,
|
||||
ARG_DO_OVERLAY,
|
||||
};
|
||||
|
||||
|
@ -185,9 +184,6 @@ gst_v4l2element_class_init (GstV4l2ElementClass *klass)
|
|||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_VIDEOWINDOW,
|
||||
g_param_spec_pointer("videowindow","videowindow","videowindow",
|
||||
G_PARAM_WRITABLE));
|
||||
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CLIPPING,
|
||||
g_param_spec_pointer("videowindowclip","videowindowclip","videowindowclip",
|
||||
G_PARAM_WRITABLE));
|
||||
|
||||
gobject_class->set_property = gst_v4l2element_set_property;
|
||||
gobject_class->get_property = gst_v4l2element_get_property;
|
||||
|
@ -278,28 +274,11 @@ gst_v4l2element_set_property (GObject *object,
|
|||
break;
|
||||
case ARG_VIDEOWINDOW:
|
||||
if (GST_V4L2_IS_OPEN(v4l2element)) {
|
||||
GByteArray *array = (GByteArray *) g_value_get_pointer(value);
|
||||
struct v4l2_clip *clips = (struct v4l2_clip *) array->data;
|
||||
gst_v4l2_set_window(v4l2element,
|
||||
((GstV4l2Rect*)g_value_get_pointer(value))->x,
|
||||
((GstV4l2Rect*)g_value_get_pointer(value))->y,
|
||||
((GstV4l2Rect*)g_value_get_pointer(value))->w,
|
||||
((GstV4l2Rect*)g_value_get_pointer(value))->h);
|
||||
}
|
||||
break;
|
||||
case ARG_CLIPPING:
|
||||
if (GST_V4L2_IS_OPEN(v4l2element)) {
|
||||
gint i;
|
||||
struct v4l2_clip *clips;
|
||||
GList *list = (GList*)g_value_get_pointer(value);
|
||||
clips = g_malloc(sizeof(struct v4l2_clip) * g_list_length(list));
|
||||
for (i=0;i<g_list_length(list);i++)
|
||||
{
|
||||
clips[i].x = ((GstV4l2Rect*)g_list_nth_data(list, i))->x;
|
||||
clips[i].y = ((GstV4l2Rect*)g_list_nth_data(list, i))->y;
|
||||
clips[i].width = ((GstV4l2Rect*)g_list_nth_data(list, i))->w;
|
||||
clips[i].height = ((GstV4l2Rect*)g_list_nth_data(list, i))->h;
|
||||
}
|
||||
gst_v4l2_set_clips(v4l2element, clips, g_list_length(list));
|
||||
g_free(clips);
|
||||
clips->x, clips->y, clips->width, clips->height,
|
||||
&clips[1], array->len/sizeof(struct v4l2_clip)-1);
|
||||
}
|
||||
break;
|
||||
case ARG_DO_OVERLAY:
|
||||
|
|
|
@ -90,9 +90,6 @@ struct _GstV4l2Element {
|
|||
GList /*v4l2_queryctrl*/ *controls;
|
||||
GList /*GList:v4l2_querymenu*/ *menus;
|
||||
|
||||
/* and last but not least, the current video window */
|
||||
struct v4l2_window vwin;
|
||||
|
||||
/* caching values */
|
||||
gint channel;
|
||||
gint output;
|
||||
|
|
|
@ -75,15 +75,35 @@ gst_v4l2_set_display (GstV4l2Element *v4l2element,
|
|||
|
||||
|
||||
/******************************************************
|
||||
* gst_v4l2_set_vwin():
|
||||
* does the VIDIOC_S_WIN ioctl()
|
||||
* gst_v4l2_set_window():
|
||||
* sets the window where to display the video overlay
|
||||
* return value: TRUE on success, FALSE on error
|
||||
******************************************************/
|
||||
|
||||
static gboolean
|
||||
gst_v4l2_set_vwin (GstV4l2Element *v4l2element)
|
||||
gboolean
|
||||
gst_v4l2_set_window (GstV4l2Element *v4l2element,
|
||||
gint x,
|
||||
gint y,
|
||||
gint w,
|
||||
gint h,
|
||||
struct v4l2_clip *clips,
|
||||
gint num_clips)
|
||||
{
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_S_WIN, &(v4l2element->vwin)) < 0) {
|
||||
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);
|
||||
|
||||
vwin.clipcount = 0;
|
||||
vwin.x = x;
|
||||
vwin.y = y;
|
||||
vwin.width = w;
|
||||
vwin.height = h;
|
||||
vwin.clips = clips;
|
||||
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]);
|
||||
|
@ -94,53 +114,6 @@ gst_v4l2_set_vwin (GstV4l2Element *v4l2element)
|
|||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* gst_v4l2_set_window():
|
||||
* sets the window where to display the video overlay
|
||||
* return value: TRUE on success, FALSE on error
|
||||
******************************************************/
|
||||
|
||||
gboolean
|
||||
gst_v4l2_set_window (GstV4l2Element *v4l2element,
|
||||
gint x, gint y,
|
||||
gint w, gint h)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* 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;
|
||||
|
||||
return gst_v4l2_set_vwin(v4l2element);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* gst_v4l_set_overlay():
|
||||
* enables/disables actual video overlay display
|
||||
|
|
|
@ -270,16 +270,6 @@ gst_v4l2_open (GstV4l2Element *v4l2element)
|
|||
goto error;
|
||||
}
|
||||
|
||||
/* and get the video window */
|
||||
if (GST_V4L2_IS_OVERLAY(v4l2element)) {
|
||||
if (ioctl(v4l2element->video_fd, VIDIOC_G_WIN, &(v4l2element->vwin)) < 0) {
|
||||
gst_element_error(GST_ELEMENT(v4l2element),
|
||||
"Failed to get video window properties of %s: %s",
|
||||
v4l2element->device, sys_errlist[errno]);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/* create enumerations */
|
||||
if (!gst_v4l2_fill_lists(v4l2element))
|
||||
goto error;
|
||||
|
|
|
@ -125,8 +125,7 @@ gboolean gst_v4l2_set_display (GstV4l2Element *v4l2element,
|
|||
const gchar *display);
|
||||
gboolean gst_v4l2_set_window (GstV4l2Element *v4l2element,
|
||||
gint x, gint y,
|
||||
gint w, gint h);
|
||||
gboolean gst_v4l2_set_clips (GstV4l2Element *v4l2element,
|
||||
gint w, gint h,
|
||||
struct v4l2_clip *clips,
|
||||
gint num_clips);
|
||||
gboolean gst_v4l2_enable_overlay (GstV4l2Element *v4l2element,
|
||||
|
|
Loading…
Reference in a new issue