gst_h265_decoder_do_output_picture (self, to_output);
}
- if (gst_h265_dpb_is_full (priv->dpb)) {
- /* If we haven't managed to output anything to free up space in DPB
- * to store this picture, it's an error in the stream */
- GST_WARNING_OBJECT (self, "Could not free up space in DPB");
- return FALSE;
- }
-
return TRUE;
}
return dpb->pic_list->len;
}
-/**
- * gst_h265_dpb_is_full:
- * @dpb: a #GstH265Dpb
- *
- * Return: %TRUE if @dpb is full
- */
-gboolean
-gst_h265_dpb_is_full (GstH265Dpb * dpb)
-{
- g_return_val_if_fail (dpb != NULL, -1);
-
- return dpb->pic_list->len >= dpb->max_num_pics;
-}
-
/**
* gst_h265_dpb_get_picture:
* @dpb: a #GstH265Dpb
g_return_val_if_fail (dpb != NULL, FALSE);
g_assert (dpb->num_output_needed >= 0);
+ /* If DPB is full and there is no empty space to store current picture,
+ * need bumping.
+ * NOTE: current picture was added already by our decoding flow, so we
+ * need to do bumping until dpb->pic_list->len == dpb->max_num_pic
+ */
+ if (dpb->pic_list->len > dpb->max_num_pics) {
+ GST_TRACE ("No empty frame buffer, need bumping");
+ return TRUE;
+ }
+
/* C.5.2.3 */
if (dpb->num_output_needed > max_num_reorder_pics) {
GST_TRACE ("num_output_needed (%d) > max_num_reorder_pics (%d)",
GST_CODECS_API
gint gst_h265_dpb_get_size (GstH265Dpb * dpb);
-GST_CODECS_API
-gboolean gst_h265_dpb_is_full (GstH265Dpb * dpb);
-
GST_CODECS_API
gboolean gst_h265_dpb_needs_bump (GstH265Dpb * dpb,
guint max_num_reorder_pics,