diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c index 4005484bdc..13eac3f450 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_glx.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_glx.c @@ -268,10 +268,10 @@ gst_vaapi_window_glx_create_colormap (GstVaapiWindow * window) return priv->cmap; } -static Colormap +static guintptr gst_vaapi_window_glx_get_colormap (GstVaapiWindow * window) { - return gst_vaapi_window_glx_create_colormap (window); + return GPOINTER_TO_SIZE (gst_vaapi_window_glx_create_colormap (window)); } static gboolean @@ -321,7 +321,7 @@ gst_vaapi_window_glx_class_init (GstVaapiWindowGLXClass * klass) klass->parent_finalize = GST_VAAPI_OBJECT_CLASS (klass)->finalize; window_class->resize = gst_vaapi_window_glx_resize; window_class->get_visual_id = gst_vaapi_window_glx_get_visual_id; - xwindow_class->get_colormap = gst_vaapi_window_glx_get_colormap; + window_class->get_colormap = gst_vaapi_window_glx_get_colormap; } GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE (GstVaapiWindowGLX, diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_priv.h b/gst-libs/gst/vaapi/gstvaapiwindow_priv.h index 36291c44d0..af1581be83 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_priv.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow_priv.h @@ -53,6 +53,7 @@ typedef gboolean (*GstVaapiWindowRenderPixmapFunc) (GstVaapiWindow * window, GstVaapiPixmap * pixmap, const GstVaapiRectangle * src_rect, const GstVaapiRectangle * dst_rect); typedef guintptr (*GstVaapiWindowGetVisualIdFunc) (GstVaapiWindow * window); +typedef guintptr (*GstVaapiWindowGetColormapFunc) (GstVaapiWindow * window); /** * GstVaapiWindow: @@ -85,6 +86,8 @@ struct _GstVaapiWindow * @render: virtual function to render a #GstVaapiSurface into a window * @get_visual_id: virtual function to get the desired visual id used to * create the window + * @get_colormap: virtual function to get the desired colormap used to + * create the window, or the currently allocated one * * Base class for system-dependent windows. */ @@ -103,6 +106,7 @@ struct _GstVaapiWindowClass GstVaapiWindowRenderFunc render; GstVaapiWindowRenderPixmapFunc render_pixmap; GstVaapiWindowGetVisualIdFunc get_visual_id; + GstVaapiWindowGetColormapFunc get_colormap; }; GstVaapiWindow * diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c index 49fc97ad88..67b358006a 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c @@ -217,7 +217,6 @@ gst_vaapi_window_x11_create (GstVaapiWindow * window, guint * width, guint vid = 0; Colormap cmap = None; const GstVaapiWindowClass *window_class; - const GstVaapiWindowX11Class *klass; XWindowAttributes wattr; Atom atoms[2]; gboolean ok; @@ -243,12 +242,8 @@ gst_vaapi_window_x11_create (GstVaapiWindow * window, guint * width, if (window_class) { if (window_class->get_visual_id) vid = window_class->get_visual_id (window); - } - - klass = GST_VAAPI_WINDOW_X11_GET_CLASS (window); - if (klass) { - if (klass->get_colormap) - cmap = klass->get_colormap (window); + if (window_class->get_colormap) + cmap = window_class->get_colormap (window); } GST_VAAPI_OBJECT_LOCK_DISPLAY (window); diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h b/gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h index c9d61cbf37..f57916c996 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h @@ -72,8 +72,6 @@ struct _GstVaapiWindowX11 /** * GstVaapiWindowX11Class: - * @get_colormap: virtual function to get the desired colormap used to - * create the window * * An X11 #Window wrapper class. */ @@ -81,8 +79,6 @@ struct _GstVaapiWindowX11Class { /*< private >*/ GstVaapiWindowClass parent_class; - - Colormap (*get_colormap) (GstVaapiWindow * window); }; void