summaryrefslogtreecommitdiff
path: root/omx/gstomxvideo.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2019-06-14 10:57:29 +0530
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>2019-06-17 09:17:14 +0530
commitcfeeb15b1e3fbe473212cc2747b9cd3dd10fbe2e (patch)
tree3e5058b2076b69516f69740fcc5e01ffdce6ede9 /omx/gstomxvideo.c
parenta7ecda85b6103d951b6a8805b5ee87ebeababa0b (diff)
downloadgst-omx-cfeeb15b1e3fbe473212cc2747b9cd3dd10fbe2e.tar.gz
omxvideo: add debug infos to find_nearest_frame()
Those debug infos have proved to be very helpful when debugging timestamp issues. They are often linked to gst-omx picking the wrong frame when trying to map from OMX.
Diffstat (limited to 'omx/gstomxvideo.c')
-rw-r--r--omx/gstomxvideo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/omx/gstomxvideo.c b/omx/gstomxvideo.c
index 9feda19..9b57b55 100644
--- a/omx/gstomxvideo.c
+++ b/omx/gstomxvideo.c
@@ -181,7 +181,8 @@ gst_omx_video_negotiation_map_free (GstOMXVideoNegotiationMap * m)
}
GstVideoCodecFrame *
-gst_omx_video_find_nearest_frame (GstOMXBuffer * buf, GList * frames)
+gst_omx_video_find_nearest_frame (GstElement * element, GstOMXBuffer * buf,
+ GList * frames)
{
GstVideoCodecFrame *best = NULL;
GstClockTimeDiff best_diff = G_MAXINT64;
@@ -192,10 +193,17 @@ gst_omx_video_find_nearest_frame (GstOMXBuffer * buf, GList * frames)
gst_util_uint64_scale (GST_OMX_GET_TICKS (buf->omx_buf->nTimeStamp),
GST_SECOND, OMX_TICKS_PER_SECOND);
+ GST_LOG_OBJECT (element, "look for ts %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (timestamp));
+
for (l = frames; l; l = l->next) {
GstVideoCodecFrame *tmp = l->data;
GstClockTimeDiff diff = ABS (GST_CLOCK_DIFF (timestamp, tmp->pts));
+ GST_LOG_OBJECT (element,
+ " frame %u diff %" G_GINT64_FORMAT " ts %" GST_TIME_FORMAT,
+ tmp->system_frame_number, diff, GST_TIME_ARGS (tmp->pts));
+
if (diff < best_diff) {
best = tmp;
best_diff = diff;