diff --git a/sys/d3d11/gstd3d11h264dec.c b/sys/d3d11/gstd3d11h264dec.c index ec28df25df..ad66e78aaa 100644 --- a/sys/d3d11/gstd3d11h264dec.c +++ b/sys/d3d11/gstd3d11h264dec.c @@ -644,10 +644,6 @@ gst_d3d11_h264_dec_output_picture (GstH264Decoder * decoder, } frame->output_buffer = output_buffer; - GST_BUFFER_PTS (output_buffer) = GST_BUFFER_PTS (frame->input_buffer); - GST_BUFFER_DTS (output_buffer) = GST_CLOCK_TIME_NONE; - GST_BUFFER_DURATION (output_buffer) = - GST_BUFFER_DURATION (frame->input_buffer); if (!gst_d3d11_decoder_process_output (self->d3d11_decoder, &self->output_state->info, @@ -658,9 +654,6 @@ gst_d3d11_h264_dec_output_picture (GstH264Decoder * decoder, goto error; } - GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT, - GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer))); - gst_h264_picture_unref (picture); return gst_video_decoder_finish_frame (vdec, frame); diff --git a/sys/d3d11/gstd3d11h265dec.c b/sys/d3d11/gstd3d11h265dec.c index 8121c6337b..cb0cb6d9b5 100644 --- a/sys/d3d11/gstd3d11h265dec.c +++ b/sys/d3d11/gstd3d11h265dec.c @@ -650,7 +650,6 @@ gst_d3d11_h265_dec_output_picture (GstH265Decoder * decoder, GstD3D11H265Dec *self = GST_D3D11_H265_DEC (decoder); GstVideoCodecFrame *frame = NULL; GstBuffer *output_buffer = NULL; - GstFlowReturn ret; GstBuffer *view_buffer; GST_LOG_OBJECT (self, @@ -666,6 +665,12 @@ gst_d3d11_h265_dec_output_picture (GstH265Decoder * decoder, frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (self), picture->system_frame_number); + /* FIXME: Sync with other codec implementation */ + if (!frame) { + GST_ERROR_OBJECT (self, "Couldn't get codec frame"); + return GST_FLOW_ERROR; + } + /* if downstream is d3d11 element and forward playback case, * expose our decoder view without copy. In case of reverse playback, however, * we cannot do that since baseclass will store the decoded buffer @@ -685,23 +690,12 @@ gst_d3d11_h265_dec_output_picture (GstH265Decoder * decoder, if (!output_buffer) { GST_ERROR_OBJECT (self, "Couldn't allocate output buffer"); + gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame); + return GST_FLOW_ERROR; } - if (!frame) { - GST_WARNING_OBJECT (self, - "Failed to find 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; - GST_BUFFER_PTS (output_buffer) = GST_BUFFER_PTS (frame->input_buffer); - GST_BUFFER_DTS (output_buffer) = GST_CLOCK_TIME_NONE; - GST_BUFFER_DURATION (output_buffer) = - GST_BUFFER_DURATION (frame->input_buffer); - } + frame->output_buffer = output_buffer; if (!gst_d3d11_decoder_process_output (self->d3d11_decoder, &self->output_state->info, @@ -709,24 +703,12 @@ gst_d3d11_h265_dec_output_picture (GstH265Decoder * decoder, GST_VIDEO_INFO_HEIGHT (&self->output_state->info), view_buffer, output_buffer)) { GST_ERROR_OBJECT (self, "Failed to copy buffer"); - if (frame) - gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame); - else - gst_buffer_unref (output_buffer); + gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame); return GST_FLOW_ERROR; } - GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT, - GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer))); - - if (frame) { - ret = gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame); - } else { - ret = gst_pad_push (GST_VIDEO_DECODER_SRC_PAD (self), output_buffer); - } - - return ret; + return gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame); } static gboolean diff --git a/sys/d3d11/gstd3d11vp8dec.c b/sys/d3d11/gstd3d11vp8dec.c index b008f8ba2a..92521c0d97 100644 --- a/sys/d3d11/gstd3d11vp8dec.c +++ b/sys/d3d11/gstd3d11vp8dec.c @@ -419,9 +419,6 @@ gst_d3d11_vp8_dec_output_picture (GstVp8Decoder * decoder, goto error; } - GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT, - GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer))); - gst_vp8_picture_unref (picture); return gst_video_decoder_finish_frame (vdec, frame); diff --git a/sys/d3d11/gstd3d11vp9dec.c b/sys/d3d11/gstd3d11vp9dec.c index cf3929e931..f2cffc6dde 100644 --- a/sys/d3d11/gstd3d11vp9dec.c +++ b/sys/d3d11/gstd3d11vp9dec.c @@ -533,10 +533,6 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder, GST_BUFFER_DURATION (output_buffer) = GST_CLOCK_TIME_NONE; } else { frame->output_buffer = output_buffer; - GST_BUFFER_PTS (output_buffer) = GST_BUFFER_PTS (frame->input_buffer); - GST_BUFFER_DTS (output_buffer) = GST_CLOCK_TIME_NONE; - GST_BUFFER_DURATION (output_buffer) = - GST_BUFFER_DURATION (frame->input_buffer); } if (!gst_d3d11_decoder_process_output (self->d3d11_decoder, @@ -547,9 +543,6 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder, goto error; } - GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT, - GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer))); - gst_vp9_picture_unref (picture); if (frame) {