gst_vaapidecode_open(GstVideoDecoder *vdec)
{
GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec);
-
- decode->is_ready = TRUE;
- return TRUE;
+ GstVaapiDisplay * const old_display = decode->display;
+ gboolean success;
+
+ /* Let GstVideoContext ask for a proper display to its neighbours */
+ /* Note: steal old display that may be allocated from get_caps()
+ so that to retain a reference to it, thus avoiding extra
+ initialization steps if we turn out to simply re-use the
+ existing (cached) VA display */
+ decode->display = NULL;
+ success = gst_vaapidecode_ensure_display(decode);
+ g_clear_object(&old_display);
+ return success;
}
static gboolean
gst_vaapidecode_destroy(decode);
g_clear_object(&decode->display);
- decode->is_ready = FALSE;
return TRUE;
}
{
GstVaapiDecode * const decode = GST_VAAPIDECODE(GST_OBJECT_PARENT(pad));
- if (!decode->is_ready)
- return gst_static_pad_template_get_caps(&gst_vaapidecode_sink_factory);
-
if (!gst_vaapidecode_ensure_allowed_caps(decode))
return gst_caps_new_empty();
decode->allowed_caps = NULL;
decode->render_time_base = 0;
decode->last_buffer_time = 0;
- decode->is_ready = FALSE;
g_mutex_init(&decode->decoder_mutex);
g_cond_init(&decode->decoder_ready);