v4l2: use the xoverlay APIs
[platform/upstream/gst-plugins-good.git] / sys / v4l2 / gstv4l2xoverlay.h
1 /* GStreamer
2  *
3  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
4  *               2006 Edgard Lima <edgard.lima@indt.org.br>
5  *
6  * gstv4l2xoverlay.h: tv mixer interface implementation for V4L2
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef __GST_V4L2_X_OVERLAY_H__
25 #define __GST_V4L2_X_OVERLAY_H__
26
27 #include <X11/X.h>
28
29 #include <gst/gst.h>
30 #include <gst/interfaces/xoverlay.h>
31
32 #include "gstv4l2object.h"
33
34 G_BEGIN_DECLS
35
36 void gst_v4l2_xoverlay_start (GstV4l2Object  *v4l2object);
37 void gst_v4l2_xoverlay_stop  (GstV4l2Object  *v4l2object);
38
39 void gst_v4l2_xoverlay_interface_init (GstXOverlayClass * klass);
40 void gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object,
41     guintptr id);
42
43
44 #define GST_IMPLEMENT_V4L2_XOVERLAY_METHODS(Type, interface_as_function)      \
45                                                                               \
46 static void                                                                   \
47 interface_as_function ## _xoverlay_set_window_handle (GstXOverlay * xoverlay, \
48                                                    guintptr id)               \
49 {                                                                             \
50   Type *this = (Type*) xoverlay;                                              \
51   gst_v4l2_xoverlay_set_window_handle (this->v4l2object, id);                 \
52 }                                                                             \
53                                                                               \
54 static void                                                                   \
55 interface_as_function ## _xoverlay_interface_init (GstXOverlayClass * klass)  \
56 {                                                                             \
57   /* default virtual functions */                                             \
58   klass->set_window_handle = interface_as_function ## _xoverlay_set_window_handle;  \
59                                                                               \
60   gst_v4l2_xoverlay_interface_init(klass);                                    \
61 }                                                                             \
62
63
64 #endif /* __GST_V4L2_X_OVERLAY_H__ */