Go to the documentation of this file.
37 #define BVID_PALETTE_SIZE 3 * 256
39 #define DEFAULT_SAMPLE_RATE 11111
102 #define BUFFER_PADDING_SIZE 1000
106 uint8_t * vidbuf_start =
NULL;
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;
288 block_type, block_type, block_type);
294 .
name =
"bethsoftvid",
#define AV_LOG_WARNING
Something somehow does not look correct.
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
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
enum AVMediaType codec_type
General type of the encoded data.
static int vid_read_header(AVFormatContext *s)
#define AVERROR_EOF
End of file.
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
#define AV_CHANNEL_LAYOUT_MONO
#define AV_LOG_VERBOSE
Detailed information.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define BUFFER_PADDING_SIZE
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define DEFAULT_SAMPLE_RATE
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
unsigned int avio_rl16(AVIOContext *s)
#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_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
int bethsoft_global_delay
delay value between frames, added to individual frame delay.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
int audio_index
audio stream index
This structure contains the data a format has to probe a file.
AVChannelLayout ch_layout
Audio only.
static int vid_probe(const AVProbeData *p)
int sample_rate
Audio only.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
static int vid_read_packet(AVFormatContext *s, AVPacket *pkt)
int avio_r8(AVIOContext *s)
int flags
A combination of AV_PKT_FLAG values.
int video_index
video stream index
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
uint8_t palette[BVID_PALETTE_SIZE]
@ AV_CODEC_ID_BETHSOFTVID
const AVInputFormat ff_bethsoftvid_demuxer
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int index
stream index in AVFormatContext
#define BVID_PALETTE_SIZE
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
#define avpriv_request_sample(...)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
int64_t pos
byte position in stream, -1 if unknown
int sample_rate
audio sample rate
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
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...
static int read_frame(BVID_DemuxContext *vid, AVIOContext *pb, AVPacket *pkt, uint8_t block_type, AVFormatContext *s)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.