[FFmpeg-cvslog] r24900 - in trunk/libavfilter: avfilter.c avfilter.h internal.h

stefano subversion
Tue Aug 24 17:12:13 CEST 2010


Author: stefano
Date: Tue Aug 24 17:12:13 2010
New Revision: 24900

Log:
Implement ff_get_ref_perms_string() and use it for tracing.

Modified:
   trunk/libavfilter/avfilter.c
   trunk/libavfilter/avfilter.h
   trunk/libavfilter/internal.h

Modified: trunk/libavfilter/avfilter.c
==============================================================================
--- trunk/libavfilter/avfilter.c	Tue Aug 24 17:08:53 2010	(r24899)
+++ trunk/libavfilter/avfilter.c	Tue Aug 24 17:12:13 2010	(r24900)
@@ -191,11 +191,23 @@ int avfilter_config_links(AVFilterContex
     return 0;
 }
 
+char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
+{
+    snprintf(buf, buf_size, "%s%s%s%s%s",
+             perms & AV_PERM_READ      ? "r" : "",
+             perms & AV_PERM_WRITE     ? "w" : "",
+             perms & AV_PERM_PRESERVE  ? "p" : "",
+             perms & AV_PERM_REUSE     ? "r" : "",
+             perms & AV_PERM_REUSE2    ? "R" : "");
+    return buf;
+}
+
 void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)
 {
+    av_unused char buf[16];
     dprintf(ctx,
-            "ref[%p buf:%p refcount:%d perms:0x%x data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
-            ref, ref->buf, ref->buf->refcount, ref->perms, ref->data[0],
+            "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
+            ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],
             ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
             ref->pts, ref->pos);
 
@@ -233,7 +245,9 @@ AVFilterBufferRef *avfilter_get_video_bu
 {
     AVFilterBufferRef *ret = NULL;
 
-    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " perms:%d w:%d h:%d\n", perms, w, h);
+    av_unused char buf[16];
+    FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);
+    dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
 
     if (link_dpad(link).get_video_buffer)
         ret = link_dpad(link).get_video_buffer(link, perms, w, h);

Modified: trunk/libavfilter/avfilter.h
==============================================================================
--- trunk/libavfilter/avfilter.h	Tue Aug 24 17:08:53 2010	(r24899)
+++ trunk/libavfilter/avfilter.h	Tue Aug 24 17:12:13 2010	(r24900)
@@ -26,7 +26,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  1
 #define LIBAVFILTER_VERSION_MINOR 38
-#define LIBAVFILTER_VERSION_MICRO  0
+#define LIBAVFILTER_VERSION_MICRO  1
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                LIBAVFILTER_VERSION_MINOR, \

Modified: trunk/libavfilter/internal.h
==============================================================================
--- trunk/libavfilter/internal.h	Tue Aug 24 17:08:53 2010	(r24899)
+++ trunk/libavfilter/internal.h	Tue Aug 24 17:12:13 2010	(r24900)
@@ -28,6 +28,8 @@
 
 void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end);
 
+char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms);
+
 void ff_dprintf_link(void *ctx, AVFilterLink *link, int end);
 
 #define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)



More information about the ffmpeg-cvslog mailing list