v4l2: use the xoverlay APIs

This commit is contained in:
Philippe Normand 2010-09-21 12:49:31 +02:00 committed by Edward Hervey
parent 720369c06e
commit 672bfc3369
2 changed files with 10 additions and 9 deletions

View file

@ -127,7 +127,7 @@ gst_v4l2_xoverlay_open (GstV4l2Object * v4l2object)
v4l2object->xv = v4l2xv; v4l2object->xv = v4l2xv;
if (v4l2object->xwindow_id) { 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; return;
if (v4l2object->xwindow_id) { if (v4l2object->xwindow_id) {
gst_v4l2_xoverlay_set_xwindow_id (v4l2object, 0); gst_v4l2_xoverlay_set_window_handle (v4l2object, 0);
} }
XCloseDisplay (v4l2xv->dpy); XCloseDisplay (v4l2xv->dpy);
@ -189,10 +189,11 @@ idle_refresh (gpointer data)
} }
void void
gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object, XID xwindow_id) gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id)
{ {
GstV4l2Xv *v4l2xv; GstV4l2Xv *v4l2xv;
XWindowAttributes attr; XWindowAttributes attr;
XID xwindow_id = id;
gboolean change = (v4l2object->xwindow_id != xwindow_id); gboolean change = (v4l2object->xwindow_id != xwindow_id);
GST_LOG_OBJECT (v4l2object->element, "Setting XID to %lx", GST_LOG_OBJECT (v4l2object->element, "Setting XID to %lx",

View file

@ -37,25 +37,25 @@ void gst_v4l2_xoverlay_start (GstV4l2Object *v4l2object);
void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object); void gst_v4l2_xoverlay_stop (GstV4l2Object *v4l2object);
void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass); void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
void gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object, void gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object,
XID xwindow_id); guintptr id);
#define GST_IMPLEMENT_V4L2_XOVERLAY_METHODS(Type, interface_as_function) \ #define GST_IMPLEMENT_V4L2_XOVERLAY_METHODS(Type, interface_as_function) \
\ \
static void \ static void \
interface_as_function ## _xoverlay_set_xwindow_id (GstXOverlay * xoverlay, \ interface_as_function ## _xoverlay_set_window_handle (GstXOverlay * xoverlay, \
XID xwindow_id) \ guintptr id) \
{ \ { \
Type *this = (Type*) xoverlay; \ 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 \ static void \
interface_as_function ## _xoverlay_interface_init (GstXOverlayClass * klass) \ interface_as_function ## _xoverlay_interface_init (GstXOverlayClass * klass) \
{ \ { \
/* default virtual functions */ \ /* 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); \ gst_v4l2_xoverlay_interface_init(klass); \
} \ } \