Add gst_vaapi_window_x11_is_foreign_xid() helper.
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 25 Mar 2010 17:18:36 +0000 (17:18 +0000)
committergb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Thu, 25 Mar 2010 17:18:36 +0000 (17:18 +0000)
gst-libs/gst/vaapi/gstvaapiwindow_x11.c
gst-libs/gst/vaapi/gstvaapiwindow_x11.h

index 213e7255e4a53f289e89328184437e8d7a7f4fd7..3ced139cb02cb185e05aaba5c346cae297fc6034 100644 (file)
@@ -564,3 +564,20 @@ gst_vaapi_window_x11_get_xid(GstVaapiWindowX11 *window)
 
     return GST_VAAPI_OBJECT_ID(window);
 }
+
+/**
+ * gst_vaapi_window_x11_is_foreign_xid:
+ * @window: a #GstVaapiWindowX11
+ *
+ * Checks whether the @window XID was created by gst_vaapi_window_x11_new() or bound with gst_vaapi_window_x11_new_with_xid().
+ *
+ * Return value: %TRUE if the underlying X window is owned by the
+ *   caller (foreign window)
+ */
+gboolean
+gst_vaapi_window_x11_is_foreign_xid(GstVaapiWindowX11 *window)
+{
+    g_return_val_if_fail(GST_VAAPI_IS_WINDOW_X11(window), FALSE);
+
+    return !window->priv->create_window;
+}
index cf3da5dafa040f8140ded15ff96ce5c291ce7841..424200f86171c9aa74e3782ad3265ed12d89cee3 100644 (file)
@@ -105,6 +105,9 @@ gst_vaapi_window_x11_new_with_xid(GstVaapiDisplay *display, Window xid);
 Window
 gst_vaapi_window_x11_get_xid(GstVaapiWindowX11 *window);
 
+gboolean
+gst_vaapi_window_x11_is_foreign_xid(GstVaapiWindowX11 *window);
+
 G_END_DECLS
 
 #endif /* GST_VAAPI_WINDOW_X11_H */