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
}
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");
}
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;
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;
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;
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)
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)
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;
}
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)
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;
}
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
{
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);
}
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;
}
} 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;
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
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);
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);
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);
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) {
*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;
}
}
if (p != p_end) {
- dprintf(avctx, "Junk at end of packet\n");
+ av_dlog(avctx, "Junk at end of packet\n");
return -1;
}
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;
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 */
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:
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:
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:
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;
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;
}
}
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],
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));
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:
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);
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;
}
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);
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 ',':
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;
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;
}
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) {
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
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);
}
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;
}
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);
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]);
/* 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) {
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);
}
}
}
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);
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)
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 */
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);
}
/* 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){
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 */
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);
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) {
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],
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]);
}
}
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;
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;
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]=
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);
/* 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);
}
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);
}
}
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);
/* 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;
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;
}
#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;
}
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++)
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 */
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);
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;
}
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;
}
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);
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);
/* 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",
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;
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),
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;
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];
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");
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]);
}
}
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){
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;
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) {
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;
}
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;
VAPictureParameterBufferH264 *pic_param;
VAIQMatrixBufferH264 *iq_matrix;
- dprintf(avctx, "start_frame()\n");
+ av_dlog(avctx, "start_frame()\n");
vactx->slice_param_size = sizeof(VASliceParameterBufferH264);
{
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);
}
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);
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);
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);
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);
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
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);
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))) {
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 */
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");
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;
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];
}
}
- 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 */
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 */
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 */
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) {
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)) {
/** 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
/** 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 */
/** 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 */
/** 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);
}
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,
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,
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),
}
}
-#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);
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;
}
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);
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;
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) {
#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)
{
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
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..
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;
}
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, \
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'))
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)
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);
}
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. */
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)
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;
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;
}
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);
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);
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);
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);
}
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;
}
}
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);
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;
}
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)
}
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) {
} 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;
}
}
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;
}
}
}
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;
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;
}
// 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;
}
}
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 */
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 */
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;
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);
}
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 */
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;
}
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:
}
}
- 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);
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;
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);
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);
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;
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;
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;
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;
}
}
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)
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;
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;
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;
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;
}
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);
}
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));
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);
!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);
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;
}
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) {
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;
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++;
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;
}
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);
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 &&
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;
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;
}
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;
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;
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 */
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;
}
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) {
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)
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);
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
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)
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)
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
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;
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 */
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
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) {
ts->auto_guess = 1;
- dprintf(ts->stream, "tuning done\n");
+ av_dlog(ts->stream, "tuning done\n");
s->ctx_flags |= AVFMTCTX_NOHEADER;
} else {
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 */
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) {
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;
}
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;
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);
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;
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);
}
}
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 */
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;
}
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
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)
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;
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;
}
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);
}
}
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
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)
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;
}
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)
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;
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);
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;
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},
{
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));
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;
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')
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) {
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;
}
*q = '\0';
- dprintf(s, "line='%s'\n", buf);
+ av_dlog(s, "line='%s'\n", buf);
/* test if last line */
if (buf[0] == '\0')
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) {
RTSPStream *rtsp_st;
#ifdef DEBUG_RTP_TCP
- dprintf(s, "tcp_read_packet:\n");
+ av_dlog(s, "tcp_read_packet:\n");
#endif
redo:
for (;;) {
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;
/* 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 */
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
* "Last message repeated x times" messages below (f)printf messages with some