49 if ((br->
pos & 7) == 0)
55 return !!(br->
last & 0x80000000);
62 for (
int i = 0;
i < n;
i++) {
63 int ret =
pop(br, pb);
79 while ((ret =
pop(br, pb)) == 0)
100 if (!(
data & 0x80)) {
108 if (!(
data & 0x80)) {
127 if (bytestream2_get_be16(&gb) != 0x4C32)
132 if (bytestream2_get_be16(&gb) == 0)
137 int type = bytestream2_get_byte(&gb);
138 int size = bytestream2_get_byte(&gb);
141 score += 5 * (
size == 0);
174 int stream_index = -1;
225 if (stream_index ==
s->nb_streams) {
284 int stream_index,
bits, pkt_size, endframe;
296 if (stream_index < 0)
298 if (stream_index >=
s->nb_streams)
301 endframe =
pop(br, pb);
316 pkt_size =
pop_int(br, pb, 13) + 1;
317 if (pkt_size > m->
size)
319 packet =
s->streams[stream_index]->priv_data;
328 if (endframe && packet->
size > 0) {
345 if (m->
flags % 2 == 0) {
367 for (
int i = 0;
i <
s->nb_streams;
i++) {
371 s->streams[
i]->priv_data = 0;
386 .extensions =
"moflex",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
uint64_t avio_rb64(AVIOContext *s)
unsigned int avio_rb16(AVIOContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rb24(AVIOContext *s)
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define flags(name, subs,...)
static int read_header(FFV1Context *f)
@ AV_CODEC_ID_ADPCM_IMA_MOFLEX
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static AVRational av_make_q(int num, int den)
Create an AVRational.
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static av_cold int read_close(AVFormatContext *ctx)
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
static int moflex_read_sync(AVFormatContext *s)
static int pop_int(BitReader *br, AVIOContext *pb, int n)
static int pop(BitReader *br, AVIOContext *pb)
static int read_var_byte(AVFormatContext *s, unsigned *out)
static int moflex_probe(const AVProbeData *p)
static int moflex_read_close(AVFormatContext *s)
static int moflex_read_packet(AVFormatContext *s, AVPacket *pkt)
static int pop_length(BitReader *br, AVIOContext *pb)
AVInputFormat ff_moflex_demuxer
static int moflex_read_header(AVFormatContext *s)
static int moflex_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
enum AVMediaType codec_type
enum AVMediaType codec_type
General type of the encoded data.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pos
byte position in stream, -1 if unknown
This structure contains the data a format has to probe a file.
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.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.