d3d11decoder: Cleanup code

* Don't need to set pts/dts/duration on output buffer of frame.
  it's handled by baseclass
* Remove meaningless debug output

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1567>
This commit is contained in:
Seungha Yang 2020-09-10 21:31:38 +09:00 committed by GStreamer Merge Bot
parent e0e37a0d92
commit bb5ef4fd5b
4 changed files with 11 additions and 46 deletions

View file

@ -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);

View file

@ -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

View file

@ -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);

View file

@ -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) {