mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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:
parent
e0e37a0d92
commit
bb5ef4fd5b
4 changed files with 11 additions and 46 deletions
|
@ -644,10 +644,6 @@ gst_d3d11_h264_dec_output_picture (GstH264Decoder * decoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
frame->output_buffer = output_buffer;
|
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,
|
if (!gst_d3d11_decoder_process_output (self->d3d11_decoder,
|
||||||
&self->output_state->info,
|
&self->output_state->info,
|
||||||
|
@ -658,9 +654,6 @@ gst_d3d11_h264_dec_output_picture (GstH264Decoder * decoder,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT,
|
|
||||||
GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer)));
|
|
||||||
|
|
||||||
gst_h264_picture_unref (picture);
|
gst_h264_picture_unref (picture);
|
||||||
|
|
||||||
return gst_video_decoder_finish_frame (vdec, frame);
|
return gst_video_decoder_finish_frame (vdec, frame);
|
||||||
|
|
|
@ -650,7 +650,6 @@ gst_d3d11_h265_dec_output_picture (GstH265Decoder * decoder,
|
||||||
GstD3D11H265Dec *self = GST_D3D11_H265_DEC (decoder);
|
GstD3D11H265Dec *self = GST_D3D11_H265_DEC (decoder);
|
||||||
GstVideoCodecFrame *frame = NULL;
|
GstVideoCodecFrame *frame = NULL;
|
||||||
GstBuffer *output_buffer = NULL;
|
GstBuffer *output_buffer = NULL;
|
||||||
GstFlowReturn ret;
|
|
||||||
GstBuffer *view_buffer;
|
GstBuffer *view_buffer;
|
||||||
|
|
||||||
GST_LOG_OBJECT (self,
|
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),
|
frame = gst_video_decoder_get_frame (GST_VIDEO_DECODER (self),
|
||||||
picture->system_frame_number);
|
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,
|
/* if downstream is d3d11 element and forward playback case,
|
||||||
* expose our decoder view without copy. In case of reverse playback, however,
|
* expose our decoder view without copy. In case of reverse playback, however,
|
||||||
* we cannot do that since baseclass will store the decoded buffer
|
* 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) {
|
if (!output_buffer) {
|
||||||
GST_ERROR_OBJECT (self, "Couldn't allocate 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;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!frame) {
|
frame->output_buffer = output_buffer;
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!gst_d3d11_decoder_process_output (self->d3d11_decoder,
|
if (!gst_d3d11_decoder_process_output (self->d3d11_decoder,
|
||||||
&self->output_state->info,
|
&self->output_state->info,
|
||||||
|
@ -709,24 +703,12 @@ gst_d3d11_h265_dec_output_picture (GstH265Decoder * decoder,
|
||||||
GST_VIDEO_INFO_HEIGHT (&self->output_state->info),
|
GST_VIDEO_INFO_HEIGHT (&self->output_state->info),
|
||||||
view_buffer, output_buffer)) {
|
view_buffer, output_buffer)) {
|
||||||
GST_ERROR_OBJECT (self, "Failed to copy buffer");
|
GST_ERROR_OBJECT (self, "Failed to copy buffer");
|
||||||
if (frame)
|
gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
|
||||||
gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), frame);
|
|
||||||
else
|
|
||||||
gst_buffer_unref (output_buffer);
|
|
||||||
|
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT,
|
return gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -419,9 +419,6 @@ gst_d3d11_vp8_dec_output_picture (GstVp8Decoder * decoder,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT,
|
|
||||||
GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer)));
|
|
||||||
|
|
||||||
gst_vp8_picture_unref (picture);
|
gst_vp8_picture_unref (picture);
|
||||||
|
|
||||||
return gst_video_decoder_finish_frame (vdec, frame);
|
return gst_video_decoder_finish_frame (vdec, frame);
|
||||||
|
|
|
@ -533,10 +533,6 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder,
|
||||||
GST_BUFFER_DURATION (output_buffer) = GST_CLOCK_TIME_NONE;
|
GST_BUFFER_DURATION (output_buffer) = GST_CLOCK_TIME_NONE;
|
||||||
} else {
|
} else {
|
||||||
frame->output_buffer = output_buffer;
|
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,
|
if (!gst_d3d11_decoder_process_output (self->d3d11_decoder,
|
||||||
|
@ -547,9 +543,6 @@ gst_d3d11_vp9_dec_output_picture (GstVp9Decoder * decoder,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (self, "Finish frame %" GST_TIME_FORMAT,
|
|
||||||
GST_TIME_ARGS (GST_BUFFER_PTS (output_buffer)));
|
|
||||||
|
|
||||||
gst_vp9_picture_unref (picture);
|
gst_vp9_picture_unref (picture);
|
||||||
|
|
||||||
if (frame) {
|
if (frame) {
|
||||||
|
|
Loading…
Reference in a new issue