mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-28 18:18:38 +00:00
Add gst_vaapidecode_ensure_display() helper for set-caps.
This commit is contained in:
parent
2a4f429007
commit
4a485200b9
1 changed files with 13 additions and 2 deletions
|
@ -160,11 +160,14 @@ error_commit_buffer:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_vaapidecode_create(GstVaapiDecode *decode)
|
gst_vaapidecode_ensure_display(GstVaapiDecode *decode)
|
||||||
{
|
{
|
||||||
GstVaapiVideoSink *sink;
|
GstVaapiVideoSink *sink;
|
||||||
GstVaapiDisplay *display;
|
GstVaapiDisplay *display;
|
||||||
|
|
||||||
|
if (decode->display)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
/* Look for a downstream vaapisink */
|
/* Look for a downstream vaapisink */
|
||||||
sink = gst_vaapi_video_sink_lookup(GST_ELEMENT(decode));
|
sink = gst_vaapi_video_sink_lookup(GST_ELEMENT(decode));
|
||||||
if (!sink)
|
if (!sink)
|
||||||
|
@ -175,10 +178,18 @@ gst_vaapidecode_create(GstVaapiDecode *decode)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
decode->display = g_object_ref(display);
|
decode->display = g_object_ref(display);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gst_vaapidecode_create(GstVaapiDecode *decode)
|
||||||
|
{
|
||||||
|
if (!gst_vaapidecode_ensure_display(decode))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (decode->use_ffmpeg)
|
if (decode->use_ffmpeg)
|
||||||
decode->decoder =
|
decode->decoder =
|
||||||
gst_vaapi_decoder_ffmpeg_new(display, decode->decoder_caps);
|
gst_vaapi_decoder_ffmpeg_new(decode->display, decode->decoder_caps);
|
||||||
return decode->decoder != NULL;
|
return decode->decoder != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue