Add gst_vaapi_window_x11_is_foreign_xid() helper.

This commit is contained in:
gb 2010-03-25 17:18:36 +00:00
parent b36a2142e4
commit fddeb54248
2 changed files with 20 additions and 0 deletions

View 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;
}

View 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 */