55 caca_free_dither(c->
dither);
59 caca_free_canvas(c->
canvas);
67 const char *
const *drivers = caca_get_display_driver_list();
71 for (i = 0; drivers[i]; i += 2)
75 #define DEFINE_LIST_DITHER(thing, thing_str) \
76 static void list_dither_## thing(CACAContext *c) \
78 const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
81 av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
82 for (i = 0; thing[i]; i += 2) \
83 av_log(c->ctx, AV_LOG_INFO, "%s : %s\n", thing[i], thing[i + 1]); \
105 list_dither_color(c);
107 list_dither_charset(c);
108 }
else if (!strcmp(c->
list_dither,
"algorithms")) {
109 list_dither_algorithm(c);
110 }
else if (!strcmp(c->
list_dither,
"antialiases")) {
111 list_dither_antialias(c);
114 "Invalid argument '%s', for 'list_dither' option\n"
115 "Argument must be one of 'algorithms, 'antialiases', 'charsets', 'colors'\n",
131 "Unsupported pixel format '%s', choose rgb24\n",
145 bpp / 8 * encctx->
width,
146 0x0000ff, 0x00ff00, 0xff0000, 0);
153 #define CHECK_DITHER_OPT(opt) \
154 if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
155 ret = AVERROR(errno); \
156 av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
195 caca_refresh_display(c->
display);
200 #define OFFSET(x) offsetof(CACAContext,x)
201 #define ENC AV_OPT_FLAG_ENCODING_PARAM
240 .priv_class = &caca_class,
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define LIBAVUTIL_VERSION_INT
packed RGB 8:8:8, 24bpp, RGBRGB...
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static int caca_write_trailer(AVFormatContext *s)
static void list_drivers(CACAContext *c)
AVStream ** streams
A list of all streams in the file.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
Main libavdevice API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVCodecContext * codec
Codec context associated with this stream.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
char filename[1024]
input or output filename
int width
picture width / height.
static int write_trailer(AVFormatContext *s1)
AVOutputFormat ff_caca_muxer
static const AVOption options[]
#define CHECK_DITHER_OPT(opt)
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
#define DEFINE_LIST_DITHER(thing, thing_str)
#define AV_LOG_INFO
Standard information.
enum AVMediaType codec_type
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
char * av_strdup(const char *s)
Duplicate the string s.
main external API structure.
static const char * window_title
Describe the class of an AVClass context structure.
offset must point to two consecutive integers
static int caca_write_header(AVFormatContext *s)
static int caca_write_packet(AVFormatContext *s, AVPacket *pkt)
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
static const AVClass caca_class
This structure stores compressed data.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)