FFmpeg
Data Structures | Macros | Functions | Variables
tty.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include "libavutil/log.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"
#include "sauce.h"

Go to the source code of this file.

Data Structures

struct  TtyDemuxContext
 

Macros

#define GET_EFI_META(name, size)
 
#define OFFSET(x)   offsetof(TtyDemuxContext, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int isansicode (int x)
 
static int read_probe (const AVProbeData *p)
 
static int efi_read (AVFormatContext *avctx, uint64_t start_pos)
 Parse EFI header. More...
 
static int read_header (AVFormatContext *avctx)
 
static int read_packet (AVFormatContext *avctx, AVPacket *pkt)
 

Variables

static const char tty_extensions [31] = "ans,art,asc,diz,ice,nfo,txt,vt"
 
static const AVOption options []
 
static const AVClass tty_demuxer_class
 
const FFInputFormat ff_tty_demuxer
 

Detailed Description

Tele-typewriter demuxer

Definition in file tty.c.

Macro Definition Documentation

◆ GET_EFI_META

#define GET_EFI_META (   name,
  size 
)
Value:
len = avio_r8(pb); \
if (len < 1 || len > size) \
return -1; \
if (avio_read(pb, buf, size) == size) { \
buf[len] = 0; \
av_dict_set(&avctx->metadata, name, buf, 0); \
}

◆ OFFSET

#define OFFSET (   x)    offsetof(TtyDemuxContext, x)

Definition at line 169 of file tty.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 170 of file tty.c.

Function Documentation

◆ isansicode()

static int isansicode ( int  x)
static

Definition at line 38 of file tty.c.

Referenced by read_probe().

◆ read_probe()

static int read_probe ( const AVProbeData p)
static

Definition at line 53 of file tty.c.

◆ efi_read()

static int efi_read ( AVFormatContext avctx,
uint64_t  start_pos 
)
static

Parse EFI header.

Definition at line 76 of file tty.c.

Referenced by read_header().

◆ read_header()

static int read_header ( AVFormatContext avctx)
static

Definition at line 103 of file tty.c.

◆ read_packet()

static int read_packet ( AVFormatContext avctx,
AVPacket pkt 
)
static

Definition at line 142 of file tty.c.

Variable Documentation

◆ tty_extensions

const char tty_extensions[31] = "ans,art,asc,diz,ice,nfo,txt,vt"
static

Definition at line 43 of file tty.c.

Referenced by read_probe().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "chars_per_frame", "", 0x42, AV_OPT_TYPE_INT, {.i64 = 6000}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM},
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC },
{ NULL },
}

Definition at line 171 of file tty.c.

◆ tty_demuxer_class

const AVClass tty_demuxer_class
static
Initial value:
= {
.class_name = "TTY demuxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 178 of file tty.c.

◆ ff_tty_demuxer

const FFInputFormat ff_tty_demuxer
Initial value:
= {
.p.name = "tty",
.p.long_name = NULL_IF_CONFIG_SMALL("Tele-typewriter"),
.p.extensions = tty_extensions,
.p.priv_class = &tty_demuxer_class,
.p.flags = AVFMT_GENERIC_INDEX,
.priv_data_size = sizeof(TtyDemuxContext),
}

Definition at line 185 of file tty.c.

name
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 default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:248
AVFMT_GENERIC_INDEX
#define AVFMT_GENERIC_INDEX
Use generic index building code.
Definition: avformat.h:480
read_packet
static int read_packet(AVFormatContext *avctx, AVPacket *pkt)
Definition: tty.c:142
width
#define width
framerate
float framerate
Definition: av1_levels.c:29
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:245
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
options
static const AVOption options[]
Definition: tty.c:171
tty_extensions
static const char tty_extensions[31]
Definition: tty.c:43
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
read_probe
static int read_probe(const AVProbeData *p)
Definition: tty.c:53
size
int size
Definition: twinvq_data.h:10344
avio_r8
int avio_r8(AVIOContext *s)
Definition: aviobuf.c:602
tty_demuxer_class
static const AVClass tty_demuxer_class
Definition: tty.c:178
len
int len
Definition: vorbis_enc_data.h:426
read_header
static int read_header(AVFormatContext *avctx)
Definition: tty.c:103
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:611
DEC
#define DEC
Definition: tty.c:170
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition: opt.h:273
TtyDemuxContext
Definition: tty.c:45
OFFSET
#define OFFSET(x)
Definition: tty.c:169