mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
v4l2: use the xoverlay APIs
This commit is contained in:
parent
720369c06e
commit
672bfc3369
2 changed files with 10 additions and 9 deletions
|
@ -127,7 +127,7 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
|
|||
v4l2object->xv = v4l2xv;
|
||||
|
||||
if (v4l2object->xwindow_id) {
|
||||
gst_v4l2_xoverlay_set_xwindow_id (v4l2object, v4l2object->xwindow_id);
|
||||
gst_v4l2_xoverlay_set_window_handle (v4l2object, v4l2object->xwindow_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ gst_v4l2_xoverlay_close (GstV4l2Object * v4l2object)
|
|||
return;
|
||||
|
||||
if (v4l2object->xwindow_id) {
|
||||
gst_v4l2_xoverlay_set_xwindow_id (v4l2object, 0);
|
||||
gst_v4l2_xoverlay_set_window_handle (v4l2object, 0);
|
||||
}
|
||||
|
||||
XCloseDisplay (v4l2xv->dpy);
|
||||
|
@ -189,10 +189,11 @@ idle_refresh (gpointer data)
|
|||
}
|
||||
|
||||
void
|
||||
gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object, XID xwindow_id)
|
||||
gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id)
|
||||
{
|
||||
GstV4l2Xv *v4l2xv;
|
||||
XWindowAttributes attr;
|
||||
XID xwindow_id = id;
|
||||
gboolean change = (v4l2object->xwindow_id != xwindow_id);
|
||||
|
||||
GST_LOG_OBJECT (v4l2object->element, "Setting XID to %lx",
|
||||
|
|
|
@ -37,25 +37,25 @@ void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object);
|
|||
void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object);
|
||||
|
||||
void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
|
||||
void gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object,
|
||||
XID xwindow_id);
|
||||
void gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object,
|
||||
guintptr id);
|
||||
|
||||
|
||||
#define GST_IMPLEMENT_V4L2_XOVERLAY_METHODS(Type, interface_as_function) \
|
||||
\
|
||||
static void \
|
||||
interface_as_function ## _xoverlay_set_xwindow_id (GstXOverlay * xoverlay, \
|
||||
XID xwindow_id) \
|
||||
interface_as_function ## _xoverlay_set_window_handle (GstXOverlay * xoverlay, \
|
||||
guintptr id) \
|
||||
{ \
|
||||
Type *this = (Type*) xoverlay; \
|
||||
gst_v4l2_xoverlay_set_xwindow_id (this->v4l2object, xwindow_id); \
|
||||
gst_v4l2_xoverlay_set_window_handle (this->v4l2object, id); \
|
||||
} \
|
||||
\
|
||||
static void \
|
||||
interface_as_function ## _xoverlay_interface_init (GstXOverlayClass * klass) \
|
||||
{ \
|
||||
/* default virtual functions */ \
|
||||
klass->set_xwindow_id = interface_as_function ## _xoverlay_set_xwindow_id; \
|
||||
klass->set_window_handle = interface_as_function ## _xoverlay_set_window_handle; \
|
||||
\
|
||||
gst_v4l2_xoverlay_interface_init(klass); \
|
||||
} \
|
||||
|
|
Loading…
Reference in a new issue