mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +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
|
||||
gst_vaapidecode_create(GstVaapiDecode *decode)
|
||||
gst_vaapidecode_ensure_display(GstVaapiDecode *decode)
|
||||
{
|
||||
GstVaapiVideoSink *sink;
|
||||
GstVaapiDisplay *display;
|
||||
|
||||
if (decode->display)
|
||||
return TRUE;
|
||||
|
||||
/* Look for a downstream vaapisink */
|
||||
sink = gst_vaapi_video_sink_lookup(GST_ELEMENT(decode));
|
||||
if (!sink)
|
||||
|
@ -175,10 +178,18 @@ gst_vaapidecode_create(GstVaapiDecode *decode)
|
|||
return FALSE;
|
||||
|
||||
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)
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue