mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 23:46:45 +00:00
plugins: simplify gst_vaapi_ensure_display().
Return earlier if the creation of a VA display failed. Likewise, simplify gst_vaapi_video_context_propagate() now that we are guaranteed to have a valid VA display.
This commit is contained in:
parent
84b3f84925
commit
16751205a2
2 changed files with 4 additions and 9 deletions
|
@ -139,12 +139,12 @@ gst_vaapi_ensure_display(
|
||||||
|
|
||||||
/* If no neighboor, or application not interested, use system default */
|
/* If no neighboor, or application not interested, use system default */
|
||||||
display = gst_vaapi_create_display(&display_type);
|
display = gst_vaapi_create_display(&display_type);
|
||||||
|
if (!display)
|
||||||
if (display_ptr)
|
return FALSE;
|
||||||
*display_ptr = display;
|
|
||||||
|
|
||||||
gst_vaapi_video_context_propagate(context, display);
|
gst_vaapi_video_context_propagate(context, display);
|
||||||
return display != NULL;
|
*display_ptr = display;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -169,11 +169,6 @@ gst_vaapi_video_context_propagate(GstElement *element, GstVaapiDisplay *display)
|
||||||
GstContext *context;
|
GstContext *context;
|
||||||
GstMessage *msg;
|
GstMessage *msg;
|
||||||
|
|
||||||
if (!display) {
|
|
||||||
GST_ERROR_OBJECT(element, "failed to get VA-API display connection");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
context = gst_vaapi_video_context_new_with_display(display, FALSE);
|
context = gst_vaapi_video_context_new_with_display(display, FALSE);
|
||||||
|
|
||||||
GST_CAT_INFO_OBJECT(GST_CAT_CONTEXT, element,
|
GST_CAT_INFO_OBJECT(GST_CAT_CONTEXT, element,
|
||||||
|
|
Loading…
Reference in a new issue