36 #define BVID_PALETTE_SIZE 3 * 256
38 #define DEFAULT_SAMPLE_RATE 11111
92 #define BUFFER_PADDING_SIZE 1000
97 int vidbuf_nbytes = 0;
101 unsigned int vidbuf_capacity;
112 "packet. Using default video time base.\n");
130 vidbuf_start[vidbuf_nbytes++] = block_type;
137 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2) {
150 vidbuf_start[vidbuf_nbytes++] = code;
154 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
156 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code) {
160 vidbuf_nbytes += code;
162 bytes_copied += code & 0x7F;
163 if(bytes_copied == npixels){
169 if (bytes_copied > npixels) {
178 memcpy(pkt->
data, vidbuf_start, vidbuf_nbytes);
207 unsigned char block_type;
251 if ((ret_value =
av_get_packet(pb, pkt, audio_length)) != audio_length) {
265 return read_frame(vid, pb, pkt, block_type, s);
273 av_log(s,
AV_LOG_ERROR,
"unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
274 block_type, block_type, block_type);
287 .
name =
"bethsoftvid",
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int bethsoft_global_delay
delay value between frames, added to individual frame delay.
static int vid_read_header(AVFormatContext *s)
static int vid_probe(AVProbeData *p)
int64_t pos
byte position in stream, -1 if unknown
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int ctx_flags
Format-specific flags, see AVFMTCTX_xx.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int sample_rate
audio sample rate
#define BVID_PALETTE_SIZE
static av_cold int read_close(AVFormatContext *ctx)
#define MKTAG(a, b, c, d)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void av_log_ask_for_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message asking for a sample.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
#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.
struct BVID_DemuxContext BVID_DemuxContext
#define DEFAULT_SAMPLE_RATE
int video_index
video stream index
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
#define BUFFER_PADDING_SIZE
int avio_r8(AVIOContext *s)
AVCodecContext * codec
Codec context associated with this stream.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVInputFormat ff_bethsoftvid_demuxer
int bit_rate
the average bitrate
audio channel layout utility functions
int width
picture width / height.
static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
static int read_header(FFV1Context *f)
static int vid_read_close(AVFormatContext *s)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int audio_index
audio stream index
This structure contains the data a format has to probe a file.
static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt, uint8_t block_type, AVFormatContext *s)
unsigned int avio_rl16(AVIOContext *s)
int64_t start_time
Decoding: pts of the first frame of the stream, in stream time base.
#define AVERROR_INVALIDDATA
#define AVPROBE_SCORE_MAX
#define AVFMTCTX_NOHEADER
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
static int vid_read_packet(AVFormatContext *s, AVPacket *pkt)
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.