codecs: Pass the max_dpb_size to new_segment virtual
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 13 Feb 2020 04:48:16 +0000 (23:48 -0500)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Thu, 5 Mar 2020 03:06:16 +0000 (03:06 +0000)
On new_segment, the decoder is expected to negotiate. The decoder may want to
pre-allocate the needed buffers. Pass the max_dpb_size as this is needed to
determin how many buffers should be allocated.

gst-libs/gst/codecs/gsth264decoder.c
gst-libs/gst/codecs/gsth264decoder.h
sys/d3d11/gstd3d11h264dec.c

index 7e172fa..81db6ff 100644 (file)
@@ -1698,7 +1698,7 @@ gst_h264_decoder_process_sps (GstH264Decoder * self, GstH264SPS * sps)
 
     g_assert (klass->new_sequence);
 
-    if (!klass->new_sequence (self, sps)) {
+    if (!klass->new_sequence (self, sps, max_dpb_size)) {
       GST_ERROR_OBJECT (self, "subclass does not want accept new sequence");
       return FALSE;
     }
index 1dbe6ab..b5d8991 100644 (file)
@@ -82,7 +82,8 @@ struct _GstH264DecoderClass
   GstVideoDecoderClass parent_class;
 
   gboolean      (*new_sequence)     (GstH264Decoder * decoder,
-                                     const GstH264SPS * sps);
+                                     const GstH264SPS * sps,
+                                     gint max_dpb_size);
 
   gboolean      (*new_picture)      (GstH264Decoder * decoder,
                                      GstH264Picture * picture);
index 6836f4d..3f4c9da 100644 (file)
@@ -154,7 +154,7 @@ static gboolean gst_d3d11_h264_dec_src_query (GstVideoDecoder * decoder,
 
 /* GstH264Decoder */
 static gboolean gst_d3d11_h264_dec_new_sequence (GstH264Decoder * decoder,
-    const GstH264SPS * sps);
+    const GstH264SPS * sps, gint max_dpb_size);
 static gboolean gst_d3d11_h264_dec_new_picture (GstH264Decoder * decoder,
     GstH264Picture * picture);
 static GstFlowReturn gst_d3d11_h264_dec_output_picture (GstH264Decoder *
@@ -476,7 +476,7 @@ gst_d3d11_h264_dec_src_query (GstVideoDecoder * decoder, GstQuery * query)
 
 static gboolean
 gst_d3d11_h264_dec_new_sequence (GstH264Decoder * decoder,
-    const GstH264SPS * sps)
+    const GstH264SPS * sps, gint max_dpb_size)
 {
   GstD3D11H264Dec *self = GST_D3D11_H264_DEC (decoder);
   gint crop_width, crop_height;