GstVaapiDisplay * display, GstVaapiID id, guint target, guint format,
guint width, guint height);
+typedef guintptr (*GstVaapiDisplayGetVisualIdFunc) (GstVaapiDisplay * display,
+ GstVaapiWindow * window);
+typedef guintptr (*GstVaapiDisplayGetColormapFunc) (GstVaapiDisplay * display,
+ GstVaapiWindow * window);
+
/**
* GST_VAAPI_DISPLAY_GET_CLASS_TYPE:
* @display: a #GstVaapiDisplay
* @get_display: virtual function to retrieve the #GstVaapiDisplayInfo
* @get_size: virtual function to retrieve the display dimensions, in pixels
* @get_size_mm: virtual function to retrieve the display dimensions, in millimeters
+ * @get_visual_id: (optional) virtual function to retrieve the window visual id
+ * @get_colormap: (optional) virtual function to retrieve the window colormap
* @create_window: (optional) virtual function to create a window
* @create_texture: (optional) virtual function to create a texture
*
GstVaapiDisplayGetInfoFunc get_display;
GstVaapiDisplayGetSizeFunc get_size;
GstVaapiDisplayGetSizeMFunc get_size_mm;
-
+ GstVaapiDisplayGetVisualIdFunc get_visual_id;
+ GstVaapiDisplayGetColormapFunc get_colormap;
GstVaapiDisplayCreateWindowFunc create_window;
GstVaapiDisplayCreateTextureFunc create_texture;
};
{
GstVaapiWindowX11Private *const priv =
GST_VAAPI_WINDOW_X11_GET_PRIVATE (window);
+ GstVaapiDisplay *const display = GST_VAAPI_OBJECT_DISPLAY (window);
Display *const dpy = GST_VAAPI_OBJECT_NATIVE_DISPLAY (window);
Window xid = GST_VAAPI_OBJECT_ID (window);
guint vid = 0;
Colormap cmap = None;
+ const GstVaapiDisplayClass *display_class;
const GstVaapiWindowClass *window_class;
XWindowAttributes wattr;
Atom atoms[2];
return ok;
}
+ display_class = GST_VAAPI_DISPLAY_GET_CLASS (display);
+ if (display_class) {
+ if (display_class->get_visual_id)
+ vid = display_class->get_visual_id (display, window);
+ if (display_class->get_colormap)
+ cmap = display_class->get_colormap (display, window);
+ }
+
window_class = GST_VAAPI_WINDOW_GET_CLASS (window);
if (window_class) {
- if (window_class->get_visual_id)
+ if (window_class->get_visual_id && !vid)
vid = window_class->get_visual_id (window);
- if (window_class->get_colormap)
+ if (window_class->get_colormap && !cmap)
cmap = window_class->get_colormap (window);
}