# HG changeset patch # User astrange # Date 1217037430 0 # Node ID 7b2819083061e47961c3799bc053d542ef0bc926 # Parent dfe1d1d104ebe74a5adfd865c2e1a37cfe1fbf8d Add a new -debug option for tracing calls to the default get/release_buffer functions. diff -r dfe1d1d104eb -r 7b2819083061 avcodec.h --- a/avcodec.h Fri Jul 25 23:55:31 2008 +0000 +++ b/avcodec.h Sat Jul 26 01:57:10 2008 +0000 @@ -1462,6 +1462,7 @@ #define FF_DEBUG_BUGS 0x00001000 #define FF_DEBUG_VIS_QP 0x00002000 #define FF_DEBUG_VIS_MB_TYPE 0x00004000 +#define FF_DEBUG_BUFFERS 0x00008000 /** * debug diff -r dfe1d1d104eb -r 7b2819083061 utils.c --- a/utils.c Fri Jul 25 23:55:31 2008 +0000 +++ b/utils.c Sat Jul 26 01:57:10 2008 +0000 @@ -280,6 +280,9 @@ } s->internal_buffer_count++; + if(s->debug&FF_DEBUG_BUFFERS) + av_log(s, AV_LOG_DEBUG, "default_get_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count); + return 0; } @@ -307,6 +310,9 @@ // pic->base[i]=NULL; } //printf("R%X\n", pic->opaque); + + if(s->debug&FF_DEBUG_BUFFERS) + av_log(s, AV_LOG_DEBUG, "default_release_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count); } int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){ @@ -577,6 +583,7 @@ {"bugs", NULL, 0, FF_OPT_TYPE_CONST, FF_DEBUG_BUGS, INT_MIN, INT_MAX, V|D, "debug"}, {"vis_qp", "visualize quantization parameter (QP), lower QP are tinted greener", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_QP, INT_MIN, INT_MAX, V|D, "debug"}, {"vis_mb_type", "visualize block types", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MB_TYPE, INT_MIN, INT_MAX, V|D, "debug"}, +{"buffers", "picture buffer allocations", 0, FF_OPT_TYPE_CONST, FF_DEBUG_BUFFERS, INT_MIN, INT_MAX, V|D, "debug"}, {"vismv", "visualize motion vectors (MVs)", OFFSET(debug_mv), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, V|D, "debug_mv"}, {"pf", "forward predicted MVs of P-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_P_FOR, INT_MIN, INT_MAX, V|D, "debug_mv"}, {"bf", "forward predicted MVs of B-frames", 0, FF_OPT_TYPE_CONST, FF_DEBUG_VIS_MV_B_FOR, INT_MIN, INT_MAX, V|D, "debug_mv"},