Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2021-06-23 16:41:20 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-09-22 15:04:44 +0300
commit55ca21edae670041ebc2ee50c96088aa0fbb3c38 (patch)
treec66916211c996c333aff19077a421c88dbcbf122
parentfea7f02a1dc5a0a4efb1e324adf2368f0363f7da (diff)
clocksync: Add some debug output to the clock waiting code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/841>
-rw-r--r--plugins/elements/gstclocksync.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/plugins/elements/gstclocksync.c b/plugins/elements/gstclocksync.c
index 96c70d0117..05258ab478 100644
--- a/plugins/elements/gstclocksync.c
+++ b/plugins/elements/gstclocksync.c
@@ -310,23 +310,43 @@ gst_clocksync_do_sync (GstClockSync * clocksync, GstClockTime running_time)
GstClockReturn cret;
GstClockTime timestamp;
GstClockTimeDiff ts_offset = clocksync->ts_offset;
+ GstClockTimeDiff jitter;
timestamp = running_time + GST_ELEMENT (clocksync)->base_time +
clocksync->upstream_latency;
+
+ GST_DEBUG_OBJECT (clocksync,
+ "running time: %" GST_TIME_FORMAT " base time: %" GST_TIME_FORMAT
+ " upstream latency: %" GST_TIME_FORMAT, GST_TIME_ARGS (running_time),
+ GST_TIME_ARGS (GST_ELEMENT (clocksync)->base_time),
+ GST_TIME_ARGS (clocksync->upstream_latency));
+
+ GST_DEBUG_OBJECT (clocksync,
+ "Waiting for clock time %" GST_TIME_FORMAT " ts offset: %"
+ GST_STIME_FORMAT, GST_TIME_ARGS (timestamp),
+ GST_STIME_ARGS (ts_offset));
+
if (ts_offset < 0) {
ts_offset = -ts_offset;
if (ts_offset < timestamp)
timestamp -= ts_offset;
else
timestamp = 0;
- } else
+ } else {
timestamp += ts_offset;
+ }
+
+ GST_DEBUG_OBJECT (clocksync, "Offset clock time %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (timestamp));
/* save id if we need to unlock */
clocksync->clock_id = gst_clock_new_single_shot_id (clock, timestamp);
GST_OBJECT_UNLOCK (clocksync);
- cret = gst_clock_id_wait (clocksync->clock_id, NULL);
+ cret = gst_clock_id_wait (clocksync->clock_id, &jitter);
+
+ GST_DEBUG_OBJECT (clocksync, "Clock returned %d, jitter %" GST_STIME_FORMAT,
+ cret, GST_STIME_ARGS (jitter));
GST_OBJECT_LOCK (clocksync);
if (clocksync->clock_id) {