diff options
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiwindow.c | 26 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiwindow.h | 4 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiwindow_priv.h | 1 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiwindow_wayland.c | 12 |
4 files changed, 43 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c index 01514038..7fd4502f 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow.c @@ -414,6 +414,32 @@ gst_vaapi_window_get_fullscreen (GstVaapiWindow * window) } /** + * gst_vaapi_window_set_render_rectangle: + * @window: a #GstVaapiWindow + * @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 information of the render area. + * + * Since: 1.18 + */ +void +gst_vaapi_window_set_render_rectangle (GstVaapiWindow * window, gint x, gint y, + gint width, gint height) +{ + const GstVaapiWindowClass *klass; + + g_return_if_fail (window != NULL); + + klass = GST_VAAPI_WINDOW_GET_CLASS (window); + + if (klass->set_render_rect) + klass->set_render_rect (window, x, y, width, height); +} + +/** * gst_vaapi_window_set_fullscreen: * @window: a #GstVaapiWindow * @fullscreen: %TRUE to request window to get fullscreen diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.h b/gst-libs/gst/vaapi/gstvaapiwindow.h index 56344396..c1628f79 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow.h @@ -85,6 +85,10 @@ gst_vaapi_window_set_height (GstVaapiWindow * window, guint height); void gst_vaapi_window_set_size (GstVaapiWindow * window, guint width, guint height); +void +gst_vaapi_window_set_render_rectangle (GstVaapiWindow * window, gint x, gint y, + gint width, gint height); + gboolean gst_vaapi_window_put_surface (GstVaapiWindow * window, GstVaapiSurface * surface, const GstVaapiRectangle * src_rect, diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_priv.h b/gst-libs/gst/vaapi/gstvaapiwindow_priv.h index a0b05827..168e002c 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_priv.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow_priv.h @@ -129,6 +129,7 @@ struct _GstVaapiWindowClass guintptr (*get_colormap) (GstVaapiWindow * window); gboolean (*unblock) (GstVaapiWindow * window); gboolean (*unblock_cancel) (GstVaapiWindow * window); + void (*set_render_rect) (GstVaapiWindow * window, gint x, gint y, gint width, gint height); }; GstVaapiWindow * diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c index 4cf76a15..0f596e59 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c @@ -531,6 +531,17 @@ gst_vaapi_window_wayland_resize (GstVaapiWindow * window, return TRUE; } +void +gst_vaapi_window_wayland_set_render_rect (GstVaapiWindow * window, gint x, + gint y, gint width, gint height) +{ + GstVaapiWindowWaylandPrivate *const priv = + GST_VAAPI_WINDOW_WAYLAND_GET_PRIVATE (window); + + if (priv->video_subsurface) + wl_subsurface_set_position (priv->video_subsurface, x, y); +} + static inline gboolean frame_done (FrameState * frame) { @@ -991,6 +1002,7 @@ gst_vaapi_window_wayland_class_init (GstVaapiWindowWaylandClass * klass) window_class->set_fullscreen = gst_vaapi_window_wayland_set_fullscreen; window_class->unblock = gst_vaapi_window_wayland_unblock; window_class->unblock_cancel = gst_vaapi_window_wayland_unblock_cancel; + window_class->set_render_rect = gst_vaapi_window_wayland_set_render_rect; signals[SIZE_CHANGED] = g_signal_new ("size-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |