FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
caca.c File Reference
#include <caca.h>
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  CACAContext
 

Macros

#define DEFINE_LIST_DITHER(thing, thing_str)
 
#define CHECK_DITHER_OPT(opt)
 
#define OFFSET(x)   offsetof(CACAContext,x)
 
#define ENC   AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static int caca_write_trailer (AVFormatContext *s)
 
static void list_drivers (CACAContext *c)
 
 DEFINE_LIST_DITHER (color,"colors")
 
 DEFINE_LIST_DITHER (charset,"charsets")
 
 DEFINE_LIST_DITHER (algorithm,"algorithms")
 
 DEFINE_LIST_DITHER (antialias,"antialias")
 
static int caca_write_header (AVFormatContext *s)
 
static int caca_write_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const AVClass caca_class
 
AVOutputFormat ff_caca_muxer
 

Macro Definition Documentation

#define DEFINE_LIST_DITHER (   thing,
  thing_str 
)
Value:
static void list_dither_## thing(CACAContext *c) \
{ \
const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
int i; \
av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
for (i = 0; thing[i]; i += 2) \
av_log(c->ctx, AV_LOG_INFO, "%s: %s\n", thing[i], thing[i + 1]); \
}
#define av_log(a,...)
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
static double c[64]
for(j=16;j >0;--j)

Definition at line 75 of file caca.c.

#define CHECK_DITHER_OPT (   opt)
Value:
do { \
if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
ret = AVERROR(errno); \
av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
c->opt, #opt); \
goto fail; \
} \
} while (0)
const char * s
Definition: avisynth_c.h:631
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
#define fail()
Definition: checkasm.h:81
if(ret< 0)
Definition: vf_mcdeint.c:282
static double c[64]

Referenced by caca_write_header().

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

Definition at line 202 of file caca.c.

#define ENC   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 203 of file caca.c.

Function Documentation

static int caca_write_trailer ( AVFormatContext s)
static

Definition at line 44 of file caca.c.

Referenced by caca_write_header().

static void list_drivers ( CACAContext c)
static

Definition at line 65 of file caca.c.

Referenced by caca_write_header().

DEFINE_LIST_DITHER ( color  ,
"colors"   
)
DEFINE_LIST_DITHER ( charset  ,
"charsets"   
)
DEFINE_LIST_DITHER ( algorithm  ,
"algorithms"   
)
DEFINE_LIST_DITHER ( antialias  ,
"antialias"   
)
static int caca_write_header ( AVFormatContext s)
static

Definition at line 91 of file caca.c.

static int caca_write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 192 of file caca.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "window_size", "set window forced size", OFFSET(window_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL }, 0, 0, ENC},
{ "window_title", "set window title", OFFSET(window_title), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, ENC },
{ "driver", "set display driver", OFFSET(driver), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, ENC },
{ "algorithm", "set dithering algorithm", OFFSET(algorithm), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
{ "antialias", "set antialias method", OFFSET(antialias), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
{ "charset", "set charset used to render output", OFFSET(charset), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
{ "color", "set color used to render output", OFFSET(color), AV_OPT_TYPE_STRING, {.str = "default" }, 0, 0, ENC },
{ "list_drivers", "list available drivers", OFFSET(list_drivers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, ENC },
{ "list_dither", "list available dither options", OFFSET(list_dither), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, ENC, "list_dither" },
{ "algorithms", NULL, 0, AV_OPT_TYPE_CONST, {.str = "algorithms"}, 0, 0, ENC, "list_dither" },
{ "antialiases", NULL, 0, AV_OPT_TYPE_CONST, {.str = "antialiases"},0, 0, ENC, "list_dither" },
{ "charsets", NULL, 0, AV_OPT_TYPE_CONST, {.str = "charsets"}, 0, 0, ENC, "list_dither" },
{ "colors", NULL, 0, AV_OPT_TYPE_CONST, {.str = "colors"}, 0, 0, ENC, "list_dither" },
{ NULL },
}
#define NULL
Definition: coverity.c:32
static void list_drivers(CACAContext *c)
Definition: caca.c:65
#define ENC
Definition: caca.c:203
static const char * window_title
Definition: ffplay.c:314
offset must point to two consecutive integers
Definition: opt.h:232
#define OFFSET(x)
Definition: caca.c:202

Definition at line 205 of file caca.c.

const AVClass caca_class
static
Initial value:
= {
.class_name = "caca_outdev",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:70
av_default_item_name
static const AVOption options[]
Definition: caca.c:205

Definition at line 222 of file caca.c.

AVOutputFormat ff_caca_muxer
Initial value:
= {
.name = "caca",
.long_name = NULL_IF_CONFIG_SMALL("caca (color ASCII art) output device"),
.priv_data_size = sizeof(CACAContext),
.audio_codec = AV_CODEC_ID_NONE,
.video_codec = AV_CODEC_ID_RAWVIDEO,
.priv_class = &caca_class,
}
static int caca_write_trailer(AVFormatContext *s)
Definition: caca.c:44
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:94
static int caca_write_header(AVFormatContext *s)
Definition: caca.c:91
static int flags
Definition: cpu.c:47
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:476
static int caca_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: caca.c:192
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:497
static const AVClass caca_class
Definition: caca.c:222
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
Definition: v4l2enc.c:86

Definition at line 230 of file caca.c.