[vlc-commits] [Git][videolan/vlc][master] 3 commits: tracer: refector VLC_TRACE from ticks

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu May 12 18:19:30 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
1a54b8d2 by Thomas Guillem at 2022-05-12T18:07:58+00:00
tracer: refector VLC_TRACE from ticks

- - - - -
20973203 by Thomas Guillem at 2022-05-12T18:07:58+00:00
tracer: use a define for tick -> integer conversion

- - - - -
7ebb2d48 by Thomas Guillem at 2022-05-12T18:07:58+00:00
tracer: json: use a define for tick -> integer conversion

This fixes a timebase mismatch between values from tracer entries (NS vs US).

- - - - -


2 changed files:

- include/vlc_tracer.h
- modules/logger/json.c


Changes:

=====================================
include/vlc_tracer.h
=====================================
@@ -52,6 +52,8 @@ typedef union
     const char *string;
 } vlc_tracer_value_t;
 
+#define VLC_TRACER_TIME_FROM_TICK(ts) NS_FROM_VLC_TICK(ts)
+
 /**
  * Trace message
  */
@@ -100,7 +102,7 @@ VLC_API void vlc_tracer_Trace(struct vlc_tracer *tracer, ...);
 static inline struct vlc_tracer_entry vlc_tracer_entry_FromTick(const char *key, vlc_tick_t value)
 {
     vlc_tracer_value_t tracer_value;
-    tracer_value.integer = value;
+    tracer_value.integer = VLC_TRACER_TIME_FROM_TICK(value);
     struct vlc_tracer_entry trace = { key, tracer_value, VLC_TRACER_INT };
     return trace;
 }
@@ -151,7 +153,7 @@ static inline void vlc_tracer_TraceStreamPTS(struct vlc_tracer *tracer, const ch
                                 vlc_tick_t pts)
 {
     vlc_tracer_Trace(tracer, VLC_TRACE("type", type), VLC_TRACE("id", id),
-                     VLC_TRACE("stream", stream), VLC_TRACE("pts", NS_FROM_VLC_TICK(pts)),
+                     VLC_TRACE("stream", stream), VLC_TRACE("pts", pts),
                      VLC_TRACE_END);
 }
 
@@ -160,8 +162,8 @@ static inline void vlc_tracer_TraceStreamDTS(struct vlc_tracer *tracer, const ch
                                 vlc_tick_t pts, vlc_tick_t dts)
 {
     vlc_tracer_Trace(tracer, VLC_TRACE("type", type), VLC_TRACE("id", id),
-                     VLC_TRACE("stream", stream), VLC_TRACE("pts", NS_FROM_VLC_TICK(pts)),
-                     VLC_TRACE("dts", NS_FROM_VLC_TICK(dts)), VLC_TRACE_END);
+                     VLC_TRACE("stream", stream), VLC_TRACE("pts", pts),
+                     VLC_TRACE("dts", dts), VLC_TRACE_END);
 }
 
 static inline void vlc_tracer_TraceRender(struct vlc_tracer *tracer, const char *type,
@@ -169,12 +171,11 @@ static inline void vlc_tracer_TraceRender(struct vlc_tracer *tracer, const char
 {
     if (now != VLC_TICK_MAX && now != VLC_TICK_INVALID)
         vlc_tracer_Trace(tracer, VLC_TRACE("type", type), VLC_TRACE("id", id),
-                         VLC_TRACE("pts", NS_FROM_VLC_TICK(pts)),
-                         VLC_TRACE("render_ts", NS_FROM_VLC_TICK(now)), VLC_TRACE_END);
+                         VLC_TRACE("pts", pts),
+                         VLC_TRACE("render_ts", now), VLC_TRACE_END);
     else
         vlc_tracer_Trace(tracer, VLC_TRACE("type", type), VLC_TRACE("id", id),
-                         VLC_TRACE("pts", NS_FROM_VLC_TICK(pts)),
-                         VLC_TRACE_END);
+                         VLC_TRACE("pts", pts), VLC_TRACE_END);
 }
 
 static inline void vlc_tracer_TraceEvent(struct vlc_tracer *tracer, const char *type,
@@ -188,7 +189,7 @@ static inline void vlc_tracer_TracePCR( struct vlc_tracer *tracer, const char *t
                                     const char *id, vlc_tick_t pcr)
 {
     vlc_tracer_Trace(tracer, VLC_TRACE("type", type), VLC_TRACE("id", id),
-                     VLC_TRACE("pcr", NS_FROM_VLC_TICK(pcr)), VLC_TRACE_END);
+                     VLC_TRACE("pcr", pcr), VLC_TRACE_END);
 }
 
 /**


=====================================
modules/logger/json.c
=====================================
@@ -161,7 +161,7 @@ static void TraceJson(void *opaque, va_list entries)
 
     flockfile(stream);
     JsonStartObjectSection(stream, NULL);
-    JsonPrintKeyValueNumber(stream, "Timestamp", US_FROM_VLC_TICK(vlc_tick_now()));
+    JsonPrintKeyValueNumber(stream, "Timestamp", VLC_TRACER_TIME_FROM_TICK(vlc_tick_now()));
     fputc(',', stream);
 
     JsonStartObjectSection(stream, "Body");



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/84659b1591bf26684f1047227f23e757f8cb4e3c...7ebb2d4895991e06872a50444f5108634a89e785

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/84659b1591bf26684f1047227f23e757f8cb4e3c...7ebb2d4895991e06872a50444f5108634a89e785
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list