Merge branch 'upstream/1.16' into tizen_gst_1.16.2
[platform/upstream/gst-plugins-base.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
47 /**
48  * GstVideoOverlayInterface:
49  * @iface: parent interface type.
50  * @expose: virtual method to handle expose events
51  * @handle_events: virtual method to handle events
52  * @set_render_rectangle: virtual method to set the render rectangle
53  * @set_window_handle: virtual method to configure the window handle
54  *
55  * #GstVideoOverlay interface
56  */
57 struct _GstVideoOverlayInterface {
58   GTypeInterface iface;
59
60   /* virtual functions */
61   void (*expose)               (GstVideoOverlay *overlay);
62
63   void (*handle_events)        (GstVideoOverlay *overlay, gboolean handle_events);
64
65   void (*set_render_rectangle) (GstVideoOverlay *overlay,
66                                 gint x, gint y,
67                                 gint width, gint height);
68
69   void (*set_window_handle)    (GstVideoOverlay *overlay, guintptr handle);
70 #ifdef TIZEN_FEATURE_WAYLAND_ENHANCEMENT
71   void (*set_wl_window_wl_surface_id)   (GstVideoOverlay * overlay, gint wl_surface_id);
72
73   void (*set_display_roi_area) (GstVideoOverlay *overlay,
74                                 gint x, gint y,
75                                 gint width, gint height);
76
77   void (*set_video_roi_area)   (GstVideoOverlay *overlay,
78                                 gdouble x_scale, gdouble y_scale,
79                                 gdouble w_scale, gdouble h_scale);
80 #endif
81 };
82
83 GST_VIDEO_API
84 GType   gst_video_overlay_get_type (void);
85
86 /* virtual function wrappers */
87
88 GST_VIDEO_API
89 gboolean        gst_video_overlay_set_render_rectangle  (GstVideoOverlay * overlay,
90                                                          gint              x,
91                                                          gint              y,
92                                                          gint              width,
93                                                          gint              height);
94
95 GST_VIDEO_API
96 void            gst_video_overlay_expose                (GstVideoOverlay * overlay);
97
98 GST_VIDEO_API
99 void            gst_video_overlay_handle_events         (GstVideoOverlay * overlay,
100                                                          gboolean          handle_events);
101
102 GST_VIDEO_API
103 void            gst_video_overlay_set_window_handle     (GstVideoOverlay * overlay,
104                                                          guintptr handle);
105
106 /* public methods to dispatch bus messages */
107
108 GST_VIDEO_API
109 void            gst_video_overlay_got_window_handle     (GstVideoOverlay * overlay,
110                                                          guintptr          handle);
111
112 GST_VIDEO_API
113 void            gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
114
115 GST_VIDEO_API
116 gboolean        gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
117
118 GST_VIDEO_API
119 void            gst_video_overlay_install_properties    (GObjectClass    * oclass,
120                                                          gint              last_prop_id);
121
122 GST_VIDEO_API
123 gboolean        gst_video_overlay_set_property          (GObject         * object,
124                                                          gint              last_prop_id,
125                                                          guint             property_id,
126                                                          const GValue    * value);
127 #ifdef TIZEN_FEATURE_WAYLAND_ENHANCEMENT
128 GST_VIDEO_API
129 void gst_video_overlay_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
130     gint wl_surface_id);
131
132 GST_VIDEO_API
133 gboolean gst_video_overlay_set_display_roi_area         (GstVideoOverlay * overlay,
134                                                          gint x, gint y,
135                                                          gint width, gint height);
136
137 GST_VIDEO_API
138 gboolean gst_video_overlay_set_video_roi_area           (GstVideoOverlay * overlay,
139                                                          gdouble x_scale, gdouble y_scale,
140                                                          gdouble w_scale, gdouble h_scale);
141 #endif
142 G_END_DECLS
143
144 #endif /* __GST_VIDEO_OVERLAY_H__ */