[FFmpeg-soc] [soc] Add a new -debug for tracing get_buffer calls.

Michael Niedermayer michaelni at gmx.at
Tue Jul 15 14:30:48 CEST 2008


On Tue, Jul 15, 2008 at 04:19:20AM -0400, Alexander Strange wrote:
> ---
>  libavcodec/avcodec.h     |    1 +
>  libavcodec/framethread.c |    2 ++
>  libavcodec/utils.c       |    4 ++++
>  3 files changed, 7 insertions(+), 0 deletions(-)
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 71bf15a..80e7966 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1466,6 +1466,7 @@ typedef struct AVCodecContext {
>  #define FF_DEBUG_BUGS        0x00001000
>  #define FF_DEBUG_VIS_QP      0x00002000
>  #define FF_DEBUG_VIS_MB_TYPE 0x00004000
> +#define FF_DEBUG_BUFFER      0x00008000
>  
>      /**
>       * debug
> diff --git a/libavcodec/framethread.c b/libavcodec/framethread.c
> index 68cf784..03a89b2 100644
> --- a/libavcodec/framethread.c
> +++ b/libavcodec/framethread.c
> @@ -403,6 +403,8 @@ void ff_delayed_release_buffer(AVCodecContext *avctx, AVFrame *f)
>          return;
>      }
>  
> +    if(avctx->debug&FF_DEBUG_BUFFER) av_log(avctx, AV_LOG_DEBUG, "delayed_release_buffer called on pic %p, %d buffers used\n", f, f->avctx->internal_buffer_count);
> +

\n


>      p->released_buffers[p->nb_released_buffers++] = *f;
>      memset(f->data, 0, sizeof(f->data));
>  }
> \ No newline at end of file
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index 8ca024d..96ae448 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -282,6 +282,8 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
>      }
>      s->internal_buffer_count++;
>  
> +    if(s->debug&FF_DEBUG_BUFFER) av_log(s, AV_LOG_DEBUG, "get_buffer called on pic %p, %d buffers used\n", pic, s->internal_buffer_count);
> +

s/get_buffer/default_get_buffer/

and update of  AVOption options missing

And the parts of this that can be applied to main, can be if you want

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080715/2ccef387/attachment.pgp>


More information about the FFmpeg-soc mailing list