Go to the documentation of this file.
59 if (
d[0] ==
'w' &&
d[1] ==
'W' &&
d[2] == 0x10 &&
d[3] == 0)
69 AvsFormat *avs =
s->priv_data;
79 avs->remaining_frame_size = 0;
80 avs->remaining_audio_size = 0;
82 avs->st_video = avs->st_audio =
NULL;
84 if (avs->width != 318 || avs->height != 198)
86 "when the avs format is supposed to be 318x198 only.\n",
87 avs->width, avs->height);
95 uint8_t * palette,
int palette_size)
97 AvsFormat *avs =
s->priv_data;
107 pkt->
data[2] = palette_size & 0xFF;
108 pkt->
data[3] = (palette_size >> 8) & 0xFF;
109 memcpy(
pkt->
data + 4, palette, palette_size - 4);
112 pkt->
data[palette_size + 0] = sub_type;
131 AvsFormat *avs =
s->priv_data;
138 avs->remaining_audio_size -=
size;
157 AvsFormat *avs =
s->priv_data;
158 int sub_type = 0,
size = 0;
160 int palette_size = 0;
161 uint8_t palette[4 + 3 * 256];
164 if (avs->remaining_audio_size > 0)
169 if (avs->remaining_frame_size <= 0) {
172 avs->remaining_frame_size =
avio_rl16(
s->pb) - 4;
175 while (avs->remaining_frame_size > 0) {
181 avs->remaining_frame_size -=
size;
185 if (
size - 4 >
sizeof(palette))
194 if (!avs->st_video) {
200 avs->st_video->codecpar->width = avs->width;
201 avs->st_video->codecpar->height = avs->height;
202 avs->st_video->codecpar->bits_per_coded_sample=avs->bits_per_sample;
203 avs->st_video->nb_frames = avs->nb_frames;
204 #if FF_API_R_FRAME_RATE
205 avs->st_video->r_frame_rate =
207 avs->st_video->avg_frame_rate = (
AVRational){avs->fps, 1};
210 palette, palette_size);
213 if (!avs->st_audio) {
219 avs->remaining_audio_size =
size - 4;
235 .priv_data_size =
sizeof(AvsFormat),
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
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 struct 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.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
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)
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.
static int read_probe(const AVProbeData *p)
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.