On 4/26/2017 2:02 PM, Diego Biurrun wrote:
> This makes the currently semi-public avpriv_aac_parse_header() function
> private to libavcodec and adds a proper public API function to return
> the parts of the ADTS header required in libavformat.
> ---
>
> This eliminates one more ABI issue with the new bitstream reader.
>
> configure | 8 ++-
> doc/developer.texi | 2 +-
> libavcodec/Makefile | 15 +++---
> libavcodec/aac_adtstoasc_bsf.c | 5 +-
> libavcodec/aac_parser.c | 3 +-
> libavcodec/{aacadtsdec.c => aacadts_header.c} | 4 +-
> libavcodec/{aacadtsdec.h => aacadts_header.h} | 9 ++--
> libavcodec/aacadtsdec.c | 71
> +++++++++------------------
> libavcodec/aacadtsdec.h | 29 +++--------
> libavcodec/aacdec.c | 4 +-
> libavformat/spdifdec.c | 22 +++++----
> libavformat/spdifenc.c | 15 +++---
> 12 files changed, 79 insertions(+), 108 deletions(-)
> copy libavcodec/{aacadtsdec.c => aacadts_header.c} (96%)
> copy libavcodec/{aacadtsdec.h => aacadts_header.h} (90%)
>
[...]
> diff --git a/libavcodec/aacadtsdec.h b/libavcodec/aacadtsdec.h
> index 6319efc..5d601c2 100644
> --- a/libavcodec/aacadtsdec.h
> +++ b/libavcodec/aacadtsdec.h
This has become an adts parser header. Maybe the name should reflect
that, especially now that it will be installed.
It would be more in line with ac3_parser.h and vorbis_parser.h as well.
> @@ -23,32 +23,19 @@
> #ifndef AVCODEC_AACADTSDEC_H
> #define AVCODEC_AACADTSDEC_H
>
> +#include <stddef.h>
> #include <stdint.h>
> -#include "get_bits.h"
>
> #define AAC_ADTS_HEADER_SIZE 7
>
> -typedef struct AACADTSHeaderInfo {
> - uint32_t sample_rate;
> - uint32_t samples;
> - uint32_t bit_rate;
> - uint8_t crc_absent;
> - uint8_t object_type;
> - uint8_t sampling_index;
> - uint8_t chan_config;
> - uint8_t num_aac_frames;
> -} AACADTSHeaderInfo;
> -
> /**
> - * Parse AAC frame header.
> - * Parse the ADTS frame header to the end of the variable header, which is
> - * the first 54 bits.
> - * @param[in] gbc BitContext containing the first 54 bits of the frame.
> - * @param[out] hdr Pointer to struct where header info is written.
> - * @return Returns 0 on success, -1 if there is a sync word mismatch,
> - * -2 if the version element is invalid, -3 if the sample rate
> - * element is invalid, or -4 if the bit rate element is invalid.
> + * Extract the number of samples and frames from AAC data.
> + * @param[in] buf pointer to AAC data buffer
> + * @param[out] samples Pointer to where number of samples is written
> + * @param[out] frames Pointer to where number of frames is written
> + * @return Returns 0 on success, error code on failure.
> */
> -int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr);
> +int av_aacadts_header_parse(const uint8_t *buf, uint32_t *samples,
Why change it to _header_parse()? AC3's parse function was left as
_parse_header() when it was made public. Better keep it consistent.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel