summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2020-04-20 16:00:30 +0900
committerSeungha Yang <seungha@centricular.com>2020-04-20 13:55:49 +0000
commit6a7ea2908468a4913773901d1c9ab7bfdf4c65e5 (patch)
treedf89b00c338321e5169c32dff34c6b4479c5fc41 /gst-libs
parente96435dfea94f982e8563f53e53e5b7b7a75fee9 (diff)
downloadgstreamer-plugins-bad-6a7ea2908468a4913773901d1c9ab7bfdf4c65e5.tar.gz
h264decoder: Add some debug messages
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecs/gsth264decoder.c41
-rw-r--r--gst-libs/gst/codecs/gsth264picture.c3
2 files changed, 40 insertions, 4 deletions
diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c
index 42909d449..214629413 100644
--- a/gst-libs/gst/codecs/gsth264decoder.c
+++ b/gst-libs/gst/codecs/gsth264decoder.c
@@ -1130,6 +1130,9 @@ gst_h264_decoder_do_output_picture (GstH264Decoder * self,
return;
}
+ GST_LOG_OBJECT (self, "Outputting picture %p (frame_num %d, poc %d)",
+ picture, picture->frame_num, picture->pic_order_cnt);
+
if (picture->pic_order_cnt < priv->last_output_poc) {
GST_WARNING_OBJECT (self,
"Outputting out of order %d -> %d, likely a broken stream",
@@ -1157,8 +1160,14 @@ gst_h264_decoder_finish_current_picture (GstH264Decoder * self)
klass = GST_H264_DECODER_GET_CLASS (self);
if (klass->end_picture) {
- if (!klass->end_picture (self, priv->current_picture))
+ if (!klass->end_picture (self, priv->current_picture)) {
+ GST_WARNING_OBJECT (self,
+ "end picture failed, marking picture %p non-existing "
+ "(frame_num %d, poc %d)", priv->current_picture,
+ priv->current_picture->frame_num,
+ priv->current_picture->pic_order_cnt);
priv->current_picture->nonexisting = TRUE;
+ }
}
/* finish picture takes ownership of the picture */
@@ -1371,6 +1380,10 @@ gst_h264_decoder_sliding_window_picture_marking (GstH264Decoder * self)
return FALSE;
}
+ GST_TRACE_OBJECT (self,
+ "Unmark reference flag of picture %p (frame_num %d, poc %d)",
+ to_unmark, to_unmark->frame_num, to_unmark->pic_order_cnt);
+
to_unmark->ref = FALSE;
gst_h264_picture_unref (to_unmark);
}
@@ -1409,6 +1422,13 @@ gst_h264_decoder_reference_picture_marking (GstH264Decoder * self,
* from DPB and how to mark/unmark existing reference pictures, do so.
* Otherwise, fall back to default sliding window process */
if (picture->dec_ref_pic_marking.adaptive_ref_pic_marking_mode_flag) {
+ if (picture->nonexisting) {
+ GST_WARNING_OBJECT (self,
+ "Invalid memory management operation for non-existing picture "
+ "%p (frame_num %d, poc %d", picture, picture->frame_num,
+ picture->pic_order_cnt);
+ }
+
return gst_h264_decoder_handle_memory_management_opt (self, picture);
}
@@ -1470,7 +1490,8 @@ gst_h264_decoder_finish_picture (GstH264Decoder * self,
GstH264Picture *tmp = (GstH264Picture *) iter->data;
GST_TRACE_OBJECT (self,
- "\t%dth picture %p (poc %d)", i, tmp, tmp->pic_order_cnt);
+ "\t%dth picture %p (frame_num %d, poc %d)", i, tmp,
+ tmp->frame_num, tmp->pic_order_cnt);
i++;
}
#endif
@@ -1486,7 +1507,8 @@ gst_h264_decoder_finish_picture (GstH264Decoder * self,
GstH264Picture *tmp = (GstH264Picture *) iter->data;
GST_TRACE_OBJECT (self,
- "\t%dth picture %p (poc %d)", i, tmp, tmp->pic_order_cnt);
+ "\t%dth picture %p (frame_num %d, poc %d)", i, tmp,
+ tmp->frame_num, tmp->pic_order_cnt);
i++;
}
#endif
@@ -1766,12 +1788,16 @@ gst_h264_decoder_decode_slice (GstH264Decoder * self)
GstH264DecoderPrivate *priv = self->priv;
GstH264Slice *slice = &priv->current_slice;
GstH264Picture *picture = priv->current_picture;
+ gboolean ret;
if (!picture) {
GST_ERROR_OBJECT (self, "No current picture");
return FALSE;
}
+ GST_LOG_OBJECT (self, "Decode picture %p (frame_num %d, poc %d)",
+ picture, picture->frame_num, picture->pic_order_cnt);
+
if (slice->header.field_pic_flag == 0)
priv->max_pic_num = priv->max_frame_num;
else
@@ -1779,5 +1805,12 @@ gst_h264_decoder_decode_slice (GstH264Decoder * self)
g_assert (klass->decode_slice);
- return klass->decode_slice (self, picture, slice);
+ ret = klass->decode_slice (self, picture, slice);
+ if (!ret) {
+ GST_WARNING_OBJECT (self,
+ "Subclass didn't want to decode picture %p (frame_num %d, poc %d)",
+ picture, picture->frame_num, picture->pic_order_cnt);
+ }
+
+ return ret;
}
diff --git a/gst-libs/gst/codecs/gsth264picture.c b/gst-libs/gst/codecs/gsth264picture.c
index 03daa327e..fb8a3b7bb 100644
--- a/gst-libs/gst/codecs/gsth264picture.c
+++ b/gst-libs/gst/codecs/gsth264picture.c
@@ -252,6 +252,9 @@ gst_h264_dpb_delete_by_poc (GstH264Dpb * dpb, gint poc)
g_array_index (dpb->pic_list, GstH264Picture *, i);
if (picture->pic_order_cnt == poc) {
+ GST_TRACE ("remove picture %p for poc %d (frame num %d) from dpb",
+ picture, poc, picture->frame_num);
+
g_array_remove_index (dpb->pic_list, i);
return;
}