48 const unsigned char *buf = p->buf;
49 unsigned c, length = 0;
60 length = (length << 7) | (
c & 0x7F);
62 if (
c & 0x80 || length > 1024 || length < 21)
66 if (memcmp(buf,
"Version:Vivo/", 13))
70 if (*buf <
'0' || *buf >
'2')
80 unsigned c, get_length = 0;
95 case 0: get_length = 1;
break;
96 case 1: vivo->
length = 128;
break;
97 case 2: get_length = 1;
break;
98 case 3: vivo->
length = 40;
break;
99 case 4: vivo->
length = 24;
break;
148 if (vivo->
length <= 1024) {
159 line_end = strstr(
line,
"\r\n");
181 value_int = strtol(
value, &end_value, 10);
183 if (*end_value == 0) {
186 if (!strcmp(
key,
"Duration")) {
188 }
else if (!strcmp(
key,
"Width")) {
190 }
else if (!strcmp(
key,
"Height")) {
192 }
else if (!strcmp(
key,
"TimeUnitNumerator")) {
193 fps.
num = value_int / 1000;
194 }
else if (!strcmp(
key,
"TimeUnitDenominator")) {
196 }
else if (!strcmp(
key,
"SamplingFrequency")) {
198 }
else if (!strcmp(
key,
"NominalBitrate")) {
199 }
else if (!strcmp(
key,
"Length")) {
206 if (!strcmp(
key,
"Version")) {
210 }
else if (!strcmp(
key,
"FPS")) {
262 unsigned old_sequence = vivo->
sequence, old_type = vivo->
type;
263 int stream_index,
duration, ret = 0;
270 switch (vivo->
type) {
298 while (vivo->
sequence == old_sequence &&
299 (((vivo->
type - 1) >> 1) == ((old_type - 1) >> 1))) {
312 pkt->stream_index = stream_index;
321 .p.extensions =
"viv",
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int av_sscanf(const char *string, const char *format,...)
static int read_probe(const AVProbeData *p)
static int read_header(FFV1Context *f, RangeCoder *c)
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int nb_channels
Number of channels in this layout.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
static int vivo_read_header(AVFormatContext *s)
static int vivo_read_packet(AVFormatContext *s, AVPacket *pkt)
static int vivo_probe(const AVProbeData *p)
static int vivo_get_packet_header(AVFormatContext *s)