History

Replace dprintf with av_dlog

dprintf clashes with POSIX.1-2008

Luca Barbato committed 15 years ago

Commit dfd2a001 parent 243f82447 files · +312 −308Browse files

Showing the changes to libavfilter (1 of 47 files). Show all

Unified · Split

libavfilter/avfilter.c+15−15
@@ -217,24 +217,24 @@ static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms) · 216 unmodified lines
217 return buf;217 return buf;
218}218}
219 219
220static void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)220static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
221{221{
222 av_unused char buf[16];222 av_unused char buf[16];
223 dprintf(ctx,223 av_dlog(ctx,
224 "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,224 "ref[%p buf:%p refcount:%d perms:%s data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
225 ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],225 ref, ref->buf, ref->buf->refcount, ff_get_ref_perms_string(buf, sizeof(buf), ref->perms), ref->data[0],
226 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],226 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
227 ref->pts, ref->pos);227 ref->pts, ref->pos);
228 228
229 if (ref->video) {229 if (ref->video) {
230 dprintf(ctx, " a:%d/%d s:%dx%d i:%c",230 av_dlog(ctx, " a:%d/%d s:%dx%d i:%c",
231 ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,231 ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,
232 ref->video->w, ref->video->h,232 ref->video->w, ref->video->h,
233 !ref->video->interlaced ? 'P' : /* Progressive */233 !ref->video->interlaced ? 'P' : /* Progressive */
234 ref->video->top_field_first ? 'T' : 'B'); /* Top / Bottom */234 ref->video->top_field_first ? 'T' : 'B'); /* Top / Bottom */
235 }235 }
236 if (ref->audio) {236 if (ref->audio) {
237 dprintf(ctx, " cl:%"PRId64"d sn:%d s:%d sr:%d p:%d",237 av_dlog(ctx, " cl:%"PRId64"d sn:%d s:%d sr:%d p:%d",
238 ref->audio->channel_layout,238 ref->audio->channel_layout,
239 ref->audio->nb_samples,239 ref->audio->nb_samples,
240 ref->audio->size,240 ref->audio->size,
@@ -242,13 +242,13 @@ static void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end) · 1 unmodified line
242 ref->audio->planar);242 ref->audio->planar);
243 }243 }
244 244
245 dprintf(ctx, "]%s", end ? "\n" : "");245 av_dlog(ctx, "]%s", end ? "\n" : "");
246}246}
247 247
248static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)248static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
249{249{
250 if (link->type == AVMEDIA_TYPE_VIDEO) {250 if (link->type == AVMEDIA_TYPE_VIDEO) {
251 dprintf(ctx,251 av_dlog(ctx,
252 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",252 "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
253 link, link->w, link->h,253 link, link->w, link->h,
254 av_pix_fmt_descriptors[link->format].name,254 av_pix_fmt_descriptors[link->format].name,
@@ -259,7 +259,7 @@ static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end) · 4 unmodified lines
259 char buf[128];259 char buf[128];
260 av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);260 av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
261 261
262 dprintf(ctx,262 av_dlog(ctx,
263 "link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",263 "link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",
264 link, link->sample_rate, buf,264 link, link->sample_rate, buf,
265 av_get_sample_fmt_name(link->format),265 av_get_sample_fmt_name(link->format),
@@ -269,15 +269,15 @@ static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end) · 3 unmodified lines
269 }269 }
270}270}
271 271
272#define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)272#define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
273 273
274AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)274AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
275{275{
276 AVFilterBufferRef *ret = NULL;276 AVFilterBufferRef *ret = NULL;
277 277
278 av_unused char buf[16];278 av_unused char buf[16];
279 FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);279 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0);
280 dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);280 av_dlog(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
281 281
282 if (link->dstpad->get_video_buffer)282 if (link->dstpad->get_video_buffer)
283 ret = link->dstpad->get_video_buffer(link, perms, w, h);283 ret = link->dstpad->get_video_buffer(link, perms, w, h);
@@ -288,7 +288,7 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int · 4 unmodified lines
288 if (ret)288 if (ret)
289 ret->type = AVMEDIA_TYPE_VIDEO;289 ret->type = AVMEDIA_TYPE_VIDEO;
290 290
291 FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_ref(NULL, ret, 1);291 FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
292 292
293 return ret;293 return ret;
294}294}
@@ -353,7 +353,7 @@ AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms, · 58 unmodified lines
353 353
354int avfilter_request_frame(AVFilterLink *link)354int avfilter_request_frame(AVFilterLink *link)
355{355{
356 FF_DPRINTF_START(NULL, request_frame); ff_dprintf_link(NULL, link, 1);356 FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);
357 357
358 if (link->srcpad->request_frame)358 if (link->srcpad->request_frame)
359 return link->srcpad->request_frame(link);359 return link->srcpad->request_frame(link);
@@ -388,7 +388,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) · 28 unmodified lines
388 AVFilterPad *dst = link->dstpad;388 AVFilterPad *dst = link->dstpad;
389 int perms = picref->perms;389 int perms = picref->perms;
390 390
391 FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " "); ff_dprintf_ref(NULL, picref, 1);391 FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
392 392
393 if (!(start_frame = dst->start_frame))393 if (!(start_frame = dst->start_frame))
394 start_frame = avfilter_default_start_frame;394 start_frame = avfilter_default_start_frame;
@@ -435,7 +435,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) · 40 unmodified lines
435 int i, j, vsub;435 int i, j, vsub;
436 void (*draw_slice)(AVFilterLink *, int, int, int);436 void (*draw_slice)(AVFilterLink *, int, int, int);
437 437
438 FF_DPRINTF_START(NULL, draw_slice); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir);438 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);
439 439
440 /* copy the slice if needed for permission reasons */440 /* copy the slice if needed for permission reasons */
441 if (link->src_buf) {441 if (link->src_buf) {

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