History

Implement ff_get_ref_perms_string() and use it for tracing.

Originally committed as revision 24900 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 16 years ago

Commit eedca991 parent 668338c3 files · +20 −4Browse files

Unified · Split

3 files
  1. libavfilter/avfilter.c +17 −3
  2. libavfilter/avfilter.h +1 −1
  3. libavfilter/internal.h +2 −0
libavfilter/avfilter.c+17−3
@@ -191,11 +191,23 @@ int avfilter_config_links(AVFilterContext *filter) · 190 unmodified lines
191 return 0;191 return 0;
192}192}
193 193
194char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
195{
196 snprintf(buf, buf_size, "%s%s%s%s%s",
197 perms & AV_PERM_READ ? "r" : "",
198 perms & AV_PERM_WRITE ? "w" : "",
199 perms & AV_PERM_PRESERVE ? "p" : "",
200 perms & AV_PERM_REUSE ? "r" : "",
201 perms & AV_PERM_REUSE2 ? "R" : "");
202 return buf;
203}
204
194void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)205void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)
195{206{
207 av_unused char buf[16];
196 dprintf(ctx,208 dprintf(ctx,
197 "ref[%p buf:%p refcount:%d perms:0x%x data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,209 "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
198 ref, ref->buf, ref->buf->refcount, ref->perms, ref->data[0],210 ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],
199 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],211 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
200 ref->pts, ref->pos);212 ref->pts, ref->pos);
201 213
@@ -233,7 +245,9 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int · 31 unmodified lines
233{245{
234 AVFilterBufferRef *ret = NULL;246 AVFilterBufferRef *ret = NULL;
235 247
236 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);248 av_unused char buf[16];
249 FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);
250 dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
237 251
238 if (link_dpad(link).get_video_buffer)252 if (link_dpad(link).get_video_buffer)
239 ret = link_dpad(link).get_video_buffer(link, perms, w, h);253 ret = link_dpad(link).get_video_buffer(link, perms, w, h);
libavfilter/avfilter.h+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27#define LIBAVFILTER_VERSION_MAJOR 127#define LIBAVFILTER_VERSION_MAJOR 1
28#define LIBAVFILTER_VERSION_MINOR 3828#define LIBAVFILTER_VERSION_MINOR 38
29#define LIBAVFILTER_VERSION_MICRO 029#define LIBAVFILTER_VERSION_MICRO 1
30 30
31#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \31#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
32 LIBAVFILTER_VERSION_MINOR, \32 LIBAVFILTER_VERSION_MINOR, \
libavfilter/internal.h+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
28 28
29void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end);29void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end);
30 30
31char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms);
32
31void ff_dprintf_link(void *ctx, AVFilterLink *link, int end);33void ff_dprintf_link(void *ctx, AVFilterLink *link, int end);
32 34
33#define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)35#define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t