}
if (!gst_d3d11_decoder_process_output (inner->d3d11_decoder, vdec,
- picture->frame_hdr.render_width, picture->frame_hdr.render_height,
- view_buffer, &frame->output_buffer)) {
+ picture->discont_state, picture->frame_hdr.render_width,
+ picture->frame_hdr.render_height, view_buffer,
+ &frame->output_buffer)) {
GST_ERROR_OBJECT (self, "Failed to copy buffer");
goto error;
}
gboolean
gst_d3d11_decoder_process_output (GstD3D11Decoder * decoder,
- GstVideoDecoder * videodec, gint display_width, gint display_height,
+ GstVideoDecoder * videodec, GstVideoCodecState * input_state,
+ gint display_width, gint display_height,
GstBuffer * decoder_buffer, GstBuffer ** output)
{
g_return_val_if_fail (GST_IS_D3D11_DECODER (decoder), FALSE);
g_return_val_if_fail (GST_IS_BUFFER (decoder_buffer), FALSE);
g_return_val_if_fail (output != NULL, FALSE);
+ if (input_state) {
+ g_clear_pointer (&decoder->input_state, gst_video_codec_state_unref);
+ decoder->input_state = gst_video_codec_state_ref (input_state);
+ }
+
if (display_width != GST_VIDEO_INFO_WIDTH (&decoder->output_info) ||
display_height != GST_VIDEO_INFO_HEIGHT (&decoder->output_info)) {
GST_INFO_OBJECT (videodec, "Frame size changed, do renegotiate");
GST_ERROR_OBJECT (videodec, "Failed to re-negotiate with new frame size");
return FALSE;
}
+ } else if (input_state) {
+ if (!gst_video_decoder_negotiate (videodec)) {
+ GST_ERROR_OBJECT (videodec, "Could not re-negotiate with updated state");
+ return FALSE;
+ }
}
if (gst_d3d11_decoder_can_direct_render (decoder, videodec, decoder_buffer,
gboolean gst_d3d11_decoder_process_output (GstD3D11Decoder * decoder,
GstVideoDecoder * videodec,
+ GstVideoCodecState * in_state,
gint display_width,
gint display_height,
GstBuffer * decoder_buffer,
}
if (!gst_d3d11_decoder_process_output (inner->d3d11_decoder, vdec,
- inner->width, inner->height, view_buffer, &frame->output_buffer)) {
+ picture->discont_state, inner->width, inner->height, view_buffer,
+ &frame->output_buffer)) {
GST_ERROR_OBJECT (self, "Failed to copy buffer");
goto error;
}
}
if (!gst_d3d11_decoder_process_output (inner->d3d11_decoder, vdec,
- inner->width, inner->height, view_buffer, &frame->output_buffer)) {
+ picture->discont_state, inner->width, inner->height, view_buffer,
+ &frame->output_buffer)) {
GST_ERROR_OBJECT (self, "Failed to copy buffer");
goto error;
}
}
if (!gst_d3d11_decoder_process_output (inner->d3d11_decoder, vdec,
- inner->width, inner->height, view_buffer, &frame->output_buffer)) {
+ picture->discont_state, inner->width, inner->height, view_buffer,
+ &frame->output_buffer)) {
GST_ERROR_OBJECT (self, "Failed to copy buffer");
goto error;
}
}
if (!gst_d3d11_decoder_process_output (inner->d3d11_decoder, vdec,
- inner->width, inner->height, view_buffer, &frame->output_buffer)) {
+ picture->discont_state, inner->width, inner->height, view_buffer,
+ &frame->output_buffer)) {
GST_ERROR_OBJECT (self, "Failed to copy buffer");
goto error;
}
}
if (!gst_d3d11_decoder_process_output (inner->d3d11_decoder, vdec,
- picture->frame_hdr.width, picture->frame_hdr.height, view_buffer,
- &frame->output_buffer)) {
+ picture->discont_state, picture->frame_hdr.width,
+ picture->frame_hdr.height, view_buffer, &frame->output_buffer)) {
GST_ERROR_OBJECT (self, "Failed to copy buffer");
goto error;
}