From 08119ea515a19b5cf0ed88925d4862a9cc5adad5 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 12 Sep 2020 00:12:03 +0900 Subject: [PATCH] d3d11vp9dec: Don't need to consider output_picture() call without GstVideoCodecFrame Baseclass will be updated in order to ensure GstVideoCodecFrame. Part-of: --- sys/d3d11/gstd3d11vp9dec.c | 42 ++++++-------------------------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/sys/d3d11/gstd3d11vp9dec.c b/sys/d3d11/gstd3d11vp9dec.c index 8887f0c489..081840318b 100644 --- a/sys/d3d11/gstd3d11vp9dec.c +++ b/sys/d3d11/gstd3d11vp9dec.c @@ -470,7 +470,6 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder, GstD3D11Vp9Dec *self = GST_D3D11_VP9_DEC (decoder); GstVideoDecoder *vdec = GST_VIDEO_DECODER (decoder); GstBuffer *output_buffer = NULL; - GstFlowReturn ret; GstBuffer *view_buffer; GST_LOG_OBJECT (self, "Outputting picture %p", picture); @@ -484,17 +483,11 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder, if (!picture->frame_hdr.show_frame) { GST_LOG_OBJECT (self, "Decode only picture %p", picture); - if (frame) { - GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (frame); - gst_vp9_picture_unref (picture); + GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (frame); - return gst_video_decoder_finish_frame (vdec, frame); - } else { - /* expected case if we are decoding super frame */ - gst_vp9_picture_unref (picture); + gst_vp9_picture_unref (picture); - return GST_FLOW_OK; - } + return gst_video_decoder_finish_frame (vdec, frame); } /* if downstream is d3d11 element and forward playback case, @@ -522,18 +515,7 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder, goto error; } - if (!frame) { - /* this is the case where super frame has multiple displayable - * (non-decode-only) subframes. Should be rare case but it's possible - * in theory */ - GST_WARNING_OBJECT (self, "No codec frame for picture %p", picture); - - GST_BUFFER_PTS (output_buffer) = picture->pts; - GST_BUFFER_DTS (output_buffer) = GST_CLOCK_TIME_NONE; - GST_BUFFER_DURATION (output_buffer) = GST_CLOCK_TIME_NONE; - } else { - frame->output_buffer = output_buffer; - } + frame->output_buffer = output_buffer; if (!gst_d3d11_decoder_process_output (self->d3d11_decoder, &self->output_state->info, @@ -545,23 +527,11 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder, gst_vp9_picture_unref (picture); - if (frame) { - ret = gst_video_decoder_finish_frame (vdec, frame); - } else { - ret = gst_pad_push (GST_VIDEO_DECODER_SRC_PAD (self), output_buffer); - } - - return ret; + return gst_video_decoder_finish_frame (vdec, frame); error: - if (frame) { - /* normal case */ - gst_video_decoder_drop_frame (vdec, frame); - } else if (output_buffer) { - /* in case of super frame with multiple displayable subframes */ - gst_buffer_unref (output_buffer); - } gst_vp9_picture_unref (picture); + gst_video_decoder_drop_frame (vdec, frame); return GST_FLOW_ERROR; }