35 #define OPUS_HEAD_SIZE 19
64 memcpy(extradata, packet, os->
psize);
75 if (os->
psize < 8 || memcmp(packet,
"OpusTags", 8))
92 unsigned toc, toc_config, toc_count,
frame_size, nb_frames = 1;
98 toc_config = toc >> 3;
100 frame_size = toc_config < 12 ?
FFMAX(480, 960 * (toc_config & 3)) :
101 toc_config < 16 ? 480 << (toc_config & 1) :
102 120 << (toc_config & 3);
103 if (toc_count == 3) {
106 nb_frames = packet[1] & 0x3F;
107 }
else if (toc_count) {
125 "Last packet is truncated to %d (because of unimplemented end trim support).\n",
140 .granule_is_start = 1,
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
static int opus_header(AVFormatContext *avf, int idx)
static int opus_packet(AVFormatContext *avf, int idx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size)
static const uint8_t frame_size[4]
void av_log(void *avcl, int level, const char *fmt,...)
AVCodecContext * codec
Codec context associated with this stream.
struct ogg_stream * streams
enum AVMediaType codec_type
int sample_rate
samples per second
const struct ogg_codec ff_opus_codec
#define FF_INPUT_BUFFER_PADDING_SIZE
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
#define AVERROR_INVALIDDATA
#define AVERROR_PATCHWELCOME
int channels
number of audio channels
void * priv_data
Format private data.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...