Go to the documentation of this file.
33 #include "config_components.h"
76 #if CONFIG_BINTEXT_DEMUXER | CONFIG_ADF_DEMUXER | CONFIG_IDF_DEMUXER
86 #if CONFIG_BINTEXT_DEMUXER
87 static const uint8_t next_magic[]={
88 0x1A, 0x1B,
'[',
'0',
';',
'3',
'0',
';',
'4',
'0',
'm',
'N',
'E',
'X',
'T', 0x00
101 avio_seek(pb, start_pos - 256, SEEK_SET);
102 if (
avio_read(pb, buf,
sizeof(next_magic)) !=
sizeof(next_magic))
104 if (memcmp(buf, next_magic,
sizeof(next_magic)))
111 #define GET_EFI2_META(name,size) \
113 if (len < 1 || len > size) \
115 if (avio_read(pb, buf, size) == size && *buf) { \
117 av_dict_set(&avctx->metadata, name, buf, 0); \
120 GET_EFI2_META(
"filename", 12)
121 GET_EFI2_META("author", 20)
122 GET_EFI2_META("publisher", 20)
123 GET_EFI2_META("title", 35)
132 par->width =
fsize > 4000 ? (160<<3) : (80<<3);
137 const uint8_t *
d = p->
buf;
138 int magic = 0, sauce = 0;
141 magic = !memcmp(
d + p->
buf_size - 256, next_magic,
sizeof(next_magic));
143 sauce = !memcmp(
d + p->
buf_size - 128,
"SAUCE00", 7);
155 predict_width(&par, p->
buf_size, got_width);
158 calculate_height(&par, p->
buf_size);
193 next_tag_read(
s, &bin->
fsize);
206 #if CONFIG_XBIN_DEMUXER
209 const uint8_t *
d = p->
buf;
213 d[9] > 0 &&
d[9] <= 32)
222 char fontheight,
flags;
252 if (fsize < 9 + st->codecpar->extradata_size)
263 #if CONFIG_ADF_DEMUXER
295 if (
fsize < 1 + 192 + 4096)
310 #if CONFIG_IDF_DEMUXER
311 static const uint8_t idf_magic[] = {
312 0x04, 0x31, 0x2e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x15, 0x00
317 if (p->
buf_size <
sizeof(idf_magic))
319 if (!memcmp(p->
buf, idf_magic,
sizeof(idf_magic)))
329 int got_width = 0,
ret;
346 if (
fsize < 12 + 4096 + 48)
372 if (bin->
fsize > 0) {
376 }
else if (!bin->
fsize) {
389 #define OFFSET(x) offsetof(BinDemuxContext, x)
397 #define CLASS(name) \
398 (const AVClass[1]){{ \
399 .class_name = name, \
400 .item_name = av_default_item_name, \
402 .version = LIBAVUTIL_VERSION_INT, \
405 #if CONFIG_BINTEXT_DEMUXER
409 .p.priv_class =
CLASS(
"Binary text demuxer"),
417 #if CONFIG_XBIN_DEMUXER
421 .p.priv_class =
CLASS(
"eXtended BINary text (XBIN) demuxer"),
429 #if CONFIG_ADF_DEMUXER
433 .p.extensions =
"adf",
434 .p.priv_class =
CLASS(
"Artworx Data Format demuxer"),
441 #if CONFIG_IDF_DEMUXER
445 .p.extensions =
"idf",
446 .p.priv_class =
CLASS(
"iCE Draw File demuxer"),
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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
enum AVMediaType codec_type
General type of the encoded data.
This struct describes the properties of an encoded stream.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
int buf_size
Size of buf except extra allocated bytes.
int64_t avio_size(AVIOContext *s)
Get the filesize.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
int chars_per_frame
characters to send decoder per frame; set by private options as characters per second,...
unsigned int avio_rl16(AVIOContext *s)
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
int av_match_ext(const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
static int64_t fsize(FILE *f)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int read_header(FFV1Context *f)
Describe the class of an AVClass context structure.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
Rational number (pair of numerator and denominator).
AVRational framerate
frames per second (private option)
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
AVIOContext * pb
I/O context.
This structure contains the data a format has to probe a file.
uint64_t fsize
file size less metadata buffer
int extradata_size
Size of the extradata content in bytes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
int avio_r8(AVIOContext *s)
int flags
A combination of AV_PKT_FLAG values.
static int read_packet(AVFormatContext *s, AVPacket *pkt)
static const AVOption options[]
static AVStream * init_stream(AVFormatContext *s)
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
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
@ AV_OPT_TYPE_INT
Underlying C type is int.
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.
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
static int read_probe(const AVProbeData *p)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define MKTAG(a, b, c, d)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.