36 #define MAX_AAC_HBR_FRAME_SIZE 8191
82 #define ATTR_NAME_TYPE_INT 0
83 #define ATTR_NAME_TYPE_STR 1
96 {INT32_MIN, INT32_MAX} },
103 {
NULL, -1, -1, {0} },
125 int au_headers_length, au_header_size,
i;
133 au_headers_length =
AV_RB16(buf);
138 data->au_headers_length_bytes = (au_headers_length + 7) / 8;
144 if (len < data->au_headers_length_bytes)
150 au_header_size =
data->sizelength +
data->indexlength;
151 if (au_header_size <= 0 || (au_headers_length % au_header_size != 0))
154 data->nb_au_headers = au_headers_length / au_header_size;
155 if (!
data->au_headers ||
data->au_headers_allocated <
data->nb_au_headers) {
158 if (!
data->au_headers)
160 data->au_headers_allocated =
data->nb_au_headers;
163 for (
i = 0;
i <
data->nb_au_headers; ++
i) {
182 if (
data->cur_au_index >
data->nb_au_headers) {
186 if (
data->buf_size -
data->buf_pos <
data->au_headers[
data->cur_au_index].size) {
195 data->buf_pos +=
data->au_headers[
data->cur_au_index].size;
197 data->cur_au_index++;
199 if (
data->cur_au_index ==
data->nb_au_headers) {
212 buf +=
data->au_headers_length_bytes + 2;
213 len -=
data->au_headers_length_bytes + 2;
214 if (
data->nb_au_headers == 1 && len < data->au_headers[0].size) {
217 if (!
data->buf_pos) {
223 data->buf_size =
data->au_headers[0].size;
224 data->timestamp = *timestamp;
227 if (
data->timestamp != *timestamp ||
228 data->au_headers[0].size !=
data->buf_size ||
242 if (
data->buf_pos !=
data->buf_size) {
261 if (len < data->au_headers[0].
size) {
270 len -=
data->au_headers[0].size;
271 buf +=
data->au_headers[0].size;
274 if (
len > 0 &&
data->nb_au_headers > 1) {
276 memcpy(
data->buf, buf,
data->buf_size);
277 data->cur_au_index = 1;
287 const char *attr,
const char *
value)
292 if (!strcmp(attr,
"config")) {
304 char *end_ptr =
NULL;
305 long long int val = strtoll(
value, &end_ptr, 10);
306 if (end_ptr ==
value || end_ptr[0] !=
'\0') {
308 "The %s field value is not a valid number: %s\n",
315 "fmtp field %s should be in range [%d,%d] (provided value: %lld)",
320 *(
int *)((
char *)
data+
326 *(
char **)((
char *)
data+
static double val(void *priv, double ch)
Macro definitions for various function/variable attributes.
#define flags(name, subs,...)
mode
Use these values in ebur128_init (or'ed).
bitstream reader API header.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
char * av_strdup(const char *s)
Duplicate a string.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
common internal API header
int ff_parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *p, int(*parse_fmtp)(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value))
#define RTP_MAX_PACKET_LENGTH
#define RTP_FLAG_MARKER
RTP marker bit was set for this packet.
static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
static int parse_fmtp_config(AVCodecParameters *par, const char *value)
#define ATTR_NAME_TYPE_INT
static void close_context(PayloadContext *data)
#define ATTR_NAME_TYPE_STR
static int parse_sdp_line(AVFormatContext *s, int st_index, PayloadContext *data, const char *line)
static int parse_fmtp(AVFormatContext *s, AVStream *stream, PayloadContext *data, const char *attr, const char *value)
const RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler
const RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler
static int rtp_parse_mp4_au(PayloadContext *data, const uint8_t *buf, int len)
#define MAX_AAC_HBR_FRAME_SIZE
static const AttrNameMap attr_names[]
This struct describes the properties of an encoded stream.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int index
stream index in AVFormatContext
Range for integer values.
struct AttrNameMap::Range range
RTP/JPEG specific private data.
int au_headers_length_bytes
uint32_t timestamp
current frame timestamp
uint8_t * buf
the temporary storage buffer
struct PayloadContext::AUHeaders * au_headers