55 res = AVIFileOpen(&avs->
file, s->
filename, OF_READ|OF_SHARE_DENY_WRITE,
NULL);
63 res = AVIFileInfo(avs->
file, &info,
sizeof(info));
73 for (
id=0;
id<info.dwStreams;
id++)
77 if (AVIFileGetStream(avs->
file, &stream->
handle, 0,
id) == S_OK)
79 if (AVIStreamInfo(stream->
handle, &stream->
info,
sizeof(stream->
info)) == S_OK)
81 if (stream->
info.fccType == streamtypeAUDIO)
84 LONG struct_size =
sizeof(WAVEFORMATEX);
85 if (AVIStreamReadFormat(stream->
handle, 0, &wvfmt, &struct_size) != S_OK)
98 stream->
chunck_samples = wvfmt.nSamplesPerSec * (uint64_t)info.dwScale / (uint64_t)info.dwRate;
104 else if (stream->
info.fccType == streamtypeVIDEO)
107 LONG struct_size =
sizeof(BITMAPINFO);
112 if (AVIStreamReadFormat(stream->
handle, 0, &imgfmt, &struct_size) != S_OK)
125 st->
codec->
bit_rate = (uint64_t)stream->
info.dwSampleSize * (uint64_t)stream->
info.dwRate * 8 / (uint64_t)stream->
info.dwScale;
133 AVIStreamRelease(stream->
handle);
159 stream = &avs->
streams[stream_id];
161 if (stream->
read >= stream->
info.dwLength)
172 pkt->
size = read_size;
181 return (res == S_OK) ? pkt->
size : -1;
195 AVIFileRelease(avs->
file);
205 for (stream_id = 0; stream_id < avs->
nb_streams; stream_id++)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
unsigned int stream_codec_tag
fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A')...
static int avisynth_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flags)
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
int id
format-specific stream ID
static int read_header(FFV1Context *f)
static av_cold int read_close(AVFormatContext *ctx)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
AVStream * avformat_new_stream(AVFormatContext *s, AVCodec *c)
Add a new stream to a media file.
AVInputFormat ff_avisynth_demuxer
AVCodecContext * codec
codec context
static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt)
int bit_rate
the average bitrate
char filename[1024]
input or output filename
const AVCodecTag ff_codec_bmp_tags[]
int width
picture width / height.
internal header for RIFF based (de)muxers do NOT include this in end user applications ...
enum AVMediaType codec_type
int sample_rate
samples per second
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int64_t duration
Decoding: duration of the stream, in stream time base.
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
static int avisynth_read_close(AVFormatContext *s)
static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
int channels
number of audio channels
void * priv_data
Format private data.
enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps)
enum AVDiscard discard
Selects which packets can be discarded at will and do not need to be demuxed.
AVRational r_frame_rate
Real base framerate of the stream.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...