Commit fe278578 authored by Seungha Yang's avatar Seungha Yang 🐑
Browse files

d3d11h264dec: Keep track of actually configured DPB size

... instead of the largest we ever seen.
Note that d3d11h264dec element holds previously configured DPB size
for later decoder object re-open decision.

This is to fix below case:
1) Initial SPS, required DPB size is 6
  - decoder object is opened with DPB size 6
  - max_dpb_size is now 6
2) SPS update with resolution change, required DPB size is 1
  - decoder object is re-opened with DPB size 1
  - max_dpb_size should be updated to 1, but it didn't happen (BUG)
3) SPS update without resolution change, only required DPB size is updated to 6
  - decoder object should be re-opened but didn't happen
    because we didn't update max_dpb_size at 2).

Part-of: <gstreamer/gst-plugins-bad!2057>
parent c87f178e
Pipeline #279325 passed with stages
in 26 minutes and 39 seconds
......@@ -440,7 +440,6 @@ gst_d3d11_h264_dec_new_sequence (GstH264Decoder * decoder,
if (self->max_dpb_size < max_dpb_size) {
GST_INFO_OBJECT (self, "Requires larger DPB size (%d -> %d)",
self->max_dpb_size, max_dpb_size);
self->max_dpb_size = max_dpb_size;
modified = TRUE;
}
......@@ -471,6 +470,12 @@ gst_d3d11_h264_dec_new_sequence (GstH264Decoder * decoder,
gst_video_info_set_format (&info,
self->out_format, self->width, self->height);
/* Store configured DPB size here. Then, it will be referenced later
* to decide whether we need to re-open decoder object or not.
* For instance, if every configuration is same apart from DPB size and
* new DPB size is decreased, we can reuse existing decoder object.
*/
self->max_dpb_size = max_dpb_size;
gst_d3d11_decoder_reset (self->d3d11_decoder);
if (!gst_d3d11_decoder_open (self->d3d11_decoder, GST_D3D11_CODEC_H264,
&info, self->coded_width, self->coded_height,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment