Go to the documentation of this file.
58 caca_free_display(
c->display);
62 caca_free_dither(
c->dither);
66 caca_free_canvas(
c->canvas);
73 const char *
const *drivers = caca_get_display_driver_list();
77 for (
i = 0; drivers[
i];
i += 2)
81 #define DEFINE_LIST_DITHER(thing, thing_str) \
82 static void list_dither_## thing(CACAContext *c) \
84 const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
87 av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
88 for (i = 0; thing[i]; i += 2) \
89 av_log(c->ctx, AV_LOG_INFO, "%s: %s\n", thing[i], thing[i + 1]); \
105 if (
c->list_drivers) {
109 if (
c->list_dither) {
111 list_dither_color(
c);
113 list_dither_charset(
c);
115 list_dither_algorithm(
c);
117 list_dither_antialias(
c);
121 if (
s->nb_streams > 1
130 "Unsupported pixel format '%s', choose rgb24\n",
135 c->canvas = caca_create_canvas(
c->window_width,
c->window_height);
143 c->dither = caca_create_dither(bpp, encctx->
width, encctx->
height,
144 bpp / 8 * encctx->
width,
145 0x0000ff, 0x00ff00, 0xff0000, 0);
152 #define CHECK_DITHER_OPT(opt) do { \
153 if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
154 ret = AVERROR(errno); \
155 av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
166 c->display = caca_create_display_with_driver(
c->canvas,
c->driver);
174 if (!
c->window_width || !
c->window_height) {
175 c->window_width = caca_get_canvas_width(
c->canvas);
176 c->window_height = caca_get_canvas_height(
c->canvas);
179 if (!
c->window_title)
181 caca_set_display_title(
c->display,
c->window_title);
191 caca_dither_bitmap(
c->canvas, 0, 0,
c->window_width,
c->window_height,
c->dither,
pkt->
data);
192 caca_refresh_display(
c->display);
197 #define OFFSET(x) offsetof(CACAContext,x)
198 #define ENC AV_OPT_FLAG_ENCODING_PARAM
209 {
"list_dither",
"list available dither options",
OFFSET(list_dither),
AV_OPT_TYPE_FLAGS, { .i64 = 0 }, 0, INT_MAX,
ENC, .unit =
"list_dither" },
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
Underlying C type is 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.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_FLAGS
Underlying C type is unsigned int.
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
static int caca_write_packet(AVFormatContext *s, AVPacket *pkt)
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
static void list_drivers(CACAContext *c)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
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.