Add gst_video_overlay_set_display_roi_area interface for setting ROI area of wayland...
authorHyunil <hyunil46.park@samsung.com>
Fri, 3 Aug 2018 04:05:25 +0000 (13:05 +0900)
committerHyunil <hyunil46.park@samsung.com>
Fri, 3 Aug 2018 04:31:13 +0000 (13:31 +0900)
Change-Id: I7e6896ac98b572efb1740b365a7ad10cda1da3a1
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
gst-libs/gst/video/videooverlay.c
gst-libs/gst/video/videooverlay.h

index ce11adc..be0ce21 100644 (file)
@@ -348,6 +348,38 @@ gst_video_overlay_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
     iface->set_wl_window_wl_surface_id (overlay, wl_surface_id);
   }
 }
+
+
+/**
+ * gst_video_overlay_set_display_roi_area:
+ * @overlay: a #GstVideoOverlay
+ * @x: the horizontal offset of the render area inside the window
+ * @y: the vertical offset of the render area inside the window
+ * @width: the width of the render area inside the window
+ * @height: the height of the render area inside the window
+ *
+ * Set the ROI(Region of Interest) area of wayland window.
+ * Returns: %FALSE if not supported by the sink.
+ */
+gboolean
+gst_video_overlay_set_display_roi_area (GstVideoOverlay * overlay,
+    gint x, gint y, gint width, gint height)
+{
+  GstVideoOverlayInterface *iface;
+
+  g_return_val_if_fail (overlay != NULL, FALSE);
+  g_return_val_if_fail (GST_IS_VIDEO_OVERLAY (overlay), FALSE);
+  g_return_val_if_fail (width > 0 && height > 0, FALSE);
+
+  iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+  if (iface->set_display_roi_area) {
+    iface->set_display_roi_area (overlay, x, y, width, height);
+    return TRUE;
+  }
+  return FALSE;
+}
+
 #endif
 /**
  * gst_video_overlay_set_window_handle:
index ddc6c3f..1a9f3b1 100644 (file)
@@ -66,8 +66,12 @@ struct _GstVideoOverlayInterface {
                                 gint width, gint height);
 
   void (*set_window_handle)    (GstVideoOverlay *overlay, guintptr handle);
+
   void (*set_wl_window_wl_surface_id)   (GstVideoOverlay * overlay, guintptr wl_surface_id);
 
+  void (*set_display_roi_area) (GstVideoOverlay *overlay,
+                                gint x, gint y,
+                                gint width, gint height);
 };
 
 GType   gst_video_overlay_get_type (void);
@@ -95,9 +99,15 @@ void            gst_video_overlay_got_window_handle     (GstVideoOverlay * overl
 void            gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
 
 gboolean        gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
+
 void gst_video_overlay_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
     guintptr wl_surface_id);
 
+gboolean gst_video_overlay_set_display_roi_area         (GstVideoOverlay * overlay,
+                                                         gint x, gint y,
+                                                         gint width, gint height);
+
+
 G_END_DECLS
 
 #endif /* __GST_VIDEO_OVERLAY_H__ */