}
/* 8.2.5.3. Ensure the DPB doesn't overflow by discarding the oldest picture */
- num_ref_pics = gst_h264_dpb_num_ref_pictures (priv->dpb);
+ num_ref_pics = gst_h264_dpb_num_ref_frames (priv->dpb);
max_num_ref_frames = MAX (1, sps->num_ref_frames);
if (num_ref_pics < max_num_ref_frames)
&& 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_pics (priv->dpb)) {
+ 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,
- gst_h264_dpb_get_max_num_pics (priv->dpb));
+ gst_h264_dpb_get_max_num_frames (priv->dpb));
priv->max_num_reorder_frames = 0;
return FALSE;
break;
default:
priv->max_num_reorder_frames =
- gst_h264_dpb_get_max_num_pics (priv->dpb);
+ gst_h264_dpb_get_max_num_frames (priv->dpb);
break;
}
} else {
- priv->max_num_reorder_frames = gst_h264_dpb_get_max_num_pics (priv->dpb);
+ priv->max_num_reorder_frames = gst_h264_dpb_get_max_num_frames (priv->dpb);
}
return TRUE;
/* Safety, so that subclass don't need bound checking */
g_return_val_if_fail (max_dpb_size <= GST_H264_DPB_MAX_SIZE, FALSE);
- prev_max_dpb_size = gst_h264_dpb_get_max_num_pics (priv->dpb);
+ prev_max_dpb_size = gst_h264_dpb_get_max_num_frames (priv->dpb);
if (priv->width != sps->width || priv->height != sps->height ||
prev_max_dpb_size != max_dpb_size) {
GstH264DecoderClass *klass = GST_H264_DECODER_GET_CLASS (self);
priv->height = sps->height;
gst_h264_decoder_set_latency (self, sps, max_dpb_size);
- gst_h264_dpb_set_max_num_pics (priv->dpb, max_dpb_size);
+ gst_h264_dpb_set_max_num_frames (priv->dpb, max_dpb_size);
}
return gst_h264_decoder_update_max_num_reorder_frames (self, sps);
struct _GstH264Dpb
{
GArray *pic_list;
- gint max_num_pics;
+ gint max_num_frames;
gint num_output_needed;
gint32 last_output_poc;
};
}
/**
- * gst_h264_dpb_set_max_num_pics:
+ * gst_h264_dpb_set_max_num_frames:
* @dpb: a #GstH264Dpb
- * @max_num_pics: the maximum number of picture
+ * @max_num_frames: the maximum number of picture
*
- * Set the number of maximum allowed pictures to store
+ * Set the number of maximum allowed frames to store
+ *
+ * Since: 1.20
*/
void
-gst_h264_dpb_set_max_num_pics (GstH264Dpb * dpb, gint max_num_pics)
+gst_h264_dpb_set_max_num_frames (GstH264Dpb * dpb, gint max_num_frames)
{
g_return_if_fail (dpb != NULL);
- dpb->max_num_pics = max_num_pics;
+ dpb->max_num_frames = max_num_frames;
}
/**
- * gst_h264_dpb_get_max_num_pics:
+ * gst_h264_dpb_get_max_num_frames:
* @dpb: a #GstH264Dpb
*
- * Returns: the number of maximum pictures
+ * Returns: the number of maximum frames
+ *
+ * Since: 1.20
*/
gint
-gst_h264_dpb_get_max_num_pics (GstH264Dpb * dpb)
+gst_h264_dpb_get_max_num_frames (GstH264Dpb * dpb)
{
g_return_val_if_fail (dpb != NULL, 0);
- return dpb->max_num_pics;
+ return dpb->max_num_frames;
}
/**
}
/**
- * gst_h264_dpb_num_ref_pictures:
+ * gst_h264_dpb_num_ref_frames:
* @dpb: a #GstH264Dpb
*
- * Returns: The number of referenced pictures
+ * Returns: The number of referenced frames
+ *
+ * Since: 1.20
*/
gint
-gst_h264_dpb_num_ref_pictures (GstH264Dpb * dpb)
+gst_h264_dpb_num_ref_frames (GstH264Dpb * dpb)
{
gint i;
gint ret = 0;
static gboolean
gst_h264_dpb_has_empty_frame_buffer (GstH264Dpb * dpb)
{
- if (dpb->pic_list->len <= dpb->max_num_pics)
+ if (dpb->pic_list->len <= dpb->max_num_frames)
return TRUE;
return FALSE;
GstH264Dpb * gst_h264_dpb_new (void);
GST_CODECS_API
-void gst_h264_dpb_set_max_num_pics (GstH264Dpb * dpb,
- gint max_num_pics);
+void gst_h264_dpb_set_max_num_frames (GstH264Dpb * dpb,
+ gint max_num_frames);
GST_CODECS_API
-gint gst_h264_dpb_get_max_num_pics (GstH264Dpb * dpb);
+gint gst_h264_dpb_get_max_num_frames (GstH264Dpb * dpb);
GST_CODECS_API
void gst_h264_dpb_free (GstH264Dpb * dpb);
void gst_h264_dpb_delete_unused (GstH264Dpb * dpb);
GST_CODECS_API
-gint gst_h264_dpb_num_ref_pictures (GstH264Dpb * dpb);
+gint gst_h264_dpb_num_ref_frames (GstH264Dpb * dpb);
GST_CODECS_API
void gst_h264_dpb_mark_all_non_ref (GstH264Dpb * dpb);