[libav-devel] [PATCH 0/9] avcodec_decode_audio4

Justin Ruggles justin.ruggles at gmail.com
Sat Nov 12 23:35:46 CET 2011


Here is my attempt at updating the audio decoders to use get_buffer().

For decoders, there are several advantages.

1) decoding will not fail because of a user-provided buffer being too small.

2) the arbitrary AVCODEC_MAX_AUDIO_FRAME_SIZE limit will be removed.

3) decoders which have workarounds to send correct decoded output
even with a small output buffer will no longer have to do so.

4) planar support will be easier to implement

5) decoder output will more closely match what is used by libavfilter

I have provided an example of the new API implementation in the pcm decoders.
The patches for the remaining decoders will be sent after the API has been
discussed and agreed upon.

Thanks,
Justin

Justin Ruggles (9):
  libavutil: add planar sample formats and av_sample_fmt_is_planar()
  libavutil: add utility functions to simplify allocation of audio
    buffers.
  Add avcodec_decode_audio4().
  avconv: use avcodec_decode_audio4() instead of
    avcodec_decode_audio3()
  avformat: use avcodec_decode_audio4() in avformat_find_stream_info()
  avplay: use a separate buffer for playing silence
  avplay: use avcodec_decode_audio4()
  api-example: update to use avcodec_decode_audio4()
  pcmdec: implement new audio decoding API

 avconv.c                 |   61 +++++++---------
 avplay.c                 |   47 +++++++-----
 doc/APIchanges           |   14 ++++
 libavcodec/api-example.c |   18 ++--
 libavcodec/avcodec.h     |  108 ++++++++++++++++++++++++++-
 libavcodec/pcm.c         |   42 ++++++----
 libavcodec/utils.c       |  186 +++++++++++++++++++++++++++++++++++++++++-----
 libavcodec/version.h     |    5 +-
 libavformat/utils.c      |   29 ++++----
 libavutil/avutil.h       |    2 +-
 libavutil/samplefmt.c    |  103 ++++++++++++++++++++++++-
 libavutil/samplefmt.h    |   79 +++++++++++++++++++
 12 files changed, 573 insertions(+), 121 deletions(-)



More information about the libav-devel mailing list