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);
171 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code) {
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;
266 if ((ret_value =
av_get_packet(pb, pkt, audio_length)) != audio_length) {
280 return read_frame(vid, pb, pkt, block_type, s);
288 av_log(s,
AV_LOG_ERROR,
"unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
289 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)
#define AV_LOG_WARNING
Something somehow does not look correct.
int64_t pos
byte position in stream, -1 if unknown
#define avpriv_request_sample(...)
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.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, buffer_size_t size)
int sample_rate
audio sample rate
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.
#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.
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...
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)
AVIOContext * pb
I/O context.
static int vid_probe(const AVProbeData *p)
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)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
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...
uint8_t palette[BVID_PALETTE_SIZE]
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)
Similar to feof() but also returns nonzero on read errors.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
#define AV_CH_LAYOUT_MONO
#define MKTAG(a, b, c, d)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.