37 #define BVID_PALETTE_SIZE 3 * 256
39 #define DEFAULT_SAMPLE_RATE 11111
102 #define BUFFER_PADDING_SIZE 1000
107 int vidbuf_nbytes = 0;
109 int bytes_copied = 0;
111 unsigned int vidbuf_capacity;
122 "having no audio packet before the first "
141 vidbuf_start[vidbuf_nbytes++] = block_type;
148 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2) {
165 vidbuf_start[vidbuf_nbytes++] =
code;
169 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
175 vidbuf_nbytes +=
code;
177 bytes_copied +=
code & 0x7F;
178 if(bytes_copied == npixels){
184 if (bytes_copied > npixels) {
193 memcpy(
pkt->
data, vidbuf_start, vidbuf_nbytes);
225 unsigned char block_type;
289 block_type, block_type, block_type);
295 .
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_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t 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)
AVInputFormat ff_bethsoftvid_demuxer
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
audio channel layout utility functions
#define MKTAG(a, b, c, d)
static int read_header(FFV1Context *f)
#define AV_CH_LAYOUT_MONO
@ AV_CODEC_ID_BETHSOFTVID
#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.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
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_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...
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
Audio only.
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int64_t pos
byte position in stream, -1 if unknown
This structure contains the data a format has to probe a file.
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 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(...)