36 #define VMD_HEADER_SIZE 0x0330
37 #define BYTES_PER_FRAME_RECORD 16
77 if ((!
w ||
w > 2048 || !
h ||
h > 2048) &&
90 unsigned int toc_offset;
91 unsigned char *raw_frame_table;
92 int raw_frame_table_size;
96 unsigned int total_frames;
123 vst->codecpar->codec_tag = 0;
124 vst->codecpar->width =
width;
125 vst->codecpar->height =
height;
126 if(vmd->
is_indeo3 && vst->codecpar->width > 320){
127 vst->codecpar->width >>= 1;
128 vst->codecpar->height >>= 1;
172 av_reduce(&num, &den, num, den, (1UL<<31)-1);
185 raw_frame_table =
NULL;
193 raw_frame_table =
av_malloc(raw_frame_table_size);
199 if (
avio_read(pb, raw_frame_table, raw_frame_table_size) !=
200 raw_frame_table_size) {
208 current_offset =
AV_RL32(&raw_frame_table[6 *
i + 2]);
223 if (
size > INT_MAX / 2) {
240 if(!current_audio_pts)
241 current_audio_pts += sound_buffers - 1;
256 current_offset +=
size;
301 if (ret !=
frame->frame_size) {
307 (
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_limit(AVIOContext *s, int size)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
audio channel layout utility functions
static int read_header(FFV1Context *f)
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_STEREO
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 AVCodec *c)
Add a new stream to a media file.
#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.
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 vmd_probe(const AVProbeData *p)
AVInputFormat ff_vmd_demuxer
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)
uint64_t channel_layout
Audio only.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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
Audio only.
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
Audio only.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
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.
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)