45 const unsigned char *
buf = p->
buf;
57 length = (length << 7) | (c & 0x7F);
59 if (c & 0x80 || length > 1024 || length < 21)
62 if (memcmp(buf,
"\r\nVersion:Vivo/", 15))
66 if (*buf < '0' && *buf >
'2')
76 unsigned c, get_length = 0;
91 case 0: get_length = 1;
break;
92 case 1: vivo->
length = 128;
break;
93 case 2: get_length = 1;
break;
94 case 3: vivo->
length = 40;
break;
95 case 4: vivo->
length = 24;
break;
123 unsigned char *
line, *line_end, *key, *
value;
144 if (vivo->
length <= 1024) {
155 line_end = strstr(line,
"\r\n");
166 value = strchr(key,
':');
177 value_int = strtol(value, &end_value, 10);
179 if (*end_value == 0) {
182 if (!strcmp(key,
"Duration")) {
183 duration = value_int;
184 }
else if (!strcmp(key,
"Width")) {
186 }
else if (!strcmp(key,
"Height")) {
188 }
else if (!strcmp(key,
"TimeUnitNumerator")) {
189 fps.
num = value_int / 1000;
190 }
else if (!strcmp(key,
"TimeUnitDenominator")) {
192 }
else if (!strcmp(key,
"SamplingFrequency")) {
194 }
else if (!strcmp(key,
"NominalBitrate")) {
195 }
else if (!strcmp(key,
"Length")) {
202 if (!strcmp(key,
"Version")) {
203 if (sscanf(value,
"Vivo/%d.", &vivo->
version) != 1)
206 }
else if (!strcmp(key,
"FPS")) {
248 unsigned old_sequence = vivo->
sequence, old_type = vivo->
type;
249 int stream_index, ret = 0;
256 switch (vivo->
type) {
282 while (vivo->
sequence == old_sequence &&
283 (((vivo->
type - 1) >> 1) == ((old_type - 1) >> 1))) {
int av_parse_ratio(AVRational *q, const char *str, int max, int log_offset, void *log_ctx)
Parse str and store the parsed ratio in q.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_free_packet(AVPacket *pkt)
Free a packet.
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int vivo_read_header(AVFormatContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVInputFormat ff_vivo_demuxer
#define AVERROR_EOF
End of file.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static int vivo_get_packet_header(AVFormatContext *s)
int bit_rate
the average bitrate
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
int width
picture width / height.
GLsizei GLboolean const GLfloat * value
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
static int vivo_read_packet(AVFormatContext *s, AVPacket *pkt)
int sample_rate
samples per second
AVIOContext * pb
I/O context.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
rational number numerator/denominator
This structure contains the data a format has to probe a file.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static int vivo_probe(AVProbeData *p)
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
int channels
number of audio channels
void * priv_data
Format private data.
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
This structure stores compressed data.