summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Kaelberer <hk@getslash.de>2013-07-29 09:28:28 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-07-25 17:36:12 +0200
commit08dc3036f45fa9222b531f68e8913a52edb5d821 (patch)
tree2d55d879dbe2bda8f80e7aa92da2fd57da1e1d24
parent3490212988d42b7d35c72893b3f37c7c0c79065d (diff)
window: allow for updating size from current geometry.
Add gst_vaapi_window_reconfigure() interface to force an update of the GstVaapiWindow "soft" size, based on the current geometry of the underlying native window. This can be useful for instance to synchronize the window size when the user changed it. Thanks to Fabrice Bellet for rebasing the patch. [changed interface to gst_vaapi_window_reconfigure()] Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--gst-libs/gst/vaapi/gstvaapiwindow.c16
-rw-r--r--gst-libs/gst/vaapi/gstvaapiwindow.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c
index b9a668ab..7ebbdac9 100644
--- a/gst-libs/gst/vaapi/gstvaapiwindow.c
+++ b/gst-libs/gst/vaapi/gstvaapiwindow.c
@@ -483,3 +483,19 @@ gst_vaapi_window_put_pixmap (GstVaapiWindow * window,
}
return klass->render_pixmap (window, pixmap, src_rect, dst_rect);
}
+
+/**
+ * gst_vaapi_window_reconfigure:
+ * @window: a #GstVaapiWindow
+ *
+ * Updates internal window size from geometry of the underlying window
+ * implementation if necessary.
+ */
+void
+gst_vaapi_window_reconfigure (GstVaapiWindow * window)
+{
+ g_return_if_fail (window != NULL);
+
+ window->check_geometry = TRUE;
+ gst_vaapi_window_ensure_size (window);
+}
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.h b/gst-libs/gst/vaapi/gstvaapiwindow.h
index 7b7cbfee..84a6ef8d 100644
--- a/gst-libs/gst/vaapi/gstvaapiwindow.h
+++ b/gst-libs/gst/vaapi/gstvaapiwindow.h
@@ -93,6 +93,9 @@ gboolean
gst_vaapi_window_put_pixmap (GstVaapiWindow * window, GstVaapiPixmap * pixmap,
const GstVaapiRectangle * src_rect, const GstVaapiRectangle * dst_rect);
+void
+gst_vaapi_window_reconfigure (GstVaapiWindow * window);
+
G_END_DECLS
#endif /* GST_VAAPI_WINDOW_H */