e86202105a231663eb77532693285194a29974b0
[platform/upstream/gstreamer.git] / gst-libs / gst / video / videooverlay.h
1 /* GStreamer Video Overlay Interface
2  * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
3  * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
4  * Copyright (C) 2011 Tim-Philipp Müller <tim@centricular.net>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef __GST_VIDEO_OVERLAY_H__
23 #define __GST_VIDEO_OVERLAY_H__
24
25 #include <gst/gst.h>
26 #include <gst/video/gstvideosink.h>
27
28 G_BEGIN_DECLS
29
30 #define GST_TYPE_VIDEO_OVERLAY \
31     (gst_video_overlay_get_type ())
32 #define GST_VIDEO_OVERLAY(obj) \
33     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_OVERLAY, GstVideoOverlay))
34 #define GST_IS_VIDEO_OVERLAY(obj) \
35     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_OVERLAY))
36 #define GST_VIDEO_OVERLAY_GET_INTERFACE(inst) \
37     (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_OVERLAY, GstVideoOverlayInterface))
38
39 /**
40  * GstVideoOverlay:
41  *
42  * Opaque #GstVideoOverlay interface structure
43  */
44 typedef struct _GstVideoOverlay GstVideoOverlay;
45 typedef struct _GstVideoOverlayInterface GstVideoOverlayInterface;
46 typedef struct _GstVideoOverlayProperties GstVideoOverlayProperties;
47
48 /**
49  * GstVideoOverlayInterface:
50  * @iface: parent interface type.
51  * @expose: virtual method to handle expose events
52  * @handle_events: virtual method to handle events
53  * @set_render_rectangle: virtual method to set the render rectangle
54  * @set_window_handle: virtual method to configure the window handle
55  * @properties_offset: Offset to the #GstVideoOverlayProperties in the
56  *                     instance allocation. Since 1.14
57  *
58  * #GstVideoOverlay interface
59  */
60 struct _GstVideoOverlayInterface {
61   GTypeInterface iface;
62
63   /* virtual functions */
64   void (*expose)               (GstVideoOverlay *overlay);
65
66   void (*handle_events)        (GstVideoOverlay *overlay, gboolean handle_events);
67
68   void (*set_render_rectangle) (GstVideoOverlay *overlay,
69                                 gint x, gint y,
70                                 gint width, gint height);
71
72   void (*set_window_handle)    (GstVideoOverlay *overlay, guintptr handle);
73 };
74
75 GST_EXPORT
76 GType   gst_video_overlay_get_type (void);
77
78 /* virtual function wrappers */
79
80 GST_EXPORT
81 gboolean        gst_video_overlay_set_render_rectangle  (GstVideoOverlay * overlay,
82                                                          gint              x,
83                                                          gint              y,
84                                                          gint              width,
85                                                          gint              height);
86
87 GST_EXPORT
88 void            gst_video_overlay_expose                (GstVideoOverlay * overlay);
89
90 GST_EXPORT
91 void            gst_video_overlay_handle_events         (GstVideoOverlay * overlay,
92                                                          gboolean          handle_events);
93
94 GST_EXPORT
95 void            gst_video_overlay_set_window_handle     (GstVideoOverlay * overlay,
96                                                          guintptr handle);
97
98 /* public methods to dispatch bus messages */
99
100 GST_EXPORT
101 void            gst_video_overlay_got_window_handle     (GstVideoOverlay * overlay,
102                                                          guintptr          handle);
103
104 GST_EXPORT
105 void            gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
106
107 GST_EXPORT
108 gboolean        gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
109
110 GST_EXPORT
111 void            gst_video_overlay_install_properties    (GObjectClass    * oclass,
112                                                          gint              last_prop_id);
113
114 GST_EXPORT
115 gboolean        gst_video_overlay_set_property          (GObject         * object,
116                                                          gint              last_prop_id,
117                                                          guint             property_id,
118                                                          const GValue    * value);
119
120 G_END_DECLS
121
122 #endif /* __GST_VIDEO_OVERLAY_H__ */