41#define BVID_PALETTE_SIZE 3 * 256
43#define DEFAULT_SAMPLE_RATE 11111
106#define BUFFER_PADDING_SIZE 1000
110 uint8_t * vidbuf_start =
NULL;
111 int vidbuf_nbytes = 0;
113 int bytes_copied = 0;
115 unsigned int vidbuf_capacity;
126 "having no audio packet before the first "
145 vidbuf_start[vidbuf_nbytes++] = block_type;
168 vidbuf_start[vidbuf_nbytes++] =
code;
172 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
177 vidbuf_nbytes +=
code;
179 bytes_copied +=
code & 0x7F;
180 if(bytes_copied == npixels){
186 if (bytes_copied > npixels) {
195 memcpy(
pkt->data, vidbuf_start, vidbuf_nbytes);
227 unsigned char block_type;
275 pkt->duration = audio_length;
291 block_type, block_type, block_type);
297 .p.name =
"bethsoftvid",
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
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.
unsigned int avio_rl16(AVIOContext *s)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int avio_r8(AVIOContext *s)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt, uint8_t block_type, AVFormatContext *s)
static int vid_probe(const AVProbeData *p)
static int vid_read_packet(AVFormatContext *s, AVPacket *pkt)
static int vid_read_header(AVFormatContext *s)
#define DEFAULT_SAMPLE_RATE
#define BVID_PALETTE_SIZE
#define BUFFER_PADDING_SIZE
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_CODEC_ID_BETHSOFTVID
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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.
#define AV_CHANNEL_LAYOUT_MONO
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
Macro definitions for various function/variable attributes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKTAG(a, b, c, d)
Memory handling functions.
An AVChannelLayout holds information about the channel layout of audio data.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
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.
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 start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
int video_index
video stream index
int sample_rate
audio sample rate
int audio_index
audio stream index
uint8_t palette[BVID_PALETTE_SIZE]
int bethsoft_global_delay
delay value between frames, added to individual frame delay.
#define avpriv_request_sample(...)