46 const unsigned char *buf = p->
buf;
58 length = (length << 7) | (c & 0x7F);
60 if (c & 0x80 || length > 1024 || length < 21)
64 if (memcmp(buf,
"Version:Vivo/", 13))
68 if (*buf < '0' || *buf >
'2')
78 unsigned c, get_length = 0;
93 case 0: get_length = 1;
break;
94 case 1: vivo->
length = 128;
break;
95 case 2: get_length = 1;
break;
96 case 3: vivo->
length = 40;
break;
97 case 4: vivo->
length = 24;
break;
146 if (vivo->
length <= 1024) {
157 line_end = strstr(line,
"\r\n");
168 value = strchr(key,
':');
179 value_int = strtol(value, &end_value, 10);
181 if (*end_value == 0) {
184 if (!strcmp(key,
"Duration")) {
185 duration = value_int;
186 }
else if (!strcmp(key,
"Width")) {
188 }
else if (!strcmp(key,
"Height")) {
190 }
else if (!strcmp(key,
"TimeUnitNumerator")) {
191 fps.
num = value_int / 1000;
192 }
else if (!strcmp(key,
"TimeUnitDenominator")) {
194 }
else if (!strcmp(key,
"SamplingFrequency")) {
196 }
else if (!strcmp(key,
"NominalBitrate")) {
197 }
else if (!strcmp(key,
"Length")) {
204 if (!strcmp(key,
"Version")) {
205 if (sscanf(value,
"Vivo/%d.", &vivo->
version) != 1)
208 }
else if (!strcmp(key,
"FPS")) {
256 unsigned old_sequence = vivo->
sequence, old_type = vivo->
type;
264 switch (vivo->
type) {
292 while (vivo->
sequence == old_sequence &&
293 (((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.
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int vivo_read_header(AVFormatContext *s)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
GLsizei GLboolean const GLfloat * value
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 avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#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.
enum AVMediaType codec_type
General type of the encoded data.
int avio_r8(AVIOContext *s)
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 block_align
Audio only.
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
static int vivo_probe(const AVProbeData *p)
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int vivo_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIOContext * pb
I/O context.
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 (pair of numerator and 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.
int sample_rate
Audio only.
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
void * priv_data
Format private data.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
int64_t duration
Duration of the stream, in AV_TIME_BASE fractional seconds.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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
This structure stores compressed data.