frame->output_buffer = gst_buffer_ref (pic->gstbuffer);
}
- ret = gst_va_base_dec_process_output (base, frame, 0);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state, 0);
gst_av1_picture_unref (picture);
if (ret)
gboolean
gst_va_base_dec_process_output (GstVaBaseDec * base, GstVideoCodecFrame * frame,
- GstVideoBufferFlags buffer_flags)
+ GstVideoCodecState * input_state, GstVideoBufferFlags buffer_flags)
{
GstVideoDecoder *vdec = GST_VIDEO_DECODER (base);
+ if (input_state) {
+
+ g_assert (GST_VIDEO_INFO_WIDTH (&input_state->info) ==
+ GST_VIDEO_INFO_WIDTH (&base->input_state->info)
+ && GST_VIDEO_INFO_HEIGHT (&input_state->info) ==
+ GST_VIDEO_INFO_HEIGHT (&input_state->info));
+
+ g_clear_pointer (&base->input_state, gst_video_codec_state_unref);
+ base->input_state = gst_video_codec_state_ref (input_state);
+
+ base->need_negotiation = TRUE;
+ if (!gst_video_decoder_negotiate (vdec)) {
+ GST_ERROR_OBJECT (base, "Could not re-negotiate with updated state");
+ return GST_FLOW_ERROR;
+ }
+ }
+
if (base->copy_frames)
gst_va_base_dec_copy_output_buffer (base, frame);
GstVideoCodecFrame * codec_frame);
gboolean gst_va_base_dec_process_output (GstVaBaseDec * base,
GstVideoCodecFrame * frame,
+ GstVideoCodecState * input_state,
GstVideoBufferFlags buffer_flags);
GstFlowReturn gst_va_base_dec_prepare_output_frame (GstVaBaseDec * base,
GstVideoCodecFrame * frame);
GST_LOG_OBJECT (self,
"Outputting picture %p (poc %d)", picture, picture->pic_order_cnt);
- ret = gst_va_base_dec_process_output (base, frame, picture->buffer_flags);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state,
+ picture->buffer_flags);
gst_h264_picture_unref (picture);
if (ret)
gst_buffer_replace (&frame->output_buffer, va_pic->gstbuffer);
- ret = gst_va_base_dec_process_output (base, frame, picture->buffer_flags);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state,
+ picture->buffer_flags);
gst_h265_picture_unref (picture);
if (ret)
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVideoDecoder *vdec = GST_VIDEO_DECODER (decoder);
- if (gst_va_base_dec_process_output (base, frame, 0))
+ if (gst_va_base_dec_process_output (base, frame, NULL, 0))
return gst_video_decoder_finish_frame (vdec, frame);
return GST_FLOW_ERROR;
}
GST_LOG_OBJECT (self,
"Outputting picture %p (poc %d)", picture, picture->pic_order_cnt);
- ret = gst_va_base_dec_process_output (base, frame, picture->buffer_flags);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state,
+ picture->buffer_flags);
gst_mpeg2_picture_unref (picture);
if (ret)
"Outputting picture %p (system_frame_number %d)",
picture, picture->system_frame_number);
- ret = gst_va_base_dec_process_output (base, frame, 0);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state, 0);
gst_vp8_picture_unref (picture);
if (ret)
GST_LOG_OBJECT (self, "Outputting picture %p", picture);
- ret = gst_va_base_dec_process_output (base, frame, 0);
+ ret = gst_va_base_dec_process_output (base, frame, picture->discont_state, 0);
gst_vp9_picture_unref (picture);
if (ret)