39#define VMD_HEADER_SIZE 0x0330
40#define BYTES_PER_FRAME_RECORD 16
69 int w,
h, sample_rate;
70 if (p->buf_size < 806)
78 sample_rate =
AV_RL16(&p->buf[804]);
79 if ((!
w ||
w > 2048 || !
h ||
h > 2048) &&
92 unsigned int toc_offset;
93 unsigned char *raw_frame_table;
94 int raw_frame_table_size;
98 unsigned int total_frames;
125 vst->codecpar->codec_tag = 0;
126 vst->codecpar->width =
width;
127 vst->codecpar->height =
height;
128 if(vmd->
is_indeo3 && vst->codecpar->width > 320){
129 vst->codecpar->width >>= 1;
130 vst->codecpar->height >>= 1;
173 av_reduce(&num, &den, num, den, (1UL<<31)-1);
186 raw_frame_table =
NULL;
190 raw_frame_table =
av_malloc(raw_frame_table_size);
196 if ((ret =
ffio_read_size(pb, raw_frame_table, raw_frame_table_size)) < 0)
202 current_offset =
AV_RL32(&raw_frame_table[6 *
i + 2]);
217 if (
size > INT_MAX / 2) {
234 if(!current_audio_pts)
235 current_audio_pts += sound_buffers - 1;
250 current_offset +=
size;
292 pkt->stream_index =
frame->stream_index;
295 (
frame->frame_record[0] == 0x02) ?
"video" :
"audio",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int ffio_limit(AVIOContext *s, int size)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
static int read_header(FFV1Context *f, RangeCoder *c)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
#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_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#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)
Memory handling functions.
static int vmd_probe(const AVProbeData *p)
static int vmd_read_packet(AVFormatContext *s, AVPacket *pkt)
#define BYTES_PER_FRAME_RECORD
static int vmd_read_close(AVFormatContext *s)
static int vmd_read_header(AVFormatContext *s)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
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.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int index
stream index in AVFormatContext
int64_t audio_sample_counter
unsigned int current_frame
unsigned int frames_per_block
unsigned char vmd_header[VMD_HEADER_SIZE]
unsigned char frame_record[BYTES_PER_FRAME_RECORD]
#define av_malloc_array(a, b)
static void error(const char *err)