mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
nvdecoder: Handle input caps change
Update output caps if it's notified by baseclass Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
This commit is contained in:
parent
b4c19a96b7
commit
0e4c520cf3
7 changed files with 20 additions and 11 deletions
|
@ -863,8 +863,8 @@ gst_nv_av1_dec_output_picture (GstAV1Decoder * decoder,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, decoder_frame,
|
||||
&frame->output_buffer)) {
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, picture->discont_state,
|
||||
decoder_frame, &frame->output_buffer)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to handle output picture");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -819,7 +819,8 @@ done:
|
|||
|
||||
gboolean
|
||||
gst_nv_decoder_finish_frame (GstNvDecoder * decoder, GstVideoDecoder * videodec,
|
||||
GstNvDecoderFrame * frame, GstBuffer ** buffer)
|
||||
GstVideoCodecState * input_state, GstNvDecoderFrame * frame,
|
||||
GstBuffer ** buffer)
|
||||
{
|
||||
GstBuffer *outbuf = NULL;
|
||||
gboolean ret = FALSE;
|
||||
|
@ -829,6 +830,13 @@ gst_nv_decoder_finish_frame (GstNvDecoder * decoder, GstVideoDecoder * videodec,
|
|||
g_return_val_if_fail (frame != NULL, GST_FLOW_ERROR);
|
||||
g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR);
|
||||
|
||||
if (input_state) {
|
||||
if (!gst_nv_decoder_negotiate (decoder, videodec, input_state)) {
|
||||
GST_ERROR_OBJECT (videodec, "Couldn't re-negotiate with updated state");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
outbuf = gst_video_decoder_allocate_output_buffer (videodec);
|
||||
if (!outbuf) {
|
||||
GST_ERROR_OBJECT (videodec, "Couldn't allocate output buffer");
|
||||
|
|
|
@ -80,6 +80,7 @@ gboolean gst_nv_decoder_decode_picture (GstNvDecoder * decoder,
|
|||
|
||||
gboolean gst_nv_decoder_finish_frame (GstNvDecoder * decoder,
|
||||
GstVideoDecoder * videodec,
|
||||
GstVideoCodecState * input_state,
|
||||
GstNvDecoderFrame *frame,
|
||||
GstBuffer ** buffer);
|
||||
|
||||
|
|
|
@ -578,8 +578,8 @@ gst_nv_h264_dec_output_picture (GstH264Decoder * decoder,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, decoder_frame,
|
||||
&frame->output_buffer)) {
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, picture->discont_state,
|
||||
decoder_frame, &frame->output_buffer)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to handle output picture");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -508,8 +508,8 @@ gst_nv_h265_dec_output_picture (GstH265Decoder * decoder,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, decoder_frame,
|
||||
&frame->output_buffer)) {
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, picture->discont_state,
|
||||
decoder_frame, &frame->output_buffer)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to handle output picture");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -478,8 +478,8 @@ gst_nv_vp8_dec_output_picture (GstVp8Decoder * decoder,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, decoder_frame,
|
||||
&frame->output_buffer)) {
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, picture->discont_state,
|
||||
decoder_frame, &frame->output_buffer)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to handle output picture");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -573,8 +573,8 @@ gst_nv_vp9_dec_output_picture (GstVp9Decoder * decoder,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, decoder_frame,
|
||||
&frame->output_buffer)) {
|
||||
if (!gst_nv_decoder_finish_frame (self->decoder, vdec, picture->discont_state,
|
||||
decoder_frame, &frame->output_buffer)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to handle output picture");
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue