Browse Source

avcodec/mediacodecdec: add more trace logging of input/output buffers

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
tags/n4.0
Aman Gupta 8 years ago
parent
commit
823a758543
3 changed files with 10 additions and 2 deletions
  1. +3
    -0
      libavcodec/mediacodec.c
  2. +6
    -2
      libavcodec/mediacodecdec_common.c
  3. +1
    -0
      libavcodec/mediacodecdec_common.h

+ 3
- 0
libavcodec/mediacodec.c View File

@@ -92,6 +92,9 @@ int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render)
int released = atomic_fetch_add(&buffer->released, 1);

if (!released && (ctx->delay_flush || buffer->serial == atomic_load(&ctx->serial))) {
av_log(ctx->avctx, AV_LOG_TRACE,
"Releasing output buffer %zd ts=%"PRId64" render=%d\n",
buffer->index, buffer->pts, render);
return ff_AMediaCodec_releaseOutputBuffer(ctx->codec, buffer->index, render);
}



+ 6
- 2
libavcodec/mediacodecdec_common.c View File

@@ -452,6 +452,7 @@ int ff_mediacodec_dec_init(AVCodecContext *avctx, MediaCodecDecContext *s,
AV_PIX_FMT_NONE,
};

s->avctx = avctx;
atomic_init(&s->refcount, 1);
atomic_init(&s->serial, 1);

@@ -598,8 +599,8 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
return AVERROR_EXTERNAL;
}

av_log(avctx, AV_LOG_TRACE, "Queued input buffer %zd"
" size=%zd ts=%" PRIi64 "\n", index, size, pts);
av_log(avctx, AV_LOG_TRACE,
"Queued input buffer %zd size=%zd ts=%"PRIi64"\n", index, size, pts);

s->draining = 1;
break;
@@ -619,6 +620,9 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
av_log(avctx, AV_LOG_ERROR, "Failed to queue input buffer (status = %d)\n", status);
return AVERROR_EXTERNAL;
}

av_log(avctx, AV_LOG_TRACE,
"Queued input buffer %zd size=%zd ts=%"PRIi64"\n", index, size, pts);
}
}



+ 1
- 0
libavcodec/mediacodecdec_common.h View File

@@ -36,6 +36,7 @@

typedef struct MediaCodecDecContext {

AVCodecContext *avctx;
atomic_int refcount;

char *codec_name;


Loading…
Cancel
Save