40 return x == 0x1B || x == 0x0A || x == 0x0D || (x >= 0x20 && x < 0x7f);
60 for (
int i = 0;
i < 8 &&
i < p->buf_size;
i++)
66 for (
int i = 8;
i < p->buf_size;
i++)
69 return (cnt * 99LL / p->buf_size) * (cnt > 400) *
87#define GET_EFI_META(name,size) \
89 if (len < 1 || len > size) \
91 if (avio_read(pb, buf, size) == size) { \
93 av_dict_set(&avctx->metadata, name, buf, 0); \
129 st->
duration = (
s->fsize +
s->chars_per_frame - 1) /
s->chars_per_frame;
150 n =
s->chars_per_frame;
156 if (p +
s->chars_per_frame >
s->fsize)
163 pkt->stream_index = 0;
164 pkt->pts =
pkt->pos /
s->chars_per_frame;
169#define OFFSET(x) offsetof(TtyDemuxContext, x)
170#define DEC AV_OPT_FLAG_DECODING_PARAM
179 .class_name =
"TTY demuxer",
static int64_t fsize(FILE *f)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int64_t avio_size(AVIOContext *s)
Get the filesize.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int avio_r8(AVIOContext *s)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
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.
#define AVERROR_EOF
End of file.
const char * av_default_item_name(void *ptr)
Return the context name.
static double av_q2d(AVRational a)
Convert an AVRational to a double.
#define LIBAVUTIL_VERSION_INT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height)
Describe the class of an AVClass context structure.
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVIOContext * pb
I/O context.
void * priv_data
Format private data.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t duration
Decoding: duration of the stream, in stream time base.
AVRational avg_frame_rate
Average framerate.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
int height
Set by a private option.
uint64_t fsize
file size less metadata buffer
AVRational framerate
Set by a private option.
static int read_header(AVFormatContext *avctx)
#define GET_EFI_META(name, size)
static const AVClass tty_demuxer_class
static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
static int read_probe(const AVProbeData *p)
static const char tty_extensions[31]
static int isansicode(int x)
static int efi_read(AVFormatContext *avctx, uint64_t start_pos)
Parse EFI header.