Go to the documentation of this file.
58 if (
d[0] ==
'w' &&
d[1] ==
'W' &&
d[2] == 0x10 &&
d[3] == 0)
68 AvsFormat *avs =
s->priv_data;
78 avs->remaining_frame_size = 0;
79 avs->remaining_audio_size = 0;
81 avs->st_video = avs->st_audio =
NULL;
83 if (avs->width != 318 || avs->height != 198)
85 "when the avs format is supposed to be 318x198 only.\n",
86 avs->width, avs->height);
94 uint8_t * palette,
int palette_size)
96 AvsFormat *avs =
s->priv_data;
106 pkt->
data[2] = palette_size & 0xFF;
107 pkt->
data[3] = (palette_size >> 8) & 0xFF;
108 memcpy(
pkt->
data + 4, palette, palette_size - 4);
111 pkt->
data[palette_size + 0] = sub_type;
130 AvsFormat *avs =
s->priv_data;
137 avs->remaining_audio_size -=
size;
152 AvsFormat *avs =
s->priv_data;
153 int sub_type = 0,
size = 0;
155 int palette_size = 0;
156 uint8_t palette[4 + 3 * 256];
159 if (avs->remaining_audio_size > 0)
164 if (avs->remaining_frame_size <= 0) {
167 avs->remaining_frame_size =
avio_rl16(
s->pb) - 4;
170 while (avs->remaining_frame_size > 0) {
176 avs->remaining_frame_size -=
size;
180 if (
size - 4 >
sizeof(palette))
189 if (!avs->st_video) {
195 avs->st_video->codecpar->width = avs->width;
196 avs->st_video->codecpar->height = avs->height;
197 avs->st_video->codecpar->bits_per_coded_sample=avs->bits_per_sample;
198 avs->st_video->nb_frames = avs->nb_frames;
199 #if FF_API_R_FRAME_RATE
200 avs->st_video->r_frame_rate =
202 avs->st_video->avg_frame_rate = (
AVRational){avs->fps, 1};
205 palette, palette_size);
208 if (!avs->st_audio) {
214 avs->remaining_audio_size =
size - 4;
230 .priv_data_size =
sizeof(AvsFormat),
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.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
unsigned int avio_rl16(AVIOContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static int read_header(FFV1Context *f)
Rational number (pair of numerator and denominator).
This structure contains the data a format has to probe a file.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int avio_r8(AVIOContext *s)
int flags
A combination of AV_PKT_FLAG values.
int ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
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.
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.