[FFmpeg-devel] [PATCH] libcaca output device

Paul B Mahol onemda at gmail.com
Thu Jul 19 20:43:57 CEST 2012


On 7/19/12, Stefano Sabatini <stefasab at gmail.com> wrote:
> On date Thursday 2012-07-19 15:10:22 +0000, Paul B Mahol encoded:
>>
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  configure                |   12 +++
>>  libavdevice/Makefile     |    1 +
>>  libavdevice/alldevices.c |    1 +
>>  libavdevice/caca.c       |  191
>> ++++++++++++++++++++++++++++++++++++++++++++++
>>  4 files changed, 205 insertions(+), 0 deletions(-)
>>  create mode 100644 libavdevice/caca.c
>>
[...]
>> +
>> +    if (encctx->pix_fmt != PIX_FMT_RGB24) {
>> +        av_log(s, AV_LOG_ERROR,
>> +               "Unsupported pixel format '%s', choose rgb24.\n",
>> +               av_get_pix_fmt_name(encctx->pix_fmt));
>> +        return AVERROR(EINVAL);
>> +    }
>> +
>> +    c->canvas = caca_create_canvas(encctx->width, encctx->height);
>> +    if (!c->canvas) {
>> +        av_log(s, AV_LOG_ERROR, "Failed to create canvas.\n");
>> +        return AVERROR(ENOMEM);
>
> Don't know if libcaca supports error messages, could be nice to add
> them to improve the feedback.

It only sets errno.
>
>> +    }
>> +
>> +    c->display = caca_create_display_with_driver(c->canvas, c->driver);
>> +    if (!c->display) {
>> +        const char *const *drivers = caca_get_display_driver_list();
>> +
>> +        av_log(s, AV_LOG_ERROR, "Failed to create display.\n");
>
> Nit: no need for the final dot (consistency reasons), here and below
>
>> +        av_log(s, AV_LOG_INFO, "Possible drivers:\n");
>> +        for (i = 0; drivers[i]; i += 2)
>> +            av_log(s, AV_LOG_INFO, "%s : %s\n", drivers[i], drivers[i +
>> 1]);
>> +        caca_free_canvas(c->canvas);
>
> Note: we could create a list driver|algorithm|antialias|color|... option
> showing the supported stuff.

Could you elaborate this?

[...]


More information about the ffmpeg-devel mailing list