29 #define ADTS_HEADER_SIZE 7
33 int max_frames = 0, first_frames = 0;
42 for (; buf <
end; buf = buf2 + 1) {
45 for (frames = 0; buf2 <
end; frames++) {
47 if ((header & 0xFFF6) != 0xFFF0) {
57 fsize = (
AV_RB32(buf2 + 3) >> 13) & 0x1FFF;
60 fsize =
FFMIN(fsize, end - buf2);
63 max_frames =
FFMAX(max_frames, frames);
68 if (first_frames >= 3)
70 else if (max_frames > 100)
72 else if (max_frames >= 3)
74 else if (first_frames >= 1)
105 if ((state >> 4) != 0xFFF)
110 if ((state >> 4) != 0xFFF)
157 .mime_type =
"audio/aac,audio/aacp,audio/x-aac",
int64_t probesize
Maximum size of the data read from input for determining the input container format.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
void ff_id3v1_read(AVFormatContext *s)
Read an ID3v1 tag.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
static av_cold int end(AVCodecContext *avctx)
enum AVStreamParseType need_parsing
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static const uint8_t header[24]
AVDictionary * metadata
Metadata that applies to the whole file.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
int64_t ff_ape_parse_tag(AVFormatContext *s)
Read and parse an APE tag.
int avio_r8(AVIOContext *s)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
This structure contains the data a format has to probe a file.
struct AVInputFormat * iformat
The input container format.
#define AV_DICT_IGNORE_SUFFIX
Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string.
AVCodecParameters * codecpar
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
static int64_t fsize(FILE *f)
This structure stores compressed data.