The enabling symbol is renamed FF_AVFILTER_TRACE. Avoid conflicts with the DEBUG macro, which may be defined for different purposes.tags/n1.0
| @@ -182,7 +182,7 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) | |||||
| AVFilterPad *dst = link->dstpad; | AVFilterPad *dst = link->dstpad; | ||||
| int64_t pts; | int64_t pts; | ||||
| FF_DPRINTF_START(NULL, filter_samples); ff_dlog_link(NULL, link, 1); | |||||
| FF_TPRINTF_START(NULL, filter_samples); ff_tlog_link(NULL, link, 1); | |||||
| if (!(filter_samples = dst->filter_samples)) | if (!(filter_samples = dst->filter_samples)) | ||||
| filter_samples = ff_default_filter_samples; | filter_samples = ff_default_filter_samples; | ||||
| @@ -19,8 +19,6 @@ | |||||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||||
| */ | */ | ||||
| /* #define DEBUG */ | |||||
| #include "libavutil/pixdesc.h" | #include "libavutil/pixdesc.h" | ||||
| #include "libavutil/rational.h" | #include "libavutil/rational.h" | ||||
| #include "libavutil/audioconvert.h" | #include "libavutil/audioconvert.h" | ||||
| @@ -43,17 +41,17 @@ char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms) | |||||
| return buf; | return buf; | ||||
| } | } | ||||
| void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end) | |||||
| void ff_tlog_ref(void *ctx, AVFilterBufferRef *ref, int end) | |||||
| { | { | ||||
| av_unused char buf[16]; | av_unused char buf[16]; | ||||
| av_dlog(ctx, | |||||
| ff_tlog(ctx, | |||||
| "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64, | "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, 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->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3], | ||||
| ref->pts, ref->pos); | ref->pts, ref->pos); | ||||
| if (ref->video) { | if (ref->video) { | ||||
| av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c", | |||||
| ff_tlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c", | |||||
| ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den, | ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den, | ||||
| ref->video->w, ref->video->h, | ref->video->w, ref->video->h, | ||||
| !ref->video->interlaced ? 'P' : /* Progressive */ | !ref->video->interlaced ? 'P' : /* Progressive */ | ||||
| @@ -62,13 +60,13 @@ void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end) | |||||
| av_get_picture_type_char(ref->video->pict_type)); | av_get_picture_type_char(ref->video->pict_type)); | ||||
| } | } | ||||
| if (ref->audio) { | if (ref->audio) { | ||||
| av_dlog(ctx, " cl:%"PRId64"d n:%d r:%d", | |||||
| ff_tlog(ctx, " cl:%"PRId64"d n:%d r:%d", | |||||
| ref->audio->channel_layout, | ref->audio->channel_layout, | ||||
| ref->audio->nb_samples, | ref->audio->nb_samples, | ||||
| ref->audio->sample_rate); | ref->audio->sample_rate); | ||||
| } | } | ||||
| av_dlog(ctx, "]%s", end ? "\n" : ""); | |||||
| ff_tlog(ctx, "]%s", end ? "\n" : ""); | |||||
| } | } | ||||
| unsigned avfilter_version(void) { | unsigned avfilter_version(void) { | ||||
| @@ -295,10 +293,10 @@ int avfilter_config_links(AVFilterContext *filter) | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| void ff_dlog_link(void *ctx, AVFilterLink *link, int end) | |||||
| void ff_tlog_link(void *ctx, AVFilterLink *link, int end) | |||||
| { | { | ||||
| if (link->type == AVMEDIA_TYPE_VIDEO) { | if (link->type == AVMEDIA_TYPE_VIDEO) { | ||||
| av_dlog(ctx, | |||||
| ff_tlog(ctx, | |||||
| "link[%p s:%dx%d fmt:%s %s->%s]%s", | "link[%p s:%dx%d fmt:%s %s->%s]%s", | ||||
| link, link->w, link->h, | link, link->w, link->h, | ||||
| av_pix_fmt_descriptors[link->format].name, | av_pix_fmt_descriptors[link->format].name, | ||||
| @@ -309,7 +307,7 @@ void ff_dlog_link(void *ctx, AVFilterLink *link, int end) | |||||
| char buf[128]; | char buf[128]; | ||||
| av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout); | av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout); | ||||
| av_dlog(ctx, | |||||
| ff_tlog(ctx, | |||||
| "link[%p r:%d cl:%s fmt:%s %s->%s]%s", | "link[%p r:%d cl:%s fmt:%s %s->%s]%s", | ||||
| link, (int)link->sample_rate, buf, | link, (int)link->sample_rate, buf, | ||||
| av_get_sample_fmt_name(link->format), | av_get_sample_fmt_name(link->format), | ||||
| @@ -321,7 +319,7 @@ void ff_dlog_link(void *ctx, AVFilterLink *link, int end) | |||||
| int ff_request_frame(AVFilterLink *link) | int ff_request_frame(AVFilterLink *link) | ||||
| { | { | ||||
| FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1); | |||||
| FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1); | |||||
| if (link->srcpad->request_frame) | if (link->srcpad->request_frame) | ||||
| return link->srcpad->request_frame(link); | return link->srcpad->request_frame(link); | ||||
| @@ -126,15 +126,23 @@ void ff_free_pool(AVFilterPool *pool); | |||||
| void ff_command_queue_pop(AVFilterContext *filter); | void ff_command_queue_pop(AVFilterContext *filter); | ||||
| /* misc debug functions */ | |||||
| /* misc trace functions */ | |||||
| #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func) | |||||
| /* #define FF_AVFILTER_TRACE */ | |||||
| #ifdef FF_AVFILTER_TRACE | |||||
| # define ff_tlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) | |||||
| #else | |||||
| # define ff_tlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) | |||||
| #endif | |||||
| #define FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func) | |||||
| char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms); | char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms); | ||||
| void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end); | |||||
| void ff_tlog_ref(void *ctx, AVFilterBufferRef *ref, int end); | |||||
| void ff_dlog_link(void *ctx, AVFilterLink *link, int end); | |||||
| void ff_tlog_link(void *ctx, AVFilterLink *link, int end); | |||||
| /** | /** | ||||
| * Insert a new pad. | * Insert a new pad. | ||||
| @@ -132,8 +132,8 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int | |||||
| AVFilterBufferRef *ret = NULL; | AVFilterBufferRef *ret = NULL; | ||||
| av_unused char buf[16]; | av_unused char buf[16]; | ||||
| FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); | |||||
| av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h); | |||||
| FF_TPRINTF_START(NULL, get_video_buffer); ff_tlog_link(NULL, link, 0); | |||||
| ff_tlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h); | |||||
| if (link->dstpad->get_video_buffer) | if (link->dstpad->get_video_buffer) | ||||
| ret = link->dstpad->get_video_buffer(link, perms, w, h); | ret = link->dstpad->get_video_buffer(link, perms, w, h); | ||||
| @@ -144,7 +144,7 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int | |||||
| if (ret) | if (ret) | ||||
| ret->type = AVMEDIA_TYPE_VIDEO; | ret->type = AVMEDIA_TYPE_VIDEO; | ||||
| FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1); | |||||
| FF_TPRINTF_START(NULL, get_video_buffer); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " returning "); ff_tlog_ref(NULL, ret, 1); | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| @@ -177,7 +177,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) | |||||
| int perms = picref->perms; | int perms = picref->perms; | ||||
| AVFilterCommand *cmd= link->dst->command_queue; | AVFilterCommand *cmd= link->dst->command_queue; | ||||
| FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1); | |||||
| FF_TPRINTF_START(NULL, start_frame); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " "); ff_tlog_ref(NULL, picref, 1); | |||||
| if (!(start_frame = dst->start_frame)) | if (!(start_frame = dst->start_frame)) | ||||
| start_frame = default_start_frame; | start_frame = default_start_frame; | ||||
| @@ -284,7 +284,7 @@ void ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) | |||||
| int i, j, vsub; | int i, j, vsub; | ||||
| void (*draw_slice)(AVFilterLink *, int, int, int); | void (*draw_slice)(AVFilterLink *, int, int, int); | ||||
| FF_DPRINTF_START(NULL, draw_slice); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir); | |||||
| FF_TPRINTF_START(NULL, draw_slice); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir); | |||||
| /* copy the slice if needed for permission reasons */ | /* copy the slice if needed for permission reasons */ | ||||
| if (link->src_buf) { | if (link->src_buf) { | ||||