24 #include "libavutil/intreadwrite.h"
35 #define OPUS_HEAD_SIZE 19
74 if (os->
psize < 8 || memcmp(packet,
"OpusTags", 8))
91 unsigned toc, toc_config, toc_count,
frame_size, nb_frames = 1;
97 toc_config = toc >> 3;
99 frame_size = toc_config < 12 ?
FFMAX(480, 960 * (toc_config & 3)) :
100 toc_config < 16 ? 480 << (toc_config & 1) :
101 120 << (toc_config & 3);
102 if (toc_count == 3) {
105 nb_frames = packet[1] & 0x3F;
106 }
else if (toc_count) {
125 "Last packet was truncated to %d due to end trimming.\n",
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
AVCodecContext * codec
Codec context associated with this stream.
static int opus_header(AVFormatContext *avf, int idx)
struct ogg_codec ff_opus_codec
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static int opus_packet(AVFormatContext *avf, int idx)
int end_trimming
set the number of packets to drop from the end
int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, const uint8_t *buf, int size)
static const uint8_t frame_size[4]
void * priv_data
Format private data.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
struct ogg_stream * streams
enum AVMediaType codec_type
int sample_rate
samples per second
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
#define AVERROR_INVALIDDATA
int channels
number of audio channels
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...