1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Replace dprintf with av_dlog

dprintf clashes with POSIX.1-2008
(cherry picked from commit dfd2a005eb)
This commit is contained in:
Luca Barbato 2011-01-29 17:46:18 +01:00 committed by Michael Niedermayer
parent 4592c85fc8
commit 9ef5a9deaf
47 changed files with 312 additions and 308 deletions

View File

@ -253,24 +253,24 @@ static av_cold void dprint_specific_config(ALSDecContext *ctx)
AVCodecContext *avctx = ctx->avctx;
ALSSpecificConfig *sconf = &ctx->sconf;
dprintf(avctx, "resolution = %i\n", sconf->resolution);
dprintf(avctx, "floating = %i\n", sconf->floating);
dprintf(avctx, "frame_length = %i\n", sconf->frame_length);
dprintf(avctx, "ra_distance = %i\n", sconf->ra_distance);
dprintf(avctx, "ra_flag = %i\n", sconf->ra_flag);
dprintf(avctx, "adapt_order = %i\n", sconf->adapt_order);
dprintf(avctx, "coef_table = %i\n", sconf->coef_table);
dprintf(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
dprintf(avctx, "max_order = %i\n", sconf->max_order);
dprintf(avctx, "block_switching = %i\n", sconf->block_switching);
dprintf(avctx, "bgmc = %i\n", sconf->bgmc);
dprintf(avctx, "sb_part = %i\n", sconf->sb_part);
dprintf(avctx, "joint_stereo = %i\n", sconf->joint_stereo);
dprintf(avctx, "mc_coding = %i\n", sconf->mc_coding);
dprintf(avctx, "chan_config = %i\n", sconf->chan_config);
dprintf(avctx, "chan_sort = %i\n", sconf->chan_sort);
dprintf(avctx, "RLSLMS = %i\n", sconf->rlslms);
dprintf(avctx, "chan_config_info = %i\n", sconf->chan_config_info);
av_dlog(avctx, "resolution = %i\n", sconf->resolution);
av_dlog(avctx, "floating = %i\n", sconf->floating);
av_dlog(avctx, "frame_length = %i\n", sconf->frame_length);
av_dlog(avctx, "ra_distance = %i\n", sconf->ra_distance);
av_dlog(avctx, "ra_flag = %i\n", sconf->ra_flag);
av_dlog(avctx, "adapt_order = %i\n", sconf->adapt_order);
av_dlog(avctx, "coef_table = %i\n", sconf->coef_table);
av_dlog(avctx, "long_term_prediction = %i\n", sconf->long_term_prediction);
av_dlog(avctx, "max_order = %i\n", sconf->max_order);
av_dlog(avctx, "block_switching = %i\n", sconf->block_switching);
av_dlog(avctx, "bgmc = %i\n", sconf->bgmc);
av_dlog(avctx, "sb_part = %i\n", sconf->sb_part);
av_dlog(avctx, "joint_stereo = %i\n", sconf->joint_stereo);
av_dlog(avctx, "mc_coding = %i\n", sconf->mc_coding);
av_dlog(avctx, "chan_config = %i\n", sconf->chan_config);
av_dlog(avctx, "chan_sort = %i\n", sconf->chan_sort);
av_dlog(avctx, "RLSLMS = %i\n", sconf->rlslms);
av_dlog(avctx, "chan_config_info = %i\n", sconf->chan_config_info);
#endif
}

View File

@ -107,7 +107,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
ctx->height = AV_RB16(buf + 0x18);
ctx->width = AV_RB16(buf + 0x1a);
dprintf(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
av_dlog(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
if (buf[0x21] & 0x40) {
av_log(ctx->avctx, AV_LOG_ERROR, "10 bit per component\n");
@ -115,7 +115,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
}
ctx->cid = AV_RB32(buf + 0x28);
dprintf(ctx->avctx, "compression id %d\n", ctx->cid);
av_dlog(ctx->avctx, "compression id %d\n", ctx->cid);
if (dnxhd_init_vlc(ctx, ctx->cid) < 0)
return -1;
@ -128,7 +128,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
ctx->mb_width = ctx->width>>4;
ctx->mb_height = buf[0x16d];
dprintf(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
av_dlog(ctx->avctx, "mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
if ((ctx->height+15)>>4 == ctx->mb_height && ctx->picture.interlaced_frame)
ctx->height <<= 1;
@ -141,7 +141,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
for (i = 0; i < ctx->mb_height; i++) {
ctx->mb_scan_index[i] = AV_RB32(buf + 0x170 + (i<<2));
dprintf(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
av_dlog(ctx->avctx, "mb scan index %d\n", ctx->mb_scan_index[i]);
if (buf_size < ctx->mb_scan_index[i] + 0x280) {
av_log(ctx->avctx, AV_LOG_ERROR, "invalid mb scan index\n");
return -1;
@ -293,7 +293,7 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVFrame *picture = data;
int first_field = 1;
dprintf(avctx, "frame size %d\n", buf_size);
av_dlog(avctx, "frame size %d\n", buf_size);
decode_coding_unit:
if (dnxhd_decode_header(ctx, buf, buf_size, first_field) < 0)

View File

@ -552,7 +552,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
if (bits > ctx->frame_bits)
break;
}
//dprintf(ctx->m.avctx, "lambda %d, up %u, down %u, bits %d, frame %d\n",
//av_dlog(ctx->m.avctx, "lambda %d, up %u, down %u, bits %d, frame %d\n",
// lambda, last_higher, last_lower, bits, ctx->frame_bits);
if (end) {
if (bits > ctx->frame_bits)
@ -582,7 +582,7 @@ static int dnxhd_encode_rdo(AVCodecContext *avctx, DNXHDEncContext *ctx)
down_step = 1<<LAMBDA_FRAC_BITS;
}
}
//dprintf(ctx->m.avctx, "out lambda %d\n", lambda);
//av_dlog(ctx->m.avctx, "out lambda %d\n", lambda);
ctx->lambda = lambda;
return 0;
}
@ -610,7 +610,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
if (bits > ctx->frame_bits)
break;
}
//dprintf(ctx->m.avctx, "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
//av_dlog(ctx->m.avctx, "%d, qscale %d, bits %d, frame %d, higher %d, lower %d\n",
// ctx->m.avctx->frame_number, qscale, bits, ctx->frame_bits, last_higher, last_lower);
if (bits < ctx->frame_bits) {
if (qscale == 1)
@ -640,7 +640,7 @@ static int dnxhd_find_qscale(DNXHDEncContext *ctx)
return -1;
}
}
//dprintf(ctx->m.avctx, "out qscale %d\n", qscale);
//av_dlog(ctx->m.avctx, "out qscale %d\n", qscale);
ctx->qscale = qscale;
return 0;
}

View File

@ -55,7 +55,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
uint8_t *p, *p_end;
int len, buf_pos = 0;
dprintf(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
av_dlog(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
#ifdef DEBUG_PACKET_CONTENTS
@ -82,7 +82,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
{
if (pc->packet_index != pc->packet_start)
{
dprintf(avctx, "Discarding %d bytes\n",
av_dlog(avctx, "Discarding %d bytes\n",
pc->packet_index - pc->packet_start);
}
@ -90,7 +90,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
pc->packet_index = 0;
if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
dprintf(avctx, "Bad packet header\n");
av_dlog(avctx, "Bad packet header\n");
return -1;
}
@ -147,7 +147,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
} else if (*p == 0xff) {
if (p + 1 < p_end)
{
dprintf(avctx, "Junk at end of packet\n");
av_dlog(avctx, "Junk at end of packet\n");
}
pc->packet_index = p - pc->packet_buf;
pc->in_packet = 0;

View File

@ -749,7 +749,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
uint8_t *map_table;
dprintf(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
av_dlog(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
top_bottom ? "bottom" : "top");
#ifdef DEBUG_PACKET_CONTENTS
@ -984,7 +984,7 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
YUV_TO_RGB1_CCIR(cb, cr);
YUV_TO_RGB2_CCIR(r, g, b, y);
dprintf(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
av_dlog(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
if (depth & 0x80)
clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
@ -1060,11 +1060,11 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
region->bgcolor = (((*buf++) >> 2) & 3);
}
dprintf(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
av_dlog(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
if (fill) {
memset(region->pbuf, region->bgcolor, region->buf_size);
dprintf(avctx, "Fill region (%d)\n", region->bgcolor);
av_dlog(avctx, "Fill region (%d)\n", region->bgcolor);
}
delete_region_display_list(ctx, region);
@ -1125,7 +1125,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
ctx->time_out = *buf++;
page_state = ((*buf++) >> 2) & 3;
dprintf(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
av_dlog(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
if (page_state == 2) {
delete_state(ctx);
@ -1163,7 +1163,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
ctx->display_list = display;
ctx->display_list_size++;
dprintf(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
av_dlog(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
}
while (tmp_display_list) {
@ -1461,7 +1461,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
*data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
break;
default:
dprintf(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
av_dlog(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
segment_type, page_id, segment_length);
break;
}
@ -1471,7 +1471,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
}
if (p != p_end) {
dprintf(avctx, "Junk at end of packet\n");
av_dlog(avctx, "Junk at end of packet\n");
return -1;
}

View File

@ -190,7 +190,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
while (cmd_pos > 0 && cmd_pos < buf_size - 2 - offset_size) {
date = AV_RB16(buf + cmd_pos);
next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2);
dprintf(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
av_dlog(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
cmd_pos, next_cmd_pos, date);
pos = cmd_pos + 2 + offset_size;
offset1 = -1;
@ -198,7 +198,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
x1 = y1 = x2 = y2 = 0;
while (pos < buf_size) {
cmd = buf[pos++];
dprintf(NULL, "cmd=%02x\n", cmd);
av_dlog(NULL, "cmd=%02x\n", cmd);
switch(cmd) {
case 0x00:
/* menu subpicture */
@ -231,7 +231,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
alpha[1] = buf[pos + 1] >> 4;
alpha[0] = buf[pos + 1] & 0x0f;
pos += 2;
dprintf(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
av_dlog(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
break;
case 0x05:
case 0x85:
@ -243,7 +243,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
y2 = ((buf[pos + 4] & 0x0f) << 8) | buf[pos + 5];
if (cmd & 0x80)
is_8bit = 1;
dprintf(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
av_dlog(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
pos += 6;
break;
case 0x06:
@ -251,7 +251,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
goto fail;
offset1 = AV_RB16(buf + pos);
offset2 = AV_RB16(buf + pos + 2);
dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
av_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
pos += 4;
break;
case 0x86:
@ -259,7 +259,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
goto fail;
offset1 = AV_RB32(buf + pos);
offset2 = AV_RB32(buf + pos + 4);
dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
av_dlog(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
pos += 8;
break;
@ -282,7 +282,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
case 0xff:
goto the_end;
default:
dprintf(NULL, "unrecognised subpicture command 0x%x\n", cmd);
av_dlog(NULL, "unrecognised subpicture command 0x%x\n", cmd);
goto the_end;
}
}
@ -475,7 +475,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
goto no_subtitle;
#if defined(DEBUG)
dprintf(NULL, "start=%d ms end =%d ms\n",
av_dlog(NULL, "start=%d ms end =%d ms\n",
sub->start_display_time,
sub->end_display_time);
ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],

View File

@ -77,7 +77,7 @@ static int gif_read_image(GifState *s)
has_local_palette = flags & 0x80;
bits_per_pixel = (flags & 0x07) + 1;
dprintf(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
av_dlog(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
if (has_local_palette) {
bytestream_get_buffer(&s->bytestream, s->local_palette, 3 * (1 << bits_per_pixel));
@ -163,7 +163,7 @@ static int gif_read_extension(GifState *s)
ext_code = bytestream_get_byte(&s->bytestream);
ext_len = bytestream_get_byte(&s->bytestream);
dprintf(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
av_dlog(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
switch(ext_code) {
case 0xf9:
@ -179,7 +179,7 @@ static int gif_read_extension(GifState *s)
s->transparent_color_index = -1;
s->gce_disposal = (gce_flags >> 2) & 0x7;
dprintf(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
av_dlog(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
gce_flags, s->gce_delay,
s->transparent_color_index, s->gce_disposal);
@ -194,7 +194,7 @@ static int gif_read_extension(GifState *s)
bytestream_get_byte(&s->bytestream);
ext_len = bytestream_get_byte(&s->bytestream);
dprintf(s->avctx, "gif: ext_len1=%d\n", ext_len);
av_dlog(s->avctx, "gif: ext_len1=%d\n", ext_len);
}
return 0;
}
@ -231,7 +231,7 @@ static int gif_read_header1(GifState *s)
s->background_color_index = bytestream_get_byte(&s->bytestream);
bytestream_get_byte(&s->bytestream); /* ignored */
dprintf(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
av_dlog(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
s->screen_width, s->screen_height, s->bits_per_pixel,
has_global_palette);
@ -249,7 +249,7 @@ static int gif_parse_next_image(GifState *s)
while (s->bytestream < s->bytestream_end) {
int code = bytestream_get_byte(&s->bytestream);
dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);
av_dlog(s->avctx, "gif: code=%02x '%c'\n", code, code);
switch (code) {
case ',':

View File

@ -553,8 +553,8 @@ static int h261_decode_frame(AVCodecContext *avctx,
int ret;
AVFrame *pict = data;
dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
dprintf(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
av_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
s->flags= avctx->flags;
s->flags2= avctx->flags2;

View File

@ -325,7 +325,7 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred)
code >>= 1;
code = (sign) ? (pred - code) : (pred + code);
dprintf(s->avctx,"H.263+ UMV Motion = %d\n", code);
av_dlog(s->avctx,"H.263+ UMV Motion = %d\n", code);
return code;
}
@ -951,7 +951,7 @@ int h263_decode_picture_header(MpegEncContext *s)
if (ufep == 1) {
/* OPPTYPE */
format = get_bits(&s->gb, 3);
dprintf(s->avctx, "ufep=1, format: %d\n", format);
av_dlog(s->avctx, "ufep=1, format: %d\n", format);
s->custom_pcf= get_bits1(&s->gb);
s->umvplus = get_bits1(&s->gb); /* Unrestricted Motion Vector */
if (get_bits1(&s->gb) != 0) {
@ -1002,7 +1002,7 @@ int h263_decode_picture_header(MpegEncContext *s)
if (format == 6) {
/* Custom Picture Format (CPFMT) */
s->aspect_ratio_info = get_bits(&s->gb, 4);
dprintf(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
av_dlog(s->avctx, "aspect: %d\n", s->aspect_ratio_info);
/* aspect ratios:
0 - forbidden
1 - 1:1
@ -1015,7 +1015,7 @@ int h263_decode_picture_header(MpegEncContext *s)
width = (get_bits(&s->gb, 9) + 1) * 4;
skip_bits1(&s->gb);
height = get_bits(&s->gb, 9) * 4;
dprintf(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
av_dlog(s->avctx, "\nH.263+ Custom picture: %dx%d\n",width,height);
if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
/* aspected dimensions */
s->avctx->sample_aspect_ratio.num= get_bits(&s->gb, 8);

View File

@ -1255,7 +1255,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
}
val = -1;
found:
dprintf(NULL, "find_marker skipped %d bytes\n", skipped);
av_dlog(NULL, "find_marker skipped %d bytes\n", skipped);
*pbuf_ptr = buf_ptr;
return val;
}

View File

@ -213,7 +213,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
int i, j, k, cbp, val, mb_type, motion_type;
const int mb_block_count = 4 + (1<< s->chroma_format);
dprintf(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
av_dlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
assert(s->mb_skipped==0);
@ -272,7 +272,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
mb_type = btype2mb_type[ mb_type ];
break;
}
dprintf(s->avctx, "mb_type=%x\n", mb_type);
av_dlog(s->avctx, "mb_type=%x\n", mb_type);
// motion_type = 0; /* avoid warning */
if (IS_INTRA(mb_type)) {
s->dsp.clear_blocks(s->block[0]);
@ -370,7 +370,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
/* motion vectors */
s->mv_dir= (mb_type>>13)&3;
dprintf(s->avctx, "motion_type=%d\n", motion_type);
av_dlog(s->avctx, "motion_type=%d\n", motion_type);
switch(motion_type) {
case MT_FRAME: /* or MT_16X8 */
if (s->picture_structure == PICT_FRAME) {
@ -421,12 +421,12 @@ static int mpeg_decode_mb(MpegEncContext *s,
s->last_mv[i][j][0]);
s->last_mv[i][j][0] = val;
s->mv[i][j][0] = val;
dprintf(s->avctx, "fmx=%d\n", val);
av_dlog(s->avctx, "fmx=%d\n", val);
val = mpeg_decode_motion(s, s->mpeg_f_code[i][1],
s->last_mv[i][j][1] >> 1);
s->last_mv[i][j][1] = val << 1;
s->mv[i][j][1] = val;
dprintf(s->avctx, "fmy=%d\n", val);
av_dlog(s->avctx, "fmy=%d\n", val);
}
}
}
@ -632,7 +632,7 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s,
dc += diff;
s->last_dc[component] = dc;
block[0] = dc*quant_matrix[0];
dprintf(s->avctx, "dc=%d diff=%d\n", dc, diff);
av_dlog(s->avctx, "dc=%d diff=%d\n", dc, diff);
i = 0;
{
OPEN_READER(re, &s->gb);
@ -1012,7 +1012,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s,
dc += diff;
s->last_dc[component] = dc;
block[0] = dc << (3 - s->intra_dc_precision);
dprintf(s->avctx, "dc=%d\n", block[0]);
av_dlog(s->avctx, "dc=%d\n", block[0]);
mismatch = block[0] ^ 1;
i = 0;
if (s->intra_vlc_format)
@ -1386,7 +1386,7 @@ static void mpeg_decode_sequence_extension(Mpeg1Context *s1)
s1->frame_rate_ext.num = get_bits(&s->gb, 2)+1;
s1->frame_rate_ext.den = get_bits(&s->gb, 5)+1;
dprintf(s->avctx, "sequence extension\n");
av_dlog(s->avctx, "sequence extension\n");
s->codec_id= s->avctx->codec_id= CODEC_ID_MPEG2VIDEO;
s->avctx->sub_id = 2; /* indicates MPEG-2 found */
@ -1477,7 +1477,7 @@ static int load_matrix(MpegEncContext *s, uint16_t matrix0[64], uint16_t matrix1
static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
{
dprintf(s->avctx, "matrix extension\n");
av_dlog(s->avctx, "matrix extension\n");
if(get_bits1(&s->gb)) load_matrix(s, s->chroma_intra_matrix, s->intra_matrix, 1);
if(get_bits1(&s->gb)) load_matrix(s, s->chroma_inter_matrix, s->inter_matrix, 0);
@ -1551,15 +1551,15 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
}
/* composite display not parsed */
dprintf(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
dprintf(s->avctx, "picture_structure=%d\n", s->picture_structure);
dprintf(s->avctx, "top field first=%d\n", s->top_field_first);
dprintf(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
dprintf(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
dprintf(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
dprintf(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
dprintf(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
dprintf(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
av_dlog(s->avctx, "intra_dc_precision=%d\n", s->intra_dc_precision);
av_dlog(s->avctx, "picture_structure=%d\n", s->picture_structure);
av_dlog(s->avctx, "top field first=%d\n", s->top_field_first);
av_dlog(s->avctx, "repeat first field=%d\n", s->repeat_first_field);
av_dlog(s->avctx, "conceal=%d\n", s->concealment_motion_vectors);
av_dlog(s->avctx, "intra_vlc_format=%d\n", s->intra_vlc_format);
av_dlog(s->avctx, "alternate_scan=%d\n", s->alternate_scan);
av_dlog(s->avctx, "frame_pred_frame_dct=%d\n", s->frame_pred_frame_dct);
av_dlog(s->avctx, "progressive_frame=%d\n", s->progressive_frame);
}
static void exchange_uv(MpegEncContext *s){
@ -2200,7 +2200,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
Mpeg1Context *s = avctx->priv_data;
AVFrame *picture = data;
MpegEncContext *s2 = &s->mpeg_enc_ctx;
dprintf(avctx, "fill_buffer\n");
av_dlog(avctx, "fill_buffer\n");
if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
/* special case for last picture */
@ -2524,7 +2524,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){
if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
return -1;
if( !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD) ){
dprintf(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
av_dlog(avctx, "mpeg12.c: XvMC decoder will work better if SLICE_FLAG_ALLOW_FIELD is set\n");
}
mpeg_decode_init(avctx);

View File

@ -890,7 +890,7 @@ static void mpeg1_encode_block(MpegEncContext *s,
next_coef:
#if 0
if (level != 0)
dprintf(s->avctx, "level[%d]=%d\n", i, level);
av_dlog(s->avctx, "level[%d]=%d\n", i, level);
#endif
/* encode using VLC */
if (level != 0) {

View File

@ -352,7 +352,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
scale_factor_mult[i][0] = MULLx(norm, FIXR(1.0 * 2.0), FRAC_BITS);
scale_factor_mult[i][1] = MULLx(norm, FIXR(0.7937005259 * 2.0), FRAC_BITS);
scale_factor_mult[i][2] = MULLx(norm, FIXR(0.6299605249 * 2.0), FRAC_BITS);
dprintf(avctx, "%d: norm=%x s=%x %x %x\n",
av_dlog(avctx, "%d: norm=%x s=%x %x %x\n",
i, norm,
scale_factor_mult[i][0],
scale_factor_mult[i][1],
@ -457,7 +457,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
k = i & 1;
is_table_lsf[j][k ^ 1][i] = FIXR(f);
is_table_lsf[j][k][i] = FIXR(1.0);
dprintf(avctx, "is_table_lsf %d %d: %x %x\n",
av_dlog(avctx, "is_table_lsf %d %d: %x %x\n",
i, j, is_table_lsf[j][0][i], is_table_lsf[j][1][i]);
}
}
@ -986,7 +986,7 @@ static int mp_decode_layer2(MPADecodeContext *s)
else
bound = sblimit;
dprintf(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
av_dlog(s->avctx, "bound=%d sblimit=%d\n", bound, sblimit);
/* sanity check */
if( bound > sblimit ) bound = sblimit;
@ -1309,7 +1309,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
exponent= exponents[s_index];
dprintf(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
av_dlog(s->avctx, "region=%d n=%d x=%d y=%d exp=%d\n",
i, g->region_size[i] - j, x, y, exponent);
if(y&16){
x = y >> 5;
@ -1377,7 +1377,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
last_pos= pos;
code = get_vlc2(&s->gb, vlc->table, vlc->bits, 1);
dprintf(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
av_dlog(s->avctx, "t=%d code=%d\n", g->count1table_select, code);
g->sb_hybrid[s_index+0]=
g->sb_hybrid[s_index+1]=
g->sb_hybrid[s_index+2]=
@ -1735,7 +1735,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
for(gr=0;gr<nb_granules;gr++) {
for(ch=0;ch<s->nb_channels;ch++) {
dprintf(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
av_dlog(s->avctx, "gr=%d ch=%d: side_info\n", gr, ch);
g = &s->granules[ch][gr];
g->part2_3_length = get_bits(&s->gb, 12);
g->big_values = get_bits(&s->gb, 9);
@ -1776,7 +1776,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
/* compute huffman coded region sizes */
region_address1 = get_bits(&s->gb, 4);
region_address2 = get_bits(&s->gb, 3);
dprintf(s->avctx, "region1=%d region2=%d\n",
av_dlog(s->avctx, "region1=%d region2=%d\n",
region_address1, region_address2);
ff_init_long_region(s, g, region_address1, region_address2);
}
@ -1788,7 +1788,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
g->preflag = get_bits1(&s->gb);
g->scalefac_scale = get_bits1(&s->gb);
g->count1table_select = get_bits1(&s->gb);
dprintf(s->avctx, "block_type=%d switch_point=%d\n",
av_dlog(s->avctx, "block_type=%d switch_point=%d\n",
g->block_type, g->switch_point);
}
}
@ -1797,7 +1797,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
const uint8_t *ptr = s->gb.buffer + (get_bits_count(&s->gb)>>3);
assert((get_bits_count(&s->gb) & 7) == 0);
/* now we get bits from the main_data_begin offset */
dprintf(s->avctx, "seekback: %d\n", main_data_begin);
av_dlog(s->avctx, "seekback: %d\n", main_data_begin);
//av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
memcpy(s->last_buf + s->last_buf_size, ptr, EXTRABYTES);
@ -1831,7 +1831,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
/* MPEG1 scale factors */
slen1 = slen_table[0][g->scalefac_compress];
slen2 = slen_table[1][g->scalefac_compress];
dprintf(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
av_dlog(s->avctx, "slen1=%d slen2=%d\n", slen1, slen2);
if (g->block_type == 2) {
n = g->switch_point ? 17 : 18;
j = 0;
@ -1964,7 +1964,7 @@ static int mp_decode_frame(MPADecodeContext *s,
if (s->error_protection)
skip_bits(&s->gb, 16);
dprintf(s->avctx, "frame %d:\n", s->frame_count);
av_dlog(s->avctx, "frame %d:\n", s->frame_count);
switch(s->layer) {
case 1:
s->avctx->frame_size = 384;

View File

@ -91,20 +91,20 @@ int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header)
}
#if defined(DEBUG)
dprintf(NULL, "layer%d, %d Hz, %d kbits/s, ",
av_dlog(NULL, "layer%d, %d Hz, %d kbits/s, ",
s->layer, s->sample_rate, s->bit_rate);
if (s->nb_channels == 2) {
if (s->layer == 3) {
if (s->mode_ext & MODE_EXT_MS_STEREO)
dprintf(NULL, "ms-");
av_dlog(NULL, "ms-");
if (s->mode_ext & MODE_EXT_I_STEREO)
dprintf(NULL, "i-");
av_dlog(NULL, "i-");
}
dprintf(NULL, "stereo");
av_dlog(NULL, "stereo");
} else {
dprintf(NULL, "mono");
av_dlog(NULL, "mono");
}
dprintf(NULL, "\n");
av_dlog(NULL, "\n");
#endif
return 0;
}

View File

@ -122,7 +122,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
s->sblimit = ff_mpa_sblimit_table[table];
s->alloc_table = ff_mpa_alloc_tables[table];
dprintf(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
av_dlog(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
bitrate, freq, s->frame_size, table, s->frame_frac_incr);
for(i=0;i<s->nb_channels;i++)

View File

@ -64,7 +64,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
uint8_t channel_layout = header[2] >> 4;
if (avctx->debug & FF_DEBUG_PICT_INFO)
dprintf(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
av_dlog(avctx, "pcm_bluray_parse_header: header = %02x%02x%02x%02x\n",
header[0], header[1], header[2], header[3]);
/* get the sample depth and derive the sample format from it */
@ -112,7 +112,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
avctx->bits_per_coded_sample;
if (avctx->debug & FF_DEBUG_PICT_INFO)
dprintf(avctx,
av_dlog(avctx,
"pcm_bluray_parse_header: %d channels, %d bits per sample, %d kHz, %d kbit\n",
avctx->channels, avctx->bits_per_coded_sample,
avctx->sample_rate, avctx->bit_rate);
@ -291,7 +291,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
retval = src - avpkt->data;
if (avctx->debug & FF_DEBUG_BITSTREAM)
dprintf(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
av_dlog(avctx, "pcm_bluray_decode_frame: decoded %d -> %d bytes\n",
retval, *data_size);
return retval;
}

View File

@ -141,7 +141,7 @@ static int decode_rle(AVCodecContext *avctx, AVSubtitle *sub,
return -1;
}
dprintf(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h);
av_dlog(avctx, "Pixel Count = %d, Area = %d\n", pixel_count, sub->rects[0]->w * sub->rects[0]->h);
return 0;
}
@ -253,7 +253,7 @@ static void parse_palette_segment(AVCodecContext *avctx,
YUV_TO_RGB1(cb, cr);
YUV_TO_RGB2(r, g, b, y);
dprintf(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
av_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
/* Store color in palette */
ctx->clut[color_id] = RGBA(r,g,b,alpha);
@ -282,7 +282,7 @@ static void parse_presentation_segment(AVCodecContext *avctx,
int w = bytestream_get_be16(&buf);
int h = bytestream_get_be16(&buf);
dprintf(avctx, "Video Dimensions %dx%d\n",
av_dlog(avctx, "Video Dimensions %dx%d\n",
w, h);
if (av_image_check_size(w, h, 0, avctx) >= 0)
avcodec_set_dimensions(avctx, w, h);
@ -317,7 +317,7 @@ static void parse_presentation_segment(AVCodecContext *avctx,
/* TODO If cropping, cropping_x, cropping_y, cropping_width, cropping_height (all 2 bytes).*/
dprintf(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
av_dlog(avctx, "Subtitle Placement x=%d, y=%d\n", x, y);
if (x > avctx->width || y > avctx->height) {
av_log(avctx, AV_LOG_ERROR, "Subtitle out of video bounds. x = %d, y = %d, video width = %d, video height = %d.\n",
@ -433,7 +433,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size,
segment_type = bytestream_get_byte(&buf);
segment_length = bytestream_get_be16(&buf);
dprintf(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
av_dlog(avctx, "Segment Length %d, Segment Type %x\n", segment_length, segment_type);
if (segment_type != DISPLAY_SEGMENT && segment_length > buf_end - buf)
break;

View File

@ -431,7 +431,7 @@ static int decode_frame(AVCodecContext *avctx,
goto fail;
tag32 = bytestream_get_be32(&s->bytestream);
tag = av_bswap32(tag32);
dprintf(avctx, "png: tag=%c%c%c%c length=%u\n",
av_dlog(avctx, "png: tag=%c%c%c%c length=%u\n",
(tag & 0xff),
((tag >> 8) & 0xff),
((tag >> 16) & 0xff),
@ -453,7 +453,7 @@ static int decode_frame(AVCodecContext *avctx,
s->interlace_type = *s->bytestream++;
crc = bytestream_get_be32(&s->bytestream);
s->state |= PNG_IHDR;
dprintf(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
av_dlog(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
s->width, s->height, s->bit_depth, s->color_type,
s->compression_type, s->filter_type, s->interlace_type);
break;
@ -517,7 +517,7 @@ static int decode_frame(AVCodecContext *avctx,
s->width);
s->crow_size = s->pass_row_size + 1;
}
dprintf(avctx, "row_size=%d crow_size =%d\n",
av_dlog(avctx, "row_size=%d crow_size =%d\n",
s->row_size, s->crow_size);
s->image_buf = p->data[0];
s->image_linesize = p->linesize[0];

View File

@ -246,7 +246,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
pb_frame = get_bits1(&s->gb);
dprintf(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
av_dlog(s->avctx, "pict_type=%d pb_frame=%d\n", s->pict_type, pb_frame);
if (pb_frame){
av_log(s->avctx, AV_LOG_ERROR, "pb frame not supported\n");
@ -265,7 +265,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
s->last_dc[0] = get_bits(&s->gb, 8);
s->last_dc[1] = get_bits(&s->gb, 8);
s->last_dc[2] = get_bits(&s->gb, 8);
dprintf(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
av_dlog(s->avctx, "DC:%d %d %d\n", s->last_dc[0],
s->last_dc[1], s->last_dc[2]);
}
}
@ -561,7 +561,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
ff_er_frame_start(s);
}
dprintf(avctx, "qscale=%d\n", s->qscale);
av_dlog(avctx, "qscale=%d\n", s->qscale);
/* default quantization values */
if(s->codec_id== CODEC_ID_RV10){
@ -600,7 +600,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
for(s->mb_num_left= mb_count; s->mb_num_left>0; s->mb_num_left--) {
int ret;
ff_update_block_index(s);
dprintf(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
av_dlog(avctx, "**mb x=%d y=%d\n", s->mb_x, s->mb_y);
s->mv_dir = MV_DIR_FORWARD;
s->mv_type = MV_TYPE_16X16;
@ -655,7 +655,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
int slice_count;
const uint8_t *slices_hdr = NULL;
dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
av_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
/* no supplementary picture */
if (buf_size == 0) {

View File

@ -305,7 +305,7 @@ static int shorten_decode_frame(AVCodecContext *avctx,
s->bitstream_size= buf_size;
if(buf_size < s->max_framesize){
//dprintf(avctx, "wanna more data ... %d\n", buf_size);
//av_dlog(avctx, "wanna more data ... %d\n", buf_size);
*data_size = 0;
return input_buf_size;
}

View File

@ -180,7 +180,7 @@ int ff_vaapi_common_end_frame(MpegEncContext *s)
struct vaapi_context * const vactx = s->avctx->hwaccel_context;
int ret = -1;
dprintf(s->avctx, "ff_vaapi_common_end_frame()\n");
av_dlog(s->avctx, "ff_vaapi_common_end_frame()\n");
if (commit_slices(vactx) < 0)
goto done;

View File

@ -227,7 +227,7 @@ static int start_frame(AVCodecContext *avctx,
VAPictureParameterBufferH264 *pic_param;
VAIQMatrixBufferH264 *iq_matrix;
dprintf(avctx, "start_frame()\n");
av_dlog(avctx, "start_frame()\n");
vactx->slice_param_size = sizeof(VASliceParameterBufferH264);
@ -289,7 +289,7 @@ static int end_frame(AVCodecContext *avctx)
{
H264Context * const h = avctx->priv_data;
dprintf(avctx, "end_frame()\n");
av_dlog(avctx, "end_frame()\n");
return ff_vaapi_common_end_frame(&h->s);
}
@ -302,7 +302,7 @@ static int decode_slice(AVCodecContext *avctx,
MpegEncContext * const s = &h->s;
VASliceParameterBufferH264 *slice_param;
dprintf(avctx, "decode_slice(): buffer %p, size %d\n", buffer, size);
av_dlog(avctx, "decode_slice(): buffer %p, size %d\n", buffer, size);
/* Fill in VASliceParameterBufferH264. */
slice_param = (VASliceParameterBufferH264 *)ff_vaapi_alloc_slice(avctx->hwaccel_context, buffer, size);

View File

@ -44,7 +44,7 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
VAIQMatrixBufferMPEG2 *iq_matrix;
int i;
dprintf(avctx, "vaapi_mpeg2_start_frame()\n");
av_dlog(avctx, "vaapi_mpeg2_start_frame()\n");
vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG2);
@ -111,7 +111,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
GetBitContext gb;
uint32_t start_code, quantiser_scale_code, intra_slice_flag, macroblock_offset;
dprintf(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
av_dlog(avctx, "vaapi_mpeg2_decode_slice(): buffer %p, size %d\n", buffer, size);
/* Determine macroblock_offset */
init_get_bits(&gb, buffer, 8 * size);

View File

@ -47,7 +47,7 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
VAIQMatrixBufferMPEG4 *iq_matrix;
int i;
dprintf(avctx, "vaapi_mpeg4_start_frame()\n");
av_dlog(avctx, "vaapi_mpeg4_start_frame()\n");
vactx->slice_param_size = sizeof(VASliceParameterBufferMPEG4);
@ -125,7 +125,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer
MpegEncContext * const s = avctx->priv_data;
VASliceParameterBufferMPEG4 *slice_param;
dprintf(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
av_dlog(avctx, "vaapi_mpeg4_decode_slice(): buffer %p, size %d\n", buffer, size);
/* video_plane_with_short_video_header() contains all GOBs
* in-order, and this is what VA API (Intel backend) expects: only

View File

@ -138,7 +138,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
struct vaapi_context * const vactx = avctx->hwaccel_context;
VAPictureParameterBufferVC1 *pic_param;
dprintf(avctx, "vaapi_vc1_start_frame()\n");
av_dlog(avctx, "vaapi_vc1_start_frame()\n");
vactx->slice_param_size = sizeof(VASliceParameterBufferVC1);
@ -308,7 +308,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
MpegEncContext * const s = &v->s;
VASliceParameterBufferVC1 *slice_param;
dprintf(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
av_dlog(avctx, "vaapi_vc1_decode_slice(): buffer %p, size %d\n", buffer, size);
/* Current bit buffer is beyond any marker for VC-1, so skip it */
if (avctx->codec_id == CODEC_ID_VC1 && IS_MARKER(AV_RB32(buffer))) {

View File

@ -217,13 +217,13 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
high_freq = high_freq * 0.5;
}
}
dprintf(s->avctx, "flags2=0x%x\n", flags2);
dprintf(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
av_dlog(s->avctx, "flags2=0x%x\n", flags2);
av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
s->version, s->nb_channels, s->sample_rate, s->bit_rate,
s->block_align);
dprintf(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
av_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
bps, bps1, high_freq, s->byte_offset_bits);
dprintf(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
av_dlog(s->avctx, "use_noise_coding=%d use_exp_vlc=%d nb_block_sizes=%d\n",
s->use_noise_coding, s->use_exp_vlc, s->nb_block_sizes);
/* compute the scale factor band sizes for each MDCT block size */

View File

@ -288,8 +288,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->bits_per_sample = AV_RL16(edata_ptr);
/** dump the extradata */
for (i = 0; i < avctx->extradata_size; i++)
dprintf(avctx, "[%x] ", avctx->extradata[i]);
dprintf(avctx, "\n");
av_dlog(avctx, "[%x] ", avctx->extradata[i]);
av_dlog(avctx, "\n");
} else {
av_log_ask_for_sample(avctx, "Unknown extradata size\n");
@ -582,7 +582,7 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
int i;
int offset = 0;
for (i = 0; i < s->channel[c].num_subframes; i++) {
dprintf(s->avctx, "frame[%i] channel[%i] subframe[%i]"
av_dlog(s->avctx, "frame[%i] channel[%i] subframe[%i]"
" len %i\n", s->frame_num, c, i,
s->channel[c].subframe_len[i]);
s->channel[c].subframe_offset[i] = offset;
@ -781,7 +781,7 @@ static int decode_coeffs(WMAProDecodeCtx *s, int c)
const uint16_t* run;
const float* level;
dprintf(s->avctx, "decode coefficients for channel %i\n", c);
av_dlog(s->avctx, "decode coefficients for channel %i\n", c);
vlctable = get_bits1(&s->gb);
vlc = &coef_vlc[vlctable];
@ -1066,7 +1066,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
}
}
dprintf(s->avctx,
av_dlog(s->avctx,
"processing subframe with offset %i len %i\n", offset, subframe_len);
/** get a list of all channels that contain the estimated block */
@ -1093,7 +1093,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
s->parsed_all_subframes = 1;
dprintf(s->avctx, "subframe is part of %i channels\n",
av_dlog(s->avctx, "subframe is part of %i channels\n",
s->channels_for_cur_subframe);
/** calculate number of scale factor bands and their offsets */
@ -1204,7 +1204,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
return AVERROR_INVALIDDATA;
}
dprintf(s->avctx, "BITSTREAM: subframe header length was %i\n",
av_dlog(s->avctx, "BITSTREAM: subframe header length was %i\n",
get_bits_count(&s->gb) - s->subframe_offset);
/** parse coefficients */
@ -1218,7 +1218,7 @@ static int decode_subframe(WMAProDecodeCtx *s)
sizeof(*s->channel[c].coeffs) * subframe_len);
}
dprintf(s->avctx, "BITSTREAM: subframe length was %i\n",
av_dlog(s->avctx, "BITSTREAM: subframe length was %i\n",
get_bits_count(&s->gb) - s->subframe_offset);
if (transmit_coeffs) {
@ -1294,7 +1294,7 @@ static int decode_frame(WMAProDecodeCtx *s)
if (s->len_prefix)
len = get_bits(gb, s->log2_frame_size);
dprintf(s->avctx, "decoding frame with length %x\n", len);
av_dlog(s->avctx, "decoding frame with length %x\n", len);
/** decode tile information */
if (decode_tilehdr(s)) {
@ -1313,7 +1313,7 @@ static int decode_frame(WMAProDecodeCtx *s)
/** read drc info */
if (s->dynamic_range_compression) {
s->drc_gain = get_bits(gb, 8);
dprintf(s->avctx, "drc_gain %i\n", s->drc_gain);
av_dlog(s->avctx, "drc_gain %i\n", s->drc_gain);
}
/** no idea what these are for, might be the number of samples
@ -1324,18 +1324,18 @@ static int decode_frame(WMAProDecodeCtx *s)
/** usually true for the first frame */
if (get_bits1(gb)) {
skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
dprintf(s->avctx, "start skip: %i\n", skip);
av_dlog(s->avctx, "start skip: %i\n", skip);
}
/** sometimes true for the last frame */
if (get_bits1(gb)) {
skip = get_bits(gb, av_log2(s->samples_per_frame * 2));
dprintf(s->avctx, "end skip: %i\n", skip);
av_dlog(s->avctx, "end skip: %i\n", skip);
}
}
dprintf(s->avctx, "BITSTREAM: frame header length was %i\n",
av_dlog(s->avctx, "BITSTREAM: frame header length was %i\n",
get_bits_count(gb) - s->frame_offset);
/** reset subframe states */
@ -1505,7 +1505,7 @@ static int decode_packet(AVCodecContext *avctx,
/** get number of bits that need to be added to the previous frame */
num_bits_prev_frame = get_bits(gb, s->log2_frame_size);
dprintf(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
av_dlog(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
num_bits_prev_frame);
/** check for packet loss */
@ -1527,14 +1527,14 @@ static int decode_packet(AVCodecContext *avctx,
/** append the previous frame data to the remaining data from the
previous packet to create a full frame */
save_bits(s, gb, num_bits_prev_frame, 1);
dprintf(avctx, "accumulated %x bits of frame data\n",
av_dlog(avctx, "accumulated %x bits of frame data\n",
s->num_saved_bits - s->frame_offset);
/** decode the cross packet frame if it is valid */
if (!s->packet_loss)
decode_frame(s);
} else if (s->num_saved_bits - s->frame_offset) {
dprintf(avctx, "ignoring %x previously saved bits\n",
av_dlog(avctx, "ignoring %x previously saved bits\n",
s->num_saved_bits - s->frame_offset);
}

View File

@ -217,24 +217,24 @@ static char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms)
return buf;
}
static void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)
static void ff_dlog_ref(void *ctx, AVFilterBufferRef *ref, int end)
{
av_unused char buf[16];
dprintf(ctx,
av_dlog(ctx,
"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->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
ref->pts, ref->pos);
if (ref->video) {
dprintf(ctx, " a:%d/%d s:%dx%d i:%c",
av_dlog(ctx, " a:%d/%d s:%dx%d i:%c",
ref->video->pixel_aspect.num, ref->video->pixel_aspect.den,
ref->video->w, ref->video->h,
!ref->video->interlaced ? 'P' : /* Progressive */
ref->video->top_field_first ? 'T' : 'B'); /* Top / Bottom */
}
if (ref->audio) {
dprintf(ctx, " cl:%"PRId64"d sn:%d s:%d sr:%d p:%d",
av_dlog(ctx, " cl:%"PRId64"d sn:%d s:%d sr:%d p:%d",
ref->audio->channel_layout,
ref->audio->nb_samples,
ref->audio->size,
@ -242,13 +242,13 @@ static void ff_dprintf_ref(void *ctx, AVFilterBufferRef *ref, int end)
ref->audio->planar);
}
dprintf(ctx, "]%s", end ? "\n" : "");
av_dlog(ctx, "]%s", end ? "\n" : "");
}
static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
static void ff_dlog_link(void *ctx, AVFilterLink *link, int end)
{
if (link->type == AVMEDIA_TYPE_VIDEO) {
dprintf(ctx,
av_dlog(ctx,
"link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s",
link, link->w, link->h,
av_pix_fmt_descriptors[link->format].name,
@ -259,7 +259,7 @@ static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
char buf[128];
av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
dprintf(ctx,
av_dlog(ctx,
"link[%p r:%"PRId64" cl:%s fmt:%-16s %-16s->%-16s]%s",
link, link->sample_rate, buf,
av_get_sample_fmt_name(link->format),
@ -269,15 +269,15 @@ static void ff_dprintf_link(void *ctx, AVFilterLink *link, int end)
}
}
#define FF_DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func)
#define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
{
AVFilterBufferRef *ret = NULL;
av_unused char buf[16];
FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0);
dprintf(NULL, " perms:%s w:%d h:%d\n", ff_get_ref_perms_string(buf, sizeof(buf), perms), w, h);
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);
if (link->dstpad->get_video_buffer)
ret = link->dstpad->get_video_buffer(link, perms, w, h);
@ -288,7 +288,7 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int
if (ret)
ret->type = AVMEDIA_TYPE_VIDEO;
FF_DPRINTF_START(NULL, get_video_buffer); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " returning "); ff_dprintf_ref(NULL, ret, 1);
FF_DPRINTF_START(NULL, get_video_buffer); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " returning "); ff_dlog_ref(NULL, ret, 1);
return ret;
}
@ -353,7 +353,7 @@ AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
int avfilter_request_frame(AVFilterLink *link)
{
FF_DPRINTF_START(NULL, request_frame); ff_dprintf_link(NULL, link, 1);
FF_DPRINTF_START(NULL, request_frame); ff_dlog_link(NULL, link, 1);
if (link->srcpad->request_frame)
return link->srcpad->request_frame(link);
@ -388,7 +388,7 @@ void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
AVFilterPad *dst = link->dstpad;
int perms = picref->perms;
FF_DPRINTF_START(NULL, start_frame); ff_dprintf_link(NULL, link, 0); dprintf(NULL, " "); ff_dprintf_ref(NULL, picref, 1);
FF_DPRINTF_START(NULL, start_frame); ff_dlog_link(NULL, link, 0); av_dlog(NULL, " "); ff_dlog_ref(NULL, picref, 1);
if (!(start_frame = dst->start_frame))
start_frame = avfilter_default_start_frame;
@ -435,7 +435,7 @@ void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
int i, j, vsub;
void (*draw_slice)(AVFilterLink *, int, int, int);
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);
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);
/* copy the slice if needed for permission reasons */
if (link->src_buf) {

View File

@ -57,7 +57,7 @@ int ff_guidcmp(const void *g1, const void *g2)
#ifdef DEBUG
#define PRINT_IF_GUID(g,cmp) \
if (!ff_guidcmp(g, &cmp)) \
dprintf(NULL, "(GUID: %s) ", #cmp)
av_dlog(NULL, "(GUID: %s) ", #cmp)
static void print_guid(const ff_asf_guid *g)
{
@ -87,10 +87,10 @@ static void print_guid(const ff_asf_guid *g)
else PRINT_IF_GUID(g, stream_bitrate_guid);
else PRINT_IF_GUID(g, ff_asf_language_guid);
else
dprintf(NULL, "(GUID: unknown) ");
av_dlog(NULL, "(GUID: unknown) ");
for(i=0;i<16;i++)
dprintf(NULL, " 0x%02x,", (*g)[i]);
dprintf(NULL, "}\n");
av_dlog(NULL, " 0x%02x,", (*g)[i]);
av_dlog(NULL, "}\n");
}
#undef PRINT_IF_GUID
#else
@ -177,9 +177,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
int ret;
ff_get_guid(pb, &g);
gsize = get_le64(pb);
dprintf(s, "%08"PRIx64": ", gpos);
av_dlog(s, "%08"PRIx64": ", gpos);
print_guid(&g);
dprintf(s, " size=0x%"PRIx64"\n", gsize);
av_dlog(s, " size=0x%"PRIx64"\n", gsize);
if (!ff_guidcmp(&g, &ff_asf_data_header)) {
asf->data_object_offset = url_ftell(pb);
// if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
@ -704,7 +704,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
if (packet_length < asf->hdr.min_pktsize)
padsize += asf->hdr.min_pktsize - packet_length;
asf->packet_padsize = padsize;
dprintf(s, "packet: size=%d padsize=%d left=%d\n", s->packet_size, asf->packet_padsize, asf->packet_size_left);
av_dlog(s, "packet: size=%d padsize=%d left=%d\n", s->packet_size, asf->packet_padsize, asf->packet_size_left);
return 0;
}

View File

@ -85,7 +85,7 @@ static int avi_load_index(AVFormatContext *s);
static int guess_ni_flag(AVFormatContext *s);
#define print_tag(str, tag, size) \
dprintf(NULL, "%s: tag=%c%c%c%c size=0x%x\n", \
av_dlog(NULL, "%s: tag=%c%c%c%c size=0x%x\n", \
str, tag & 0xff, \
(tag >> 8) & 0xff, \
(tag >> 16) & 0xff, \
@ -380,7 +380,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
avi->movi_list = url_ftell(pb) - 4;
if(size) avi->movi_end = avi->movi_list + size + (size & 1);
else avi->movi_end = url_fsize(pb);
dprintf(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
av_dlog(NULL, "movi end=%"PRIx64"\n", avi->movi_end);
goto end_of_header;
}
else if (tag1 == MKTAG('I', 'N', 'F', 'O'))

View File

@ -408,7 +408,7 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
if ((ret = ffm_is_avail_data(s, FRAME_HEADER_SIZE+4)) < 0)
return ret;
dprintf(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
av_dlog(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
url_ftell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
FRAME_HEADER_SIZE)

View File

@ -424,7 +424,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
st->codec->sample_rate = cfg.ext_sample_rate;
else
st->codec->sample_rate = cfg.sample_rate;
dprintf(s, "mp4a config channels %d sample rate %d\n",
av_dlog(s, "mp4a config channels %d sample rate %d\n",
st->codec->channels, st->codec->sample_rate);
}

View File

@ -225,7 +225,7 @@ static int process_line(URLContext *h, char *line, int line_count,
p++;
s->http_code = strtol(p, &end, 10);
dprintf(NULL, "http_code=%d\n", s->http_code);
av_dlog(NULL, "http_code=%d\n", s->http_code);
/* error codes are 4xx and 5xx, but regard 401 as a success, so we
* don't abort until all headers have been parsed. */
@ -356,7 +356,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
if (http_get_line(s, line, sizeof(line)) < 0)
return AVERROR(EIO);
dprintf(NULL, "header='%s'\n", line);
av_dlog(NULL, "header='%s'\n", line);
err = process_line(h, line, s->line_count, new_location);
if (err < 0)
@ -387,7 +387,7 @@ static int http_read(URLContext *h, uint8_t *buf, int size)
s->chunksize = strtoll(line, NULL, 16);
dprintf(NULL, "Chunked encoding data size: %"PRId64"'\n", s->chunksize);
av_dlog(NULL, "Chunked encoding data size: %"PRId64"'\n", s->chunksize);
if (!s->chunksize)
return 0;

View File

@ -350,7 +350,7 @@ int ff_mp4_read_descr(AVFormatContext *fc, ByteIOContext *pb, int *tag)
int len;
*tag = get_byte(pb);
len = ff_mp4_read_descr_len(pb);
dprintf(fc, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
av_dlog(fc, "MPEG4 description: tag=0x%02x len=%d\n", *tag, len);
return len;
}
@ -373,10 +373,10 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, ByteIOContex
get_be32(pb); /* avg bitrate */
st->codec->codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id);
dprintf(fc, "esds object type id 0x%02x\n", object_type_id);
av_dlog(fc, "esds object type id 0x%02x\n", object_type_id);
len = ff_mp4_read_descr(fc, pb, &tag);
if (tag == MP4DecSpecificDescrTag) {
dprintf(fc, "Specific MPEG4 header len=%d\n", len);
av_dlog(fc, "Specific MPEG4 header len=%d\n", len);
if((uint64_t)len > (1<<30))
return -1;
av_free(st->codec->extradata);
@ -396,7 +396,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, ByteIOContex
st->codec->sample_rate = cfg.ext_sample_rate;
else
st->codec->sample_rate = cfg.sample_rate;
dprintf(fc, "mp4a config channels %d obj %d ext obj %d "
av_dlog(fc, "mp4a config channels %d obj %d ext obj %d "
"sample rate %d ext sample rate %d\n", st->codec->channels,
cfg.object_type, cfg.ext_object_type,
cfg.sample_rate, cfg.ext_sample_rate);

View File

@ -122,7 +122,7 @@ static int read_data_packet(MMSHContext *mmsh, const int len)
return AVERROR(EIO);
}
res = url_read_complete(mms->mms_hd, mms->in_buffer, len);
dprintf(NULL, "Data packet len = %d\n", len);
av_dlog(NULL, "Data packet len = %d\n", len);
if (res != len) {
av_log(NULL, AV_LOG_ERROR, "Read data packet failed!\n");
return AVERROR(EIO);
@ -156,7 +156,7 @@ static int get_http_header_data(MMSHContext *mmsh)
if (mms->asf_header) {
if (len != mms->asf_header_size) {
mms->asf_header_size = len;
dprintf(NULL, "Header len changed from %d to %d\n",
av_dlog(NULL, "Header len changed from %d to %d\n",
mms->asf_header_size, len);
av_freep(&mms->asf_header);
}
@ -201,7 +201,7 @@ static int get_http_header_data(MMSHContext *mmsh)
av_log(NULL, AV_LOG_ERROR, "Read other chunk type data failed!\n");
return AVERROR(EIO);
} else {
dprintf(NULL, "Skip chunk type %d \n", chunk_type);
av_dlog(NULL, "Skip chunk type %d \n", chunk_type);
continue;
}
}
@ -290,7 +290,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
av_log(NULL, AV_LOG_ERROR, "Build play request failed!\n");
goto fail;
}
dprintf(NULL, "out_buffer is %s", headers);
av_dlog(NULL, "out_buffer is %s", headers);
ff_http_set_headers(mms->mms_hd, headers);
err = url_connect(mms->mms_hd);
@ -304,12 +304,12 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
goto fail;
}
dprintf(NULL, "Connection successfully open\n");
av_dlog(NULL, "Connection successfully open\n");
return 0;
fail:
av_freep(&stream_selection);
mmsh_close(h);
dprintf(NULL, "Connection failed with error %d\n", err);
av_dlog(NULL, "Connection failed with error %d\n", err);
return err;
}

View File

@ -206,11 +206,11 @@ static int send_media_file_request(MMSTContext *mmst)
static void handle_packet_stream_changing_type(MMSTContext *mmst)
{
MMSContext *mms = &mmst->mms;
dprintf(NULL, "Stream changing!\n");
av_dlog(NULL, "Stream changing!\n");
// 40 is the packet header size, 7 is the prefix size.
mmst->header_packet_id= AV_RL32(mms->in_buffer + 40 + 7);
dprintf(NULL, "Changed header prefix to 0x%x", mmst->header_packet_id);
av_dlog(NULL, "Changed header prefix to 0x%x", mmst->header_packet_id);
}
static int send_keepalive_packet(MMSTContext *mmst)
@ -270,7 +270,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
}
length_remaining= AV_RL32(mms->in_buffer+8) + 4;
dprintf(NULL, "Length remaining is %d\n", length_remaining);
av_dlog(NULL, "Length remaining is %d\n", length_remaining);
// read the rest of the packet.
if (length_remaining < 0
|| length_remaining > sizeof(mms->in_buffer) - 12) {
@ -350,7 +350,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
} else if(packet_id_type == mmst->packet_id) {
packet_type = SC_PKT_ASF_MEDIA;
} else {
dprintf(NULL, "packet id type %d is old.", packet_id_type);
av_dlog(NULL, "packet id type %d is old.", packet_id_type);
continue;
}
}
@ -376,7 +376,7 @@ static int mms_safe_send_recv(MMSTContext *mmst,
if(send_fun) {
int ret = send_fun(mmst);
if (ret < 0) {
dprintf(NULL, "Send Packet error before expecting recv packet %d\n", expect_type);
av_dlog(NULL, "Send Packet error before expecting recv packet %d\n", expect_type);
return ret;
}
}
@ -554,7 +554,7 @@ static int mms_open(URLContext *h, const char *uri, int flags)
}
err = ff_mms_asf_header_parser(mms);
if (err) {
dprintf(NULL, "asf header parsed failed!\n");
av_dlog(NULL, "asf header parsed failed!\n");
goto fail;
}
mms->header_parsed = 1;
@ -571,11 +571,11 @@ static int mms_open(URLContext *h, const char *uri, int flags)
if (err) {
goto fail;
}
dprintf(NULL, "Leaving open (success)\n");
av_dlog(NULL, "Leaving open (success)\n");
return 0;
fail:
mms_close(h);
dprintf(NULL, "Leaving open (failure: %d)\n", err);
av_dlog(NULL, "Leaving open (failure: %d)\n", err);
return err;
}
@ -608,12 +608,12 @@ static int mms_read(URLContext *h, uint8_t *buf, int size)
// copy the data to the packet buffer.
result = ff_mms_read_data(mms, buf, size);
if (result == 0) {
dprintf(NULL, "read asf media paket size is zero!\n");
av_dlog(NULL, "read asf media paket size is zero!\n");
break;
}
}
} else {
dprintf(NULL, "read packet error!\n");
av_dlog(NULL, "read packet error!\n");
break;
}
}

View File

@ -266,7 +266,7 @@ static int mov_read_default(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
a.size = get_be32(pb);
a.type = get_le32(pb);
}
dprintf(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
av_dlog(c->fc, "type: %08x '%.4s' parent:'%.4s' sz: %"PRId64" %"PRId64" %"PRId64"\n",
a.type, (char*)&a.type, (char*)&atom.type, a.size, total_size, atom.size);
total_size += 8;
if (a.size == 1) { /* 64 bit extended size */
@ -349,7 +349,7 @@ static int mov_read_dref(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
dref->type = get_le32(pb);
get_be32(pb); // version + flags
dprintf(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
av_dlog(c->fc, "type %.4s size %d\n", (char*)&dref->type, size);
if (dref->type == MKTAG('a','l','i','s') && size > 150) {
/* macintosh alias record */
@ -441,8 +441,8 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
ctype = get_le32(pb);
type = get_le32(pb); /* component subtype */
dprintf(c->fc, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
dprintf(c->fc, "stype= %.4s\n", (char*)&type);
av_dlog(c->fc, "ctype= %.4s (0x%08x)\n", (char*)&ctype, ctype);
av_dlog(c->fc, "stype= %.4s\n", (char*)&type);
if (type == MKTAG('v','i','d','e'))
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
@ -583,7 +583,7 @@ static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
static int mov_read_moof(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
c->fragment.moof_offset = url_ftell(pb) - 8;
dprintf(c->fc, "moof offset %llx\n", c->fragment.moof_offset);
av_dlog(c->fc, "moof offset %llx\n", c->fragment.moof_offset);
return mov_read_default(c, pb, atom);
}
@ -655,7 +655,7 @@ static int mov_read_mvhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
mov_metadata_creation_time(&c->fc->metadata, creation_time);
c->time_scale = get_be32(pb); /* time scale */
dprintf(c->fc, "time scale = %i\n", c->time_scale);
av_dlog(c->fc, "time scale = %i\n", c->time_scale);
c->duration = (version == 1) ? get_be64(pb) : get_be32(pb); /* duration */
get_be32(pb); /* preferred scale */
@ -697,7 +697,7 @@ static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
st->codec->extradata_size = 0x5a + atom.size;
memcpy(st->codec->extradata, "SVQ3", 4); // fake
get_buffer(pb, st->codec->extradata + 0x5a, atom.size);
dprintf(c->fc, "Reading SMI %"PRId64" %s\n", atom.size, st->codec->extradata + 0x5a);
av_dlog(c->fc, "Reading SMI %"PRId64" %s\n", atom.size, st->codec->extradata + 0x5a);
return 0;
}
@ -711,7 +711,7 @@ static int mov_read_enda(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
st = c->fc->streams[c->fc->nb_streams-1];
little_endian = get_be16(pb);
dprintf(c->fc, "enda %d\n", little_endian);
av_dlog(c->fc, "enda %d\n", little_endian);
if (little_endian == 1) {
switch (st->codec->codec_id) {
case CODEC_ID_PCM_S24BE:
@ -974,7 +974,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
}
}
dprintf(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
av_dlog(c->fc, "size=%d 4CC= %c%c%c%c codec_type=%d\n", size,
(format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
(format >> 24) & 0xff, st->codec->codec_type);
@ -1009,7 +1009,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
st->codec->bits_per_coded_sample = get_be16(pb); /* depth */
st->codec->color_table_id = get_be16(pb); /* colortable id */
dprintf(c->fc, "depth %d, ctab id %d\n",
av_dlog(c->fc, "depth %d, ctab id %d\n",
st->codec->bits_per_coded_sample, st->codec->color_table_id);
/* figure out the palette situation */
color_depth = st->codec->bits_per_coded_sample & 0x1F;
@ -1091,7 +1091,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
get_be32(pb); /* vendor */
st->codec->channels = get_be16(pb); /* channel count */
dprintf(c->fc, "audio channels %d\n", st->codec->channels);
av_dlog(c->fc, "audio channels %d\n", st->codec->channels);
st->codec->bits_per_coded_sample = get_be16(pb); /* sample size */
sc->audio_cid = get_be16(pb);
@ -1100,7 +1100,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, ByteIOContext *pb, int entries)
st->codec->sample_rate = ((get_be32(pb) >> 16));
//Read QT version 1 fields. In version 0 these do not exist.
dprintf(c->fc, "version =%d, isom =%d\n",version,c->isom);
av_dlog(c->fc, "version =%d, isom =%d\n",version,c->isom);
if(!c->isom) {
if(version==1) {
sc->samples_per_frame = get_be32(pb);
@ -1271,7 +1271,7 @@ static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
entries = get_be32(pb);
dprintf(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
av_dlog(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries);
if(entries >= UINT_MAX / sizeof(*sc->stsc_data))
return -1;
@ -1311,7 +1311,7 @@ static int mov_read_stps(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
for (i = 0; i < entries; i++) {
sc->stps_data[i] = get_be32(pb);
//dprintf(c->fc, "stps %d\n", sc->stps_data[i]);
//av_dlog(c->fc, "stps %d\n", sc->stps_data[i]);
}
return 0;
@ -1333,7 +1333,7 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
entries = get_be32(pb);
dprintf(c->fc, "keyframe_count = %d\n", entries);
av_dlog(c->fc, "keyframe_count = %d\n", entries);
if(entries >= UINT_MAX / sizeof(int))
return -1;
@ -1344,7 +1344,7 @@ static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
for(i=0; i<entries; i++) {
sc->keyframes[i] = get_be32(pb);
//dprintf(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
//av_dlog(c->fc, "keyframes[]=%d\n", sc->keyframes[i]);
}
return 0;
}
@ -1377,7 +1377,7 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
}
entries = get_be32(pb);
dprintf(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
av_dlog(c->fc, "sample_size = %d sample_count = %d\n", sc->sample_size, entries);
sc->sample_count = entries;
if (sample_size)
@ -1434,7 +1434,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_be24(pb); /* flags */
entries = get_be32(pb);
dprintf(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
av_dlog(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries);
if(entries >= UINT_MAX / sizeof(*sc->stts_data))
return -1;
@ -1452,7 +1452,7 @@ static int mov_read_stts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
sc->stts_data[i].count= sample_count;
sc->stts_data[i].duration= sample_duration;
dprintf(c->fc, "sample_count=%d, sample_duration=%d\n",sample_count,sample_duration);
av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",sample_count,sample_duration);
duration+=(int64_t)sample_duration*sample_count;
total_sample_count+=sample_count;
@ -1479,7 +1479,7 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_be24(pb); /* flags */
entries = get_be32(pb);
dprintf(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
av_dlog(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries);
if(entries >= UINT_MAX / sizeof(*sc->ctts_data))
return -1;
@ -1498,7 +1498,7 @@ static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
sc->dts_shift = FFMAX(sc->dts_shift, -duration);
}
dprintf(c->fc, "dts shift %d\n", sc->dts_shift);
av_dlog(c->fc, "dts shift %d\n", sc->dts_shift);
return 0;
}
@ -1578,7 +1578,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
e->size = sample_size;
e->min_distance = distance;
e->flags = keyframe ? AVINDEX_KEYFRAME : 0;
dprintf(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
av_dlog(mov->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
"size %d, distance %d, keyframe %d\n", st->index, current_sample,
current_offset, current_dts, sample_size, distance, keyframe);
}
@ -1626,7 +1626,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
total += chunk_count * count;
}
dprintf(mov->fc, "chunk count %d\n", total);
av_dlog(mov->fc, "chunk count %d\n", total);
if (total >= UINT_MAX / sizeof(*st->index_entries))
return;
st->index_entries = av_malloc(total*sizeof(*st->index_entries));
@ -1670,7 +1670,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
e->size = size;
e->min_distance = 0;
e->flags = AVINDEX_KEYFRAME;
dprintf(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
av_dlog(mov->fc, "AVIndex stream %d, chunk %d, offset %"PRIx64", dts %"PRId64", "
"size %d, duration %d\n", st->index, i, current_offset, current_dts,
size, samples);
@ -1764,7 +1764,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
!st->codec->frame_size && sc->stts_count == 1) {
st->codec->frame_size = av_rescale(sc->stts_data[0].duration,
st->codec->sample_rate, sc->time_scale);
dprintf(c->fc, "frame size %d\n", st->codec->frame_size);
av_dlog(c->fc, "frame size %d\n", st->codec->frame_size);
}
mov_build_index(c, st);
@ -1961,7 +1961,7 @@ static int mov_read_tfhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
frag->duration = flags & 0x08 ? get_be32(pb) : trex->duration;
frag->size = flags & 0x10 ? get_be32(pb) : trex->size;
frag->flags = flags & 0x20 ? get_be32(pb) : trex->flags;
dprintf(c->fc, "frag flags 0x%x\n", frag->flags);
av_dlog(c->fc, "frag flags 0x%x\n", frag->flags);
return 0;
}
@ -2019,7 +2019,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_byte(pb); /* version */
flags = get_be24(pb);
entries = get_be32(pb);
dprintf(c->fc, "flags 0x%x entries %d\n", flags, entries);
av_dlog(c->fc, "flags 0x%x entries %d\n", flags, entries);
if (flags & 0x001) data_offset = get_be32(pb);
if (flags & 0x004) first_sample_flags = get_be32(pb);
if (flags & 0x800) {
@ -2035,7 +2035,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
dts = st->duration;
offset = frag->base_data_offset + data_offset;
distance = 0;
dprintf(c->fc, "first sample flags 0x%x\n", first_sample_flags);
av_dlog(c->fc, "first sample flags 0x%x\n", first_sample_flags);
for (i = 0; i < entries; i++) {
unsigned sample_size = frag->size;
int sample_flags = i ? frag->flags : first_sample_flags;
@ -2055,7 +2055,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
distance = 0;
av_add_index_entry(st, offset, dts, sample_size, distance,
keyframe ? AVINDEX_KEYFRAME : 0);
dprintf(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
av_dlog(c->fc, "AVIndex stream %d, sample %d, offset %"PRIx64", dts %"PRId64", "
"size %d, distance %d, keyframe %d\n", st->index, sc->sample_count+i,
offset, dts, sample_size, distance, keyframe);
distance++;
@ -2172,7 +2172,7 @@ static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_WARNING, "multiple edit list entries, "
"a/v desync might occur, patch welcome\n");
dprintf(c->fc, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
av_dlog(c->fc, "track[%i].edit_count = %i\n", c->fc->nb_streams-1, edit_count);
return 0;
}
@ -2363,7 +2363,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap)
av_log(s, AV_LOG_ERROR, "moov atom not found\n");
return -1;
}
dprintf(mov->fc, "on_parse_exit_offset=%lld\n", url_ftell(pb));
av_dlog(mov->fc, "on_parse_exit_offset=%lld\n", url_ftell(pb));
if (!url_is_streamed(pb) && mov->chapter_track > 0)
mov_read_chapters(s);
@ -2382,7 +2382,7 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
if (msc->pb && msc->current_sample < avst->nb_index_entries) {
AVIndexEntry *current_sample = &avst->index_entries[msc->current_sample];
int64_t dts = av_rescale(current_sample->timestamp, AV_TIME_BASE, msc->time_scale);
dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
av_dlog(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
if (!sample || (url_is_streamed(s->pb) && current_sample->pos < sample->pos) ||
(!url_is_streamed(s->pb) &&
((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
@ -2412,7 +2412,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
mov_read_default(mov, s->pb, (MOVAtom){ AV_RL32("root"), INT64_MAX }) < 0 ||
url_feof(s->pb))
return AVERROR_EOF;
dprintf(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb));
av_dlog(s, "read fragments, offset 0x%llx\n", url_ftell(s->pb));
goto retry;
}
sc = st->priv_data;
@ -2463,7 +2463,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
goto retry;
pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? AV_PKT_FLAG_KEY : 0;
pkt->pos = sample->pos;
dprintf(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
av_dlog(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n",
pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration);
return 0;
}
@ -2475,13 +2475,13 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp,
int i;
sample = av_index_search_timestamp(st, timestamp, flags);
dprintf(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
av_dlog(s, "stream %d, timestamp %"PRId64", sample %d\n", st->index, timestamp, sample);
if (sample < 0 && st->nb_index_entries && timestamp < st->index_entries[0].timestamp)
sample = 0;
if (sample < 0) /* not sure what to do */
return -1;
sc->current_sample = sample;
dprintf(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
av_dlog(s, "stream %d, found sample %d\n", st->index, sc->current_sample);
/* adjust ctts index */
if (sc->ctts_data) {
time_sample = 0;

View File

@ -289,7 +289,7 @@ static MpegTSFilter *mpegts_open_section_filter(MpegTSContext *ts, unsigned int
MpegTSFilter *filter;
MpegTSSectionFilter *sec;
dprintf(ts->stream, "Filter: pid=0x%x\n", pid);
av_dlog(ts->stream, "Filter: pid=0x%x\n", pid);
if (pid >= NB_PID_MAX || ts->pids[pid])
return NULL;
@ -678,7 +678,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
pes->header[2] == 0x01) {
/* it must be an mpeg2 PES stream */
code = pes->header[3] | 0x100;
dprintf(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
av_dlog(pes->stream, "pid=%x pes_code=%#x\n", pes->pid, code);
if ((pes->st && pes->st->discard == AVDISCARD_ALL) ||
code == 0x1be) /* padding_stream */
@ -714,7 +714,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
code != 0x1f8) { /* ITU-T Rec. H.222.1 type E stream */
pes->state = MPEGTS_PESHEADER;
if (pes->st->codec->codec_id == CODEC_ID_NONE) {
dprintf(pes->stream, "pid=%x stream_type=%x probing\n",
av_dlog(pes->stream, "pid=%x stream_type=%x probing\n",
pes->pid, pes->stream_type);
pes->st->codec->codec_id = CODEC_ID_PROBE;
}
@ -878,7 +878,7 @@ static int mp4_read_iods(AVFormatContext *s, const uint8_t *buf, unsigned size,
len = ff_mp4_read_descr(s, &pb, &tag);
if (tag == MP4ESDescrTag) {
*es_id = get_be16(&pb); /* ES_ID */
dprintf(s, "ES_ID %#x\n", *es_id);
av_dlog(s, "ES_ID %#x\n", *es_id);
get_byte(&pb); /* priority */
len = ff_mp4_read_descr(s, &pb, &tag);
if (tag == MP4DecConfigDescrTag) {
@ -912,7 +912,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
if (desc_end > desc_list_end)
return -1;
dprintf(fc, "tag: 0x%02x len=%d\n", desc_tag, desc_len);
av_dlog(fc, "tag: 0x%02x len=%d\n", desc_tag, desc_len);
if (st->codec->codec_id == CODEC_ID_NONE &&
stream_type == STREAM_TYPE_PRIVATE_DATA)
@ -967,7 +967,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
break;
case 0x05: /* registration descriptor */
st->codec->codec_tag = bytestream_get_le32(pp);
dprintf(fc, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
av_dlog(fc, "reg_desc=%.4s\n", (char*)&st->codec->codec_tag);
if (st->codec->codec_id == CODEC_ID_NONE &&
stream_type == STREAM_TYPE_PRIVATE_DATA)
mpegts_find_stream_type(st, st->codec->codec_tag, REGD_types);
@ -994,7 +994,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
int mp4_es_id = 0;
#ifdef DEBUG
dprintf(ts->stream, "PMT: len %i\n", section_len);
av_dlog(ts->stream, "PMT: len %i\n", section_len);
av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (uint8_t *)section, section_len);
#endif
@ -1003,7 +1003,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (parse_section_header(h, &p, p_end) < 0)
return;
dprintf(ts->stream, "sid=0x%x sec_num=%d/%d\n",
av_dlog(ts->stream, "sid=0x%x sec_num=%d/%d\n",
h->id, h->sec_num, h->last_sec_num);
if (h->tid != PMT_TID)
@ -1015,7 +1015,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
return;
add_pid_to_pmt(ts, h->id, pcr_pid);
dprintf(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
av_dlog(ts->stream, "pcr_pid=0x%x\n", pcr_pid);
program_info_length = get16(&p, p_end) & 0xfff;
if (program_info_length < 0)
@ -1025,7 +1025,7 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
tag = get8(&p, p_end);
len = get8(&p, p_end);
dprintf(ts->stream, "program tag: 0x%02x len=%d\n", tag, len);
av_dlog(ts->stream, "program tag: 0x%02x len=%d\n", tag, len);
if(len > program_info_length - 2)
//something else is broken, exit the program_descriptors_loop
@ -1114,7 +1114,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
int sid, pmt_pid;
#ifdef DEBUG
dprintf(ts->stream, "PAT:\n");
av_dlog(ts->stream, "PAT:\n");
av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (uint8_t *)section, section_len);
#endif
p_end = section + section_len - 4;
@ -1133,7 +1133,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (pmt_pid < 0)
break;
dprintf(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
av_dlog(ts->stream, "sid=0x%x pid=0x%x\n", sid, pmt_pid);
if (sid == 0x0000) {
/* NIT info */
@ -1158,7 +1158,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
char *name, *provider_name;
#ifdef DEBUG
dprintf(ts->stream, "SDT:\n");
av_dlog(ts->stream, "SDT:\n");
av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (uint8_t *)section, section_len);
#endif
@ -1196,7 +1196,7 @@ static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (desc_end > desc_list_end)
break;
dprintf(ts->stream, "tag: 0x%02x len=%d\n",
av_dlog(ts->stream, "tag: 0x%02x len=%d\n",
desc_tag, desc_len);
switch(desc_tag) {
@ -1484,7 +1484,7 @@ static int mpegts_read_header(AVFormatContext *s,
ts->auto_guess = 1;
dprintf(ts->stream, "tuning done\n");
av_dlog(ts->stream, "tuning done\n");
s->ctx_flags |= AVFMTCTX_NOHEADER;
} else {

View File

@ -63,7 +63,7 @@ extern const MXFCodecUL ff_mxf_codec_uls[];
int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt);
#define PRINT_KEY(pc, s, x) dprintf(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
#define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \
(x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
#endif /* AVFORMAT_MXF_H */

View File

@ -309,7 +309,7 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (klv_read_packet(&klv, s->pb) < 0)
return -1;
PRINT_KEY(s, "read packet", klv.key);
dprintf(s, "size %lld offset %#llx\n", klv.length, klv.offset);
av_dlog(s, "size %lld offset %#llx\n", klv.length, klv.offset);
if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) {
int res = mxf_decrypt_triplet(s, pkt, &klv);
if (res < 0) {
@ -518,12 +518,12 @@ static int mxf_read_source_package(void *arg, ByteIOContext *pb, int tag, int si
static int mxf_read_index_table_segment(void *arg, ByteIOContext *pb, int tag, int size, UID uid)
{
switch(tag) {
case 0x3F05: dprintf(NULL, "EditUnitByteCount %d\n", get_be32(pb)); break;
case 0x3F06: dprintf(NULL, "IndexSID %d\n", get_be32(pb)); break;
case 0x3F07: dprintf(NULL, "BodySID %d\n", get_be32(pb)); break;
case 0x3F0B: dprintf(NULL, "IndexEditRate %d/%d\n", get_be32(pb), get_be32(pb)); break;
case 0x3F0C: dprintf(NULL, "IndexStartPosition %lld\n", get_be64(pb)); break;
case 0x3F0D: dprintf(NULL, "IndexDuration %lld\n", get_be64(pb)); break;
case 0x3F05: av_dlog(NULL, "EditUnitByteCount %d\n", get_be32(pb)); break;
case 0x3F06: av_dlog(NULL, "IndexSID %d\n", get_be32(pb)); break;
case 0x3F07: av_dlog(NULL, "BodySID %d\n", get_be32(pb)); break;
case 0x3F0B: av_dlog(NULL, "IndexEditRate %d/%d\n", get_be32(pb), get_be32(pb)); break;
case 0x3F0C: av_dlog(NULL, "IndexStartPosition %lld\n", get_be64(pb)); break;
case 0x3F0D: av_dlog(NULL, "IndexDuration %lld\n", get_be64(pb)); break;
}
return 0;
}
@ -536,7 +536,7 @@ static void mxf_read_pixel_layout(ByteIOContext *pb, MXFDescriptor *descriptor)
do {
code = get_byte(pb);
value = get_byte(pb);
dprintf(NULL, "pixel layout: code %#x\n", code);
av_dlog(NULL, "pixel layout: code %#x\n", code);
if (ofs < 16) {
layout[ofs++] = code;
@ -666,7 +666,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
MXFPackage *temp_package = NULL;
int i, j, k;
dprintf(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
av_dlog(mxf->fc, "metadata sets count %d\n", mxf->metadata_sets_count);
/* TODO: handle multiple material packages (OP3x) */
for (i = 0; i < mxf->packages_count; i++) {
material_package = mxf_resolve_strong_ref(mxf, &mxf->packages_refs[i], MaterialPackage);
@ -876,7 +876,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
uint64_t next = url_ftell(pb) + size;
UID uid = {0};
dprintf(mxf->fc, "local tag %#04x size %d\n", tag, size);
av_dlog(mxf->fc, "local tag %#04x size %d\n", tag, size);
if (!size) { /* ignore empty tag, needed for some files with empty UMID tag */
av_log(mxf->fc, AV_LOG_ERROR, "local tag %#04x with 0 size\n", tag);
continue;
@ -887,7 +887,7 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF
int local_tag = AV_RB16(mxf->local_tags+i*18);
if (local_tag == tag) {
memcpy(uid, mxf->local_tags+i*18+2, 16);
dprintf(mxf->fc, "local tag %#04x\n", local_tag);
av_dlog(mxf->fc, "local tag %#04x\n", local_tag);
PRINT_KEY(mxf->fc, "uid", uid);
}
}
@ -920,7 +920,7 @@ static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (klv_read_packet(&klv, s->pb) < 0)
return -1;
PRINT_KEY(s, "read header", klv.key);
dprintf(s, "size %lld offset %#llx\n", klv.length, klv.offset);
av_dlog(s, "size %lld offset %#llx\n", klv.length, klv.offset);
if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
IS_KLV_KEY(klv.key, mxf_essence_element_key)) {
/* FIXME avoid seek */

View File

@ -43,7 +43,7 @@ static int read_atom(AVFormatContext *s, Atom *atom)
if (atom->size < 8)
return -1;
atom->tag = get_le32(s->pb);
dprintf(s, "atom %d %.4s offset %#llx\n",
av_dlog(s, "atom %d %.4s offset %#llx\n",
atom->size, (char*)&atom->tag, atom->offset);
return atom->size;
}
@ -61,16 +61,16 @@ static int r3d_read_red1(AVFormatContext *s)
tmp = get_byte(s->pb); // major version
tmp2 = get_byte(s->pb); // minor version
dprintf(s, "version %d.%d\n", tmp, tmp2);
av_dlog(s, "version %d.%d\n", tmp, tmp2);
tmp = get_be16(s->pb); // unknown
dprintf(s, "unknown1 %d\n", tmp);
av_dlog(s, "unknown1 %d\n", tmp);
tmp = get_be32(s->pb);
av_set_pts_info(st, 32, 1, tmp);
tmp = get_be32(s->pb); // filenum
dprintf(s, "filenum %d\n", tmp);
av_dlog(s, "filenum %d\n", tmp);
url_fskip(s->pb, 32); // unknown
@ -78,13 +78,13 @@ static int r3d_read_red1(AVFormatContext *s)
st->codec->height = get_be32(s->pb);
tmp = get_be16(s->pb); // unknown
dprintf(s, "unknown2 %d\n", tmp);
av_dlog(s, "unknown2 %d\n", tmp);
st->codec->time_base.den = get_be16(s->pb);
st->codec->time_base.num = get_be16(s->pb);
tmp = get_byte(s->pb); // audio channels
dprintf(s, "audio channels %d\n", tmp);
av_dlog(s, "audio channels %d\n", tmp);
if (tmp > 0) {
AVStream *ast = av_new_stream(s, 1);
if (!ast)
@ -99,10 +99,10 @@ static int r3d_read_red1(AVFormatContext *s)
filename[sizeof(filename)-1] = 0;
av_metadata_set2(&st->metadata, "filename", filename, 0);
dprintf(s, "filename %s\n", filename);
dprintf(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
dprintf(s, "timescale %d\n", st->time_base.den);
dprintf(s, "frame rate %d/%d\n",
av_dlog(s, "filename %s\n", filename);
av_dlog(s, "resolution %dx%d\n", st->codec->width, st->codec->height);
av_dlog(s, "timescale %d\n", st->time_base.den);
av_dlog(s, "frame rate %d/%d\n",
st->codec->time_base.num, st->codec->time_base.den);
return 0;
@ -125,13 +125,13 @@ static int r3d_read_rdvo(AVFormatContext *s, Atom *atom)
r3d->video_offsets_count = i;
break;
}
dprintf(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
av_dlog(s, "video offset %d: %#x\n", i, r3d->video_offsets[i]);
}
if (st->codec->time_base.den)
st->duration = (uint64_t)r3d->video_offsets_count*
st->time_base.den*st->codec->time_base.num/st->codec->time_base.den;
dprintf(s, "duration %lld\n", st->duration);
av_dlog(s, "duration %lld\n", st->duration);
return 0;
}
@ -147,10 +147,10 @@ static void r3d_read_reos(AVFormatContext *s)
get_be32(s->pb); // rdas offset
tmp = get_be32(s->pb);
dprintf(s, "num video chunks %d\n", tmp);
av_dlog(s, "num video chunks %d\n", tmp);
tmp = get_be32(s->pb);
dprintf(s, "num audio chunks %d\n", tmp);
av_dlog(s, "num audio chunks %d\n", tmp);
url_fskip(s->pb, 6*4);
}
@ -176,7 +176,7 @@ static int r3d_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
s->data_offset = url_ftell(s->pb);
dprintf(s, "data offset %#llx\n", s->data_offset);
av_dlog(s, "data offset %#llx\n", s->data_offset);
if (url_is_streamed(s->pb))
return 0;
// find REOB/REOF/REOS to load index
@ -217,29 +217,29 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
dts = get_be32(s->pb);
tmp = get_be32(s->pb);
dprintf(s, "frame num %d\n", tmp);
av_dlog(s, "frame num %d\n", tmp);
tmp = get_byte(s->pb); // major version
tmp2 = get_byte(s->pb); // minor version
dprintf(s, "version %d.%d\n", tmp, tmp2);
av_dlog(s, "version %d.%d\n", tmp, tmp2);
tmp = get_be16(s->pb); // unknown
dprintf(s, "unknown %d\n", tmp);
av_dlog(s, "unknown %d\n", tmp);
if (tmp > 4) {
tmp = get_be16(s->pb); // unknown
dprintf(s, "unknown %d\n", tmp);
av_dlog(s, "unknown %d\n", tmp);
tmp = get_be16(s->pb); // unknown
dprintf(s, "unknown %d\n", tmp);
av_dlog(s, "unknown %d\n", tmp);
tmp = get_be32(s->pb);
dprintf(s, "width %d\n", tmp);
av_dlog(s, "width %d\n", tmp);
tmp = get_be32(s->pb);
dprintf(s, "height %d\n", tmp);
av_dlog(s, "height %d\n", tmp);
tmp = get_be32(s->pb);
dprintf(s, "metadata len %d\n", tmp);
av_dlog(s, "metadata len %d\n", tmp);
}
tmp = atom->size - 8 - (url_ftell(s->pb) - pos);
if (tmp < 0)
@ -255,7 +255,7 @@ static int r3d_read_redv(AVFormatContext *s, AVPacket *pkt, Atom *atom)
if (st->codec->time_base.den)
pkt->duration = (uint64_t)st->time_base.den*
st->codec->time_base.num/st->codec->time_base.den;
dprintf(s, "pkt dts %lld duration %d\n", pkt->dts, pkt->duration);
av_dlog(s, "pkt dts %lld duration %d\n", pkt->dts, pkt->duration);
return 0;
}
@ -275,17 +275,17 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
samples = get_be32(s->pb);
tmp = get_be32(s->pb);
dprintf(s, "packet num %d\n", tmp);
av_dlog(s, "packet num %d\n", tmp);
tmp = get_be16(s->pb); // unkown
dprintf(s, "unknown %d\n", tmp);
av_dlog(s, "unknown %d\n", tmp);
tmp = get_byte(s->pb); // major version
tmp2 = get_byte(s->pb); // minor version
dprintf(s, "version %d.%d\n", tmp, tmp2);
av_dlog(s, "version %d.%d\n", tmp, tmp2);
tmp = get_be32(s->pb); // unknown
dprintf(s, "unknown %d\n", tmp);
av_dlog(s, "unknown %d\n", tmp);
size = atom->size - 8 - (url_ftell(s->pb) - pos);
if (size < 0)
@ -299,7 +299,7 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
pkt->stream_index = 1;
pkt->dts = dts;
pkt->duration = av_rescale(samples, st->time_base.den, st->codec->sample_rate);
dprintf(s, "pkt dts %lld duration %d samples %d sample rate %d\n",
av_dlog(s, "pkt dts %lld duration %d samples %d sample rate %d\n",
pkt->dts, pkt->duration, samples, st->codec->sample_rate);
return 0;
@ -356,7 +356,7 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i
frame_num = sample_time*st->codec->time_base.den/
((int64_t)st->codec->time_base.num*st->time_base.den);
dprintf(s, "seek frame num %d timestamp %lld\n", frame_num, sample_time);
av_dlog(s, "seek frame num %d timestamp %lld\n", frame_num, sample_time);
if (frame_num < r3d->video_offsets_count) {
url_fseek(s->pb, r3d->video_offsets_count, SEEK_SET);

View File

@ -324,9 +324,9 @@ int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
len = url_close_dyn_buf(pb, &buf);
if ((len > 0) && buf) {
int result;
dprintf(s->ic, "sending %d bytes of RR\n", len);
av_dlog(s->ic, "sending %d bytes of RR\n", len);
result= url_write(s->rtp_ctx, buf, len);
dprintf(s->ic, "result from url_write: %d\n", result);
av_dlog(s->ic, "result from url_write: %d\n", result);
av_free(buf);
}
return 0;

View File

@ -192,7 +192,7 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
RTPMuxContext *s = s1->priv_data;
uint32_t rtp_ts;
dprintf(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
av_dlog(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
s->last_rtcp_ntp_time = ntp_time;
rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, (AVRational){1, 1000000},
@ -215,7 +215,7 @@ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
{
RTPMuxContext *s = s1->priv_data;
dprintf(s1, "rtp_send_data size=%d\n", len);
av_dlog(s1, "rtp_send_data size=%d\n", len);
/* build the RTP header */
put_byte(s1->pb, (RTP_VERSION << 6));
@ -364,7 +364,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
int rtcp_bytes;
int size= pkt->size;
dprintf(s1, "%d: write len=%d\n", pkt->stream_index, size);
av_dlog(s1, "%d: write len=%d\n", pkt->stream_index, size);
rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
RTCP_TX_RATIO_DEN;

View File

@ -247,7 +247,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
struct sockaddr_storage sdp_ip;
int ttl;
dprintf(s, "sdp: %c='%s'\n", letter, buf);
av_dlog(s, "sdp: %c='%s'\n", letter, buf);
p = buf;
if (s1->skip_media && letter != 'm')
@ -826,7 +826,7 @@ void ff_rtsp_skip_packet(AVFormatContext *s)
return;
len = AV_RB16(buf + 1);
dprintf(s, "skipping RTP packet len=%d\n", len);
av_dlog(s, "skipping RTP packet len=%d\n", len);
/* skip payload */
while (len > 0) {
@ -860,7 +860,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
for (;;) {
ret = url_read_complete(rt->rtsp_hd, &ch, 1);
#ifdef DEBUG_RTP_TCP
dprintf(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
av_dlog(s, "ret=%d c=%02x [%c]\n", ret, ch, ch);
#endif
if (ret != 1)
return AVERROR_EOF;
@ -879,7 +879,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
}
*q = '\0';
dprintf(s, "line='%s'\n", buf);
av_dlog(s, "line='%s'\n", buf);
/* test if last line */
if (buf[0] == '\0')
@ -984,7 +984,7 @@ static int ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
out_buf = base64buf;
}
dprintf(s, "Sending:\n%s--\n", buf);
av_dlog(s, "Sending:\n%s--\n", buf);
url_write(rt->rtsp_hd_out, out_buf, strlen(out_buf));
if (send_content_length > 0 && send_content) {

View File

@ -184,7 +184,7 @@ int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
RTSPStream *rtsp_st;
#ifdef DEBUG_RTP_TCP
dprintf(s, "tcp_read_packet:\n");
av_dlog(s, "tcp_read_packet:\n");
#endif
redo:
for (;;) {
@ -205,7 +205,7 @@ redo:
id = buf[0];
len = AV_RB16(buf + 1);
#ifdef DEBUG_RTP_TCP
dprintf(s, "id=%d len=%d\n", id, len);
av_dlog(s, "id=%d len=%d\n", id, len);
#endif
if (len > buf_size || len < 12)
goto redo;

View File

@ -114,13 +114,6 @@
/* debug stuff */
/* dprintf macros */
#ifdef DEBUG
# define dprintf(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
#else
# define dprintf(pctx, ...)
#endif
#define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
/* math */

View File

@ -135,6 +135,17 @@ void av_log_set_callback(void (*)(void*, int, const char*, va_list));
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
const char* av_default_item_name(void* ctx);
/**
* av_dlog macros
* Useful to print debug messages that shouldn't get compiled in normally.
*/
#ifdef DEBUG
# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
#else
# define av_dlog(pctx, ...)
#endif
/**
* Skip repeated messages, this requires the user app to use av_log() instead of
* (f)printf as the 2 would otherwise interfere and lead to