Go to the documentation of this file.
36 #define OPUS_SEEK_PREROLL_MS 80
37 #define OPUS_HEAD_SIZE 19
82 if (os->
psize < 8 || memcmp(packet,
"OpusTags", 8))
94 unsigned nb_frames = 1;
95 unsigned toc =
src[0];
96 unsigned toc_config = toc >> 3;
97 unsigned toc_count = toc & 3;
98 unsigned frame_size = toc_config < 12 ?
FFMAX(480, 960 * (toc_config & 3)) :
99 toc_config < 16 ? 480 << (toc_config & 1) :
100 120 << (toc_config & 3);
101 if (toc_count == 3) {
104 nb_frames =
src[1] & 0x3F;
105 }
else if (toc_count) {
123 if (os->
granule > (1LL << 62)) {
131 uint8_t *last_pkt = os->
buf + os->
pstart;
132 uint8_t *next_pkt = last_pkt;
142 last_pkt = next_pkt = next_pkt + os->
psize;
143 for (; seg < os->
nsegs; seg++) {
145 if (os->
segments[seg] < 255 && next_pkt != last_pkt) {
174 "Last packet was truncated to %d due to end trimming.\n",
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
AVStream ** streams
A list of all streams in the file.
int seek_preroll
Audio only.
int start_trimming
set the number of packets to drop from the start
int nb_channels
Number of channels in this layout.
#define OPUS_SEEK_PREROLL_MS
const struct ogg_codec ff_opus_codec
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVChannelLayout ch_layout
Audio only.
struct ogg_stream * streams
int sample_rate
Audio only.
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st, const uint8_t *buf, int size)
Parse Vorbis comments and add metadata to an AVStream.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int opus_packet(AVFormatContext *avf, int idx)
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
int end_trimming
set the number of packets to drop from the end
static int opus_duration(uint8_t *src, int size)
int initial_padding
Audio only.
void * priv_data
Format private data.
static int opus_header(AVFormatContext *avf, int idx)
static void BS_FUNC() skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.