mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
d3d11decoder: Handle DPB size margin in a single place
... instead of each subclass Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2343>
This commit is contained in:
parent
6a4c42c03f
commit
a8b2fbf77f
7 changed files with 9 additions and 22 deletions
|
@ -365,9 +365,6 @@ typedef struct _GST_DXVA_Status_AV1
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
/* reference list 8 + 4 margin */
|
|
||||||
#define NUM_OUTPUT_VIEW 12
|
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
typedef struct _GstD3D11AV1DecInner
|
typedef struct _GstD3D11AV1DecInner
|
||||||
{
|
{
|
||||||
|
@ -687,7 +684,7 @@ gst_d3d11_av1_dec_new_sequence (GstAV1Decoder * decoder,
|
||||||
|
|
||||||
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
||||||
decoder->input_state, &info, (gint) inner->max_width,
|
decoder->input_state, &info, (gint) inner->max_width,
|
||||||
(gint) inner->max_height, NUM_OUTPUT_VIEW)) {
|
(gint) inner->max_height, max_dpb_size)) {
|
||||||
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -731,6 +731,9 @@ gst_d3d11_decoder_configure (GstD3D11Decoder * decoder,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Additional 4 frames to help zero-copying */
|
||||||
|
dpb_size += 4;
|
||||||
|
|
||||||
decoder->input_state = gst_video_codec_state_ref (input_state);
|
decoder->input_state = gst_video_codec_state_ref (input_state);
|
||||||
decoder->info = decoder->output_info = *info;
|
decoder->info = decoder->output_info = *info;
|
||||||
decoder->coded_width = coded_width;
|
decoder->coded_width = coded_width;
|
||||||
|
|
|
@ -455,9 +455,7 @@ gst_d3d11_h264_dec_new_sequence (GstH264Decoder * decoder,
|
||||||
inner->max_dpb_size = max_dpb_size;
|
inner->max_dpb_size = max_dpb_size;
|
||||||
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
||||||
decoder->input_state, &info,
|
decoder->input_state, &info,
|
||||||
inner->coded_width, inner->coded_height,
|
inner->coded_width, inner->coded_height, max_dpb_size)) {
|
||||||
/* Additional 4 views margin for zero-copy rendering */
|
|
||||||
max_dpb_size + 4)) {
|
|
||||||
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,9 +407,7 @@ gst_d3d11_h265_dec_new_sequence (GstH265Decoder * decoder,
|
||||||
|
|
||||||
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
||||||
decoder->input_state, &info,
|
decoder->input_state, &info,
|
||||||
inner->coded_width, inner->coded_height,
|
inner->coded_width, inner->coded_height, max_dpb_size)) {
|
||||||
/* Additional 4 views margin for zero-copy rendering */
|
|
||||||
max_dpb_size + 4)) {
|
|
||||||
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,9 +53,6 @@
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_mpeg2_dec_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_mpeg2_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_mpeg2_dec_debug
|
#define GST_CAT_DEFAULT gst_d3d11_mpeg2_dec_debug
|
||||||
|
|
||||||
/* reference list 2 + 4 margin */
|
|
||||||
#define NUM_OUTPUT_VIEW 6
|
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
typedef struct _GstD3D11Mpeg2DecInner
|
typedef struct _GstD3D11Mpeg2DecInner
|
||||||
{
|
{
|
||||||
|
@ -398,7 +395,7 @@ gst_d3d11_mpeg2_dec_new_sequence (GstMpeg2Decoder * decoder,
|
||||||
|
|
||||||
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
||||||
decoder->input_state, &info,
|
decoder->input_state, &info,
|
||||||
inner->width, inner->height, NUM_OUTPUT_VIEW)) {
|
inner->width, inner->height, max_dpb_size)) {
|
||||||
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,9 +53,6 @@
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp8_dec_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp8_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_vp8_dec_debug
|
#define GST_CAT_DEFAULT gst_d3d11_vp8_dec_debug
|
||||||
|
|
||||||
/* reference list 4 + 4 margin */
|
|
||||||
#define NUM_OUTPUT_VIEW 8
|
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
typedef struct _GstD3D11Vp8DecInner
|
typedef struct _GstD3D11Vp8DecInner
|
||||||
{
|
{
|
||||||
|
@ -331,7 +328,7 @@ gst_d3d11_vp8_dec_new_sequence (GstVp8Decoder * decoder,
|
||||||
|
|
||||||
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
||||||
decoder->input_state, &info, inner->width, inner->height,
|
decoder->input_state, &info, inner->width, inner->height,
|
||||||
NUM_OUTPUT_VIEW)) {
|
max_dpb_size)) {
|
||||||
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,9 +84,6 @@
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp9_dec_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_vp9_dec_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_vp9_dec_debug
|
#define GST_CAT_DEFAULT gst_d3d11_vp9_dec_debug
|
||||||
|
|
||||||
/* reference list 8 + 4 margin */
|
|
||||||
#define NUM_OUTPUT_VIEW 12
|
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
typedef struct _GstD3D11Vp9DecInner
|
typedef struct _GstD3D11Vp9DecInner
|
||||||
{
|
{
|
||||||
|
@ -385,7 +382,7 @@ gst_d3d11_vp9_dec_new_sequence (GstVp9Decoder * decoder,
|
||||||
|
|
||||||
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
if (!gst_d3d11_decoder_configure (inner->d3d11_decoder,
|
||||||
decoder->input_state, &info, (gint) frame_hdr->width,
|
decoder->input_state, &info, (gint) frame_hdr->width,
|
||||||
(gint) frame_hdr->height, NUM_OUTPUT_VIEW)) {
|
(gint) frame_hdr->height, max_dpb_size)) {
|
||||||
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
GST_ERROR_OBJECT (self, "Failed to create decoder");
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue