57 uint64_t
size = 1 + thp->
len[0] / 255 + 1 + thp->
len[1] / 255 + 1 +
58 (uint64_t)thp->
len[0] + thp->
len[1] + thp->
len[2];
73 for (
int i = 0;
i < 3;
i++) {
113 "Too old or unsupported Theora (%x)\n", thp->
version);
123 if (thp->
version >= 0x030200) {
137 if (!(timebase.
num > 0 && timebase.
den > 0)) {
201 uint64_t iframe, pframe;
207 pframe = gp & thp->
gpmask;
216 *dts = iframe + pframe;
218 return iframe + pframe;
241 error =
"data packet before the setup header";
245 error =
"identification header before the setup header";
249 error =
"comment header without identification header";
253 error =
"setup header without comment header";
259 "Invalid chained stream headers: %s, discarding them\n",
error);
262 for (
int i = 0;
i < 3;
i++)
271 struct ogg *
ogg =
s->priv_data;
327 for (seg = os->
segp; seg < os->
nsegs; seg++) {
337 s->streams[idx]->start_time = os->
lastpts;
338 if (
s->streams[idx]->duration > 0)
339 s->streams[idx]->duration =
av_sat_sub64(
s->streams[idx]->duration,
s->streams[idx]->start_time);
353 struct ogg *
ogg =
s->priv_data;
357 for (
int i = 0;
i < 3;
i++)
362 .magic =
"\200theora",
static AVFormatContext * ctx
#define i(width, name, range_min, range_max)
unsigned int av_xiphlacing(unsigned char *s, unsigned int v)
Encode extradata length to a buffer.
bitstream reader API header.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reallocp(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory through a pointer to a pointer.
#define AV_NOPTS_VALUE
Undefined timestamp value.
Macro definitions for various function/variable attributes.
int ff_vorbis_update_metadata(AVFormatContext *s, AVStream *st, const uint8_t *buf, int size)
Parse Vorbis comments, add metadata to an AVStream.
const struct ogg_codec ff_theora_codec
Memory handling functions.
int extradata_size
Size of the extradata content in bytes.
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
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).
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
enum AVStreamParseType need_parsing
uint8_t * packet[3]
headers of the link, until all three are in
enum TheoraPacketType last_packet
type of the last packet seen by theora_packet()
Copyright (C) 2005 Michael Ahlberg, Måns Rullgård.
size_t new_extradata_size
struct ogg_stream * streams
static void error(const char *err)
static int theora_packet(AVFormatContext *s, int idx)
static enum TheoraPacketType theora_packet_type(const struct ogg_stream *os)
static uint64_t theora_gptopts(AVFormatContext *ctx, int idx, uint64_t gp, int64_t *dts)
static int theora_pack_headers(TheoraParams *thp, uint8_t **buf)
Pack the three headers of a link with Xiph lacing, which carries headers of any size,...
static int theora_check_packet_order(AVFormatContext *s, TheoraParams *thp, enum TheoraPacketType type)
static void theora_cleanup(AVFormatContext *s, int idx)
TheoraPacketType
Copyright (C) 2005 Matthieu CASTET, Alex Beregszaszi.
static int theora_header(AVFormatContext *s, int idx)