Go to the documentation of this file.
23 #include "config_components.h"
34 const uint8_t **poutbuf,
int *poutbuf_size,
35 const uint8_t *buf,
int buf_size)
51 if(
s->remaining_size <= buf_size){
52 if(
s->remaining_size && !
s->need_next_header){
54 s->remaining_size = 0;
57 for(
i=
s->remaining_size;
i<buf_size;
i++){
58 s->state = (
s->state<<8) + buf[
i];
59 if((
len=
s->sync(
s->state, &
s->need_next_header, &new_frame_start)))
67 i-=
s->header_size -1;
68 s->remaining_size =
len;
69 if(!new_frame_start || pc->
index+
i<=0){
70 s->remaining_size +=
i;
74 s->remaining_size +=
i;
81 s->remaining_size -=
FFMIN(
s->remaining_size, buf_size);
89 *poutbuf_size = buf_size;
100 #if CONFIG_AC3_PARSER
109 while (buf_size > 0) {
112 if (ret < 0 || hdr.frame_size > buf_size)
148 #if CONFIG_AAC_PARSER
167 (bit_rate - avctx->
bit_rate) /
s->frame_number;
enum AVAudioServiceType audio_service_type
Type of service that the audio stream conveys.
int sample_rate
samples per second
int duration
Duration of the current frame.
#define AV_AAC_ADTS_HEADER_SIZE
enum AVChannelOrder order
Channel order used in this layout.
int nb_channels
Number of channels in this layout.
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
AVChannelLayout ch_layout
Audio channel layout.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
Initialize a native channel layout from a bitmask indicating which channels are present.
int ff_aac_ac3_parse(AVCodecParserContext *s1, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
int64_t bit_rate
the average bitrate
static unsigned int get_bits1(GetBitContext *s)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define PARSER_FLAG_COMPLETE_FRAMES
#define i(width, name, range_min, range_max)
int avpriv_ac3_parse_header(AC3HeaderInfo **phdr, const uint8_t *buf, size_t size)
int ff_ac3_find_syncword(const uint8_t *buf, int buf_size)
@ AV_AUDIO_SERVICE_TYPE_KARAOKE
main external API structure.
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
#define AV_PROFILE_AAC_USAC