Go to the documentation of this file.
49 caca_free_display(
c->display);
53 caca_free_dither(
c->dither);
57 caca_free_canvas(
c->canvas);
64 const char *
const *drivers = caca_get_display_driver_list();
68 for (
i = 0; drivers[
i];
i += 2)
72 #define DEFINE_LIST_DITHER(thing, thing_str) \
73 static void list_dither_## thing(CACAContext *c) \
75 const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
78 av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
79 for (i = 0; thing[i]; i += 2) \
80 av_log(c->ctx, AV_LOG_INFO, "%s: %s\n", thing[i], thing[i + 1]); \
96 if (
c->list_drivers) {
100 if (
c->list_dither) {
101 if (!strcmp(
c->list_dither,
"colors")) {
102 list_dither_color(
c);
103 }
else if (!strcmp(
c->list_dither,
"charsets")) {
104 list_dither_charset(
c);
105 }
else if (!strcmp(
c->list_dither,
"algorithms")) {
106 list_dither_algorithm(
c);
107 }
else if (!strcmp(
c->list_dither,
"antialiases")) {
108 list_dither_antialias(
c);
111 "Invalid argument '%s', for 'list_dither' option\n"
112 "Argument must be one of 'algorithms, 'antialiases', 'charsets', 'colors'\n",
119 if (
s->nb_streams > 1
128 "Unsupported pixel format '%s', choose rgb24\n",
133 c->canvas = caca_create_canvas(
c->window_width,
c->window_height);
141 c->dither = caca_create_dither(bpp, encctx->
width, encctx->
height,
142 bpp / 8 * encctx->
width,
143 0x0000ff, 0x00ff00, 0xff0000, 0);
150 #define CHECK_DITHER_OPT(opt) do { \
151 if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
152 ret = AVERROR(errno); \
153 av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
164 c->display = caca_create_display_with_driver(
c->canvas,
c->driver);
172 if (!
c->window_width || !
c->window_height) {
173 c->window_width = caca_get_canvas_width(
c->canvas);
174 c->window_height = caca_get_canvas_height(
c->canvas);
177 if (!
c->window_title)
179 caca_set_display_title(
c->display,
c->window_title);
189 caca_dither_bitmap(
c->canvas, 0, 0,
c->window_width,
c->window_height,
c->dither,
pkt->
data);
190 caca_refresh_display(
c->display);
195 #define OFFSET(x) offsetof(CACAContext,x)
196 #define ENC AV_OPT_FLAG_ENCODING_PARAM
static int caca_write_header(AVFormatContext *s)
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.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
static void deinit(AVFormatContext *s)
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
static const AVClass caca_class
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static const char * window_title
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
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.
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static void caca_deinit(AVFormatContext *s)
#define AV_LOG_INFO
Standard information.
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
#define DEFINE_LIST_DITHER(thing, thing_str)
#define i(width, name, range_min, range_max)
const AVOutputFormat ff_caca_muxer
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 const AVOption options[]
char * av_strdup(const char *s)
Duplicate a string.
#define CHECK_DITHER_OPT(opt)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
#define flags(name, subs,...)
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
static int caca_write_packet(AVFormatContext *s, AVPacket *pkt)
static void write_header(FFV1Context *f)
static void list_drivers(CACAContext *c)
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.