History

lavfi: move tracing utilities definition from video.c to avfilter.c

These utilities are meant to be defined in avfilter.c, since they are generic and thus contain both audio and video code.

Stefano Sabatini committed 14 years ago

Commit 1488c4d1 parent 1faf0d63 files · +46 −40Browse files

Showing the changes to libavfilter/avfilter.c (1 of 3 files). Show all

Unified · Split

libavfilter/avfilter.c+40−0
@@ -31,6 +31,46 @@ · 30 unmodified lines
3131 #include "formats.h"
3232 #include "internal.h"
3333
34+char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
35+{
36+ snprintf(buf, buf_size, "%s%s%s%s%s%s",
37+ perms & AV_PERM_READ ? "r" : "",
38+ perms & AV_PERM_WRITE ? "w" : "",
39+ perms & AV_PERM_PRESERVE ? "p" : "",
40+ perms & AV_PERM_REUSE ? "u" : "",
41+ perms & AV_PERM_REUSE2 ? "U" : "",
42+ perms & AV_PERM_NEG_LINESIZES ? "n" : "");
43+ return buf;
44+}
45+
46+void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
47+{
48+ av_unused char buf[16];
49+ av_dlog(ctx,
50+ "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
51+ ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],
52+ ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
53+ ref->pts, ref->pos);
54+
55+ if (ref->video) {
56+ av_dlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
57+ ref->video->sample_aspect_ratio.num, ref->video->sample_aspect_ratio.den,
58+ ref->video->w, ref->video->h,
59+ !ref->video->interlaced ? 'P' : /* Progressive */
60+ ref->video->top_field_first ? 'T' : 'B', /* Top / Bottom */
61+ ref->video->key_frame,
62+ av_get_picture_type_char(ref->video->pict_type));
63+ }
64+ if (ref->audio) {
65+ av_dlog(ctx, " cl:%"PRId64"d n:%d r:%d",
66+ ref->audio->channel_layout,
67+ ref->audio->nb_samples,
68+ ref->audio->sample_rate);
69+ }
70+
71+ av_dlog(ctx, "]%s", end ? "\n" : "");
72+}
73+
3474 unsigned avfilter_version(void) {
3575 av_assert0(LIBAVFILTER_VERSION_MICRO >= 100);
3676 return LIBAVFILTER_VERSION_INT;

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