Go to the documentation of this file.
50 caca_free_display(
c->display);
54 caca_free_dither(
c->dither);
58 caca_free_canvas(
c->canvas);
65 const char *
const *drivers = caca_get_display_driver_list();
69 for (
i = 0; drivers[
i];
i += 2)
73 #define DEFINE_LIST_DITHER(thing, thing_str) \
74 static void list_dither_## thing(CACAContext *c) \
76 const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
79 av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
80 for (i = 0; thing[i]; i += 2) \
81 av_log(c->ctx, AV_LOG_INFO, "%s: %s\n", thing[i], thing[i + 1]); \
97 if (
c->list_drivers) {
101 if (
c->list_dither) {
102 if (!strcmp(
c->list_dither,
"colors")) {
103 list_dither_color(
c);
104 }
else if (!strcmp(
c->list_dither,
"charsets")) {
105 list_dither_charset(
c);
106 }
else if (!strcmp(
c->list_dither,
"algorithms")) {
107 list_dither_algorithm(
c);
108 }
else if (!strcmp(
c->list_dither,
"antialiases")) {
109 list_dither_antialias(
c);
112 "Invalid argument '%s', for 'list_dither' option\n"
113 "Argument must be one of 'algorithms, 'antialiases', 'charsets', 'colors'\n",
120 if (
s->nb_streams > 1
129 "Unsupported pixel format '%s', choose rgb24\n",
134 c->canvas = caca_create_canvas(
c->window_width,
c->window_height);
142 c->dither = caca_create_dither(bpp, encctx->
width, encctx->
height,
143 bpp / 8 * encctx->
width,
144 0x0000ff, 0x00ff00, 0xff0000, 0);
151 #define CHECK_DITHER_OPT(opt) do { \
152 if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
153 ret = AVERROR(errno); \
154 av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
165 c->display = caca_create_display_with_driver(
c->canvas,
c->driver);
173 if (!
c->window_width || !
c->window_height) {
174 c->window_width = caca_get_canvas_width(
c->canvas);
175 c->window_height = caca_get_canvas_height(
c->canvas);
178 if (!
c->window_title)
180 caca_set_display_title(
c->display,
c->window_title);
190 caca_dither_bitmap(
c->canvas, 0, 0,
c->window_width,
c->window_height,
c->dither,
pkt->
data);
191 caca_refresh_display(
c->display);
196 #define OFFSET(x) offsetof(CACAContext,x)
197 #define ENC AV_OPT_FLAG_ENCODING_PARAM
static int caca_write_header(AVFormatContext *s)
const FFOutputFormat ff_caca_muxer
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.
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.
#define DEFINE_LIST_DITHER(thing, thing_str)
#define i(width, name, range_min, range_max)
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 AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
static int caca_write_packet(AVFormatContext *s, AVPacket *pkt)
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.