mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
Simplify initialization of VADisplay.
This commit is contained in:
parent
0eab340803
commit
67de515e63
2 changed files with 6 additions and 7 deletions
|
@ -280,8 +280,11 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
|
||||||
GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
|
GstVaapiDisplayClass *klass = GST_VAAPI_DISPLAY_GET_CLASS(display);
|
||||||
if (klass->open_display && !klass->open_display(display))
|
if (klass->open_display && !klass->open_display(display))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (klass->get_display)
|
if (klass->get_display) {
|
||||||
priv->display = klass->get_display(display);
|
priv->display = klass->get_display(display);
|
||||||
|
if (!priv->display)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (klass->get_size)
|
if (klass->get_size)
|
||||||
klass->get_size(display, &priv->width, &priv->height);
|
klass->get_size(display, &priv->width, &priv->height);
|
||||||
if (klass->get_size_mm)
|
if (klass->get_size_mm)
|
||||||
|
|
|
@ -44,7 +44,6 @@ struct _GstVaapiDisplayX11Private {
|
||||||
gchar *display_name;
|
gchar *display_name;
|
||||||
Display *x11_display;
|
Display *x11_display;
|
||||||
int x11_screen;
|
int x11_screen;
|
||||||
VADisplay *va_display;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -149,8 +148,7 @@ gst_vaapi_display_x11_open_display(GstVaapiDisplay *display)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
priv->x11_screen = DefaultScreen(priv->x11_display);
|
priv->x11_screen = DefaultScreen(priv->x11_display);
|
||||||
priv->va_display = vaGetDisplay(priv->x11_display);
|
return TRUE;
|
||||||
return priv->va_display != NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -169,14 +167,12 @@ gst_vaapi_display_x11_close_display(GstVaapiDisplay *display)
|
||||||
g_free(priv->display_name);
|
g_free(priv->display_name);
|
||||||
priv->display_name = NULL;
|
priv->display_name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->va_display = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static VADisplay
|
static VADisplay
|
||||||
gst_vaapi_display_x11_get_va_display(GstVaapiDisplay *display)
|
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
|
static void
|
||||||
|
|
Loading…
Reference in a new issue