gint max_frame_num;
gint max_pic_num;
gint max_long_term_frame_idx;
- gsize max_num_reorder_frames;
gint prev_frame_num;
gint prev_ref_frame_num;
GstH264SPS * sps)
{
GstH264DecoderPrivate *priv = self->priv;
+ gsize max_num_reorder_frames = 0;
if (sps->vui_parameters_present_flag
&& sps->vui_parameters.bitstream_restriction_flag) {
- priv->max_num_reorder_frames = sps->vui_parameters.num_reorder_frames;
- if (priv->max_num_reorder_frames >
- gst_h264_dpb_get_max_num_frames (priv->dpb)) {
+ max_num_reorder_frames = sps->vui_parameters.num_reorder_frames;
+ if (max_num_reorder_frames > gst_h264_dpb_get_max_num_frames (priv->dpb)) {
GST_WARNING
("max_num_reorder_frames present, but larger than MaxDpbFrames (%d > %d)",
- (gint) priv->max_num_reorder_frames,
+ (gint) max_num_reorder_frames,
gst_h264_dpb_get_max_num_frames (priv->dpb));
- priv->max_num_reorder_frames = 0;
+ max_num_reorder_frames = 0;
return FALSE;
}
+ gst_h264_dpb_set_max_num_reorder_frames (priv->dpb, max_num_reorder_frames);
+
return TRUE;
}
case 110:
case 122:
case 244:
- priv->max_num_reorder_frames = 0;
+ max_num_reorder_frames = 0;
break;
default:
- priv->max_num_reorder_frames =
- gst_h264_dpb_get_max_num_frames (priv->dpb);
+ max_num_reorder_frames = gst_h264_dpb_get_max_num_frames (priv->dpb);
break;
}
} else {
- priv->max_num_reorder_frames = gst_h264_dpb_get_max_num_frames (priv->dpb);
+ max_num_reorder_frames = gst_h264_dpb_get_max_num_frames (priv->dpb);
}
+ gst_h264_dpb_set_max_num_reorder_frames (priv->dpb, max_num_reorder_frames);
+
return TRUE;
}
GArray *pic_list;
gint max_num_frames;
gint num_output_needed;
+ guint32 max_num_reorder_frames;
gint32 last_output_poc;
gboolean interlaced;
}
/**
+ * gst_h264_dpb_set_max_num_reorder_frames:
+ * @dpb: a #GstH264Dpb
+ * @max_num_reorder_frames: the max number of reorder frames, which
+ * should not exceed the max size of DPB.
+ *
+ * Since: 1.20
+ */
+void
+gst_h264_dpb_set_max_num_reorder_frames (GstH264Dpb * dpb,
+ guint32 max_num_reorder_frames)
+{
+ g_return_if_fail (dpb != NULL);
+ g_return_if_fail (max_num_reorder_frames <= dpb->max_num_frames);
+
+ dpb->max_num_reorder_frames = max_num_reorder_frames;
+}
+
+/**
* gst_h264_dpb_add:
* @dpb: a #GstH264Dpb
* @picture: (transfer full): a #GstH264Picture