47 if ((br->
pos & 7) == 0)
53 return !!(br->
last & 0x80000000);
60 for (
int i = 0;
i < n;
i++) {
65 if (ret > INT_MAX - value - value)
67 value = 2 * value +
ret;
77 while ((ret =
pop(br, pb)) == 0)
96 value = (
data & 0x7F) << 7;
104 value = ((
data & 0x7F) | value) << 7;
106 if (!(
data & 0x80)) {
112 value = (((
data & 0x7F) | value) << 7) |
avio_r8(pb);
125 if (bytestream2_get_be16(&gb) != 0x4C32)
130 if (bytestream2_get_be16(&gb) == 0)
135 int type = bytestream2_get_byte(&gb);
136 int size = bytestream2_get_byte(&gb);
139 score += 5 * (size == 0);
142 if ((type == 1 && size == 12) ||
143 (type == 2 && size == 6) ||
144 (type == 3 && size == 13) ||
145 (type == 4 && size == 2))
172 int stream_index = -1;
286 int stream_index,
bits, pkt_size, endframe;
297 stream_index =
pop_int(br, pb, bits);
298 if (stream_index < 0)
303 endframe =
pop(br, pb);
315 pop_int(br, pb, bits * 2 + 26);
318 pkt_size =
pop_int(br, pb, 13) + 1;
319 if (pkt_size > m->
size)
330 if (endframe && packet->
size > 0) {
336 if (pkt->
data[0] & 0x80)
347 if (m->
flags % 2 == 0) {
388 .extensions =
"moflex",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ptrdiff_t const GLvoid * data
int64_t pos
byte position in stream, -1 if unknown
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
enum AVMediaType codec_type
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rb16(AVIOContext *s)
int ctx_flags
Flags signalling stream properties.
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 format(the sample packing is implied by the sample format) and sample rate.The lists are not just lists
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
Opaque data information usually continuous.
static int moflex_probe(const AVProbeData *p)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
GLsizei GLboolean const GLfloat * value
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
#define AVERROR_EOF
End of file.
static av_cold int read_close(AVFormatContext *ctx)
uint64_t avio_rb64(AVIOContext *s)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int moflex_read_header(AVFormatContext *s)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
static int moflex_read_close(AVFormatContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static int pop(BitReader *br, AVIOContext *pb)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
static int moflex_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
int flags
A combination of AV_PKT_FLAG values.
int avio_r8(AVIOContext *s)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
unsigned int avio_rb24(AVIOContext *s)
AVInputFormat ff_moflex_demuxer
static int read_header(FFV1Context *f)
static int moflex_read_sync(AVFormatContext *s)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
AVIOContext * pb
I/O context.
static int moflex_read_packet(AVFormatContext *s, AVPacket *pkt)
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
static int pop_length(BitReader *br, AVIOContext *pb)
static int pop_int(BitReader *br, AVIOContext *pb, int n)
#define flags(name, subs,...)
int sample_rate
Audio only.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int read_var_byte(AVFormatContext *s, unsigned *out)
void * priv_data
Format private data.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
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.