mxf: Verbose debug logging
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 13 Mar 2014 12:38:06 +0000 (13:38 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Wed, 19 Mar 2014 11:04:06 +0000 (12:04 +0100)
Print the UL in code format and in the short format used by the
specification.

libavformat/mxf.h

index 265b0cf..a2d919a 100644 (file)
@@ -79,7 +79,32 @@ extern const MXFCodecUL ff_mxf_pixel_format_uls[];
 int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt);
 const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base);
 
-#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
-                             (x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
+#ifdef DEBUG
+#define PRINT_KEY(pc, s, x)                         \
+    av_log(pc, AV_LOG_VERBOSE,                      \
+           "%s "                                    \
+           "0x%02x,0x%02x,0x%02x,0x%02x,"           \
+           "0x%02x,0x%02x,0x%02x,0x%02x,"           \
+           "0x%02x,0x%02x,0x%02x,0x%02x,"           \
+           "0x%02x,0x%02x,0x%02x,0x%02x ",          \
+            s,                                      \
+            (x)[0],  (x)[1],  (x)[2],  (x)[3],      \
+            (x)[4],  (x)[5],  (x)[6],  (x)[7],      \
+            (x)[8],  (x)[9],  (x)[10], (x)[11],     \
+            (x)[12], (x)[13], (x)[14], (x)[15]);    \
+    av_log(pc, AV_LOG_INFO,                         \
+           "%s "                                    \
+           "%02x.%02x.%02x.%02x."                   \
+           "%02x.%02x.%02x.%02x."                   \
+           "%02x.%02x.%02x.%02x."                   \
+           "%02x.%02x.%02x.%02x\n",                 \
+            s,                                      \
+            (x)[0],  (x)[1],  (x)[2],  (x)[3],      \
+            (x)[4],  (x)[5],  (x)[6],  (x)[7],      \
+            (x)[8],  (x)[9],  (x)[10], (x)[11],     \
+            (x)[12], (x)[13], (x)[14], (x)[15])
+#else
+#define PRINT_KEY(pc, s, x)
+#endif
 
 #endif /* AVFORMAT_MXF_H */