36 #define BVID_PALETTE_SIZE 3 * 256 38 #define DEFAULT_SAMPLE_RATE 11111 95 #define BUFFER_PADDING_SIZE 1000 100 int vidbuf_nbytes = 0;
102 int bytes_copied = 0;
104 unsigned int vidbuf_capacity;
115 "having no audio packet before the first " 134 vidbuf_start[vidbuf_nbytes++] = block_type;
141 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2) {
154 vidbuf_start[vidbuf_nbytes++] = code;
158 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
160 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code) {
164 vidbuf_nbytes += code;
166 bytes_copied += code & 0x7F;
167 if(bytes_copied == npixels){
173 if (bytes_copied > npixels) {
182 memcpy(pkt->
data, vidbuf_start, vidbuf_nbytes);
215 unsigned char block_type;
259 if ((ret_value =
av_get_packet(pb, pkt, audio_length)) != audio_length) {
273 return read_frame(vid, pb, pkt, block_type, s);
281 av_log(s,
AV_LOG_ERROR,
"unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
282 block_type, block_type, block_type);
295 .
name =
"bethsoftvid",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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)
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t pos
byte position in stream, -1 if unknown
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int ctx_flags
Flags signalling stream properties.
int sample_rate
audio sample rate
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define BVID_PALETTE_SIZE
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
static av_cold int read_close(AVFormatContext *ctx)
#define AV_LOG_VERBOSE
Detailed information.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
uint64_t channel_layout
Audio only.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#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.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
#define DEFAULT_SAMPLE_RATE
int video_index
video stream index
int flags
A combination of AV_PKT_FLAG values.
#define BUFFER_PADDING_SIZE
int avio_r8(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVInputFormat ff_bethsoftvid_demuxer
audio channel layout utility functions
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.
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int vid_read_close(AVFormatContext *s)
AVIOContext * pb
I/O context.
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)
int sample_rate
Audio only.
unsigned int avio_rl16(AVIOContext *s)
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
void * priv_data
Format private data.
static int vid_read_packet(AVFormatContext *s, AVPacket *pkt)
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
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
#define MKTAG(a, b, c, d)
This structure stores compressed data.