Simplify initialization of VADisplay.

This commit is contained in:
gb 2010-03-25 12:39:54 +00:00
parent 0eab340803
commit 67de515e63
2 changed files with 6 additions and 7 deletions

View file

@ -280,8 +280,11 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
if (klass->open_display && !klass->open_display(display))
return FALSE;
if (klass->get_display)
if (klass->get_display) {
priv->display = klass->get_display(display);
if (!priv->display)
return FALSE;
}
if (klass->get_size)
klass->get_size(display, &priv->width, &priv->height);
if (klass->get_size_mm)

View file

@ -44,7 +44,6 @@ struct _GstVaapiDisplayX11Private {
gchar *display_name;
Display *x11_display;
int x11_screen;
VADisplay *va_display;
};
enum {
@ -149,8 +148,7 @@ gst_vaapi_display_x11_open_display(GstVaapiDisplay *display)
return FALSE;
priv->x11_screen = DefaultScreen(priv->x11_display);
priv->va_display = vaGetDisplay(priv->x11_display);
return priv->va_display != NULL;
return TRUE;
}
static void
@ -169,14 +167,12 @@ gst_vaapi_display_x11_close_display(GstVaapiDisplay *display)
g_free(priv->display_name);
priv->display_name = NULL;
}
priv->va_display = NULL;
}
static VADisplay
gst_vaapi_display_x11_get_va_display(GstVaapiDisplay *display)
{
return GST_VAAPI_DISPLAY_X11(display)->priv->va_display;
return vaGetDisplay(GST_VAAPI_DISPLAY_XDISPLAY(display));
}
static void