[FFmpeg-devel] [PATCH 1/2] avfilter/vf_colorkey: Add colorkey video filter
timo at rothenpieler.org
Thu Jun 11 19:55:37 CEST 2015
>> +static int offset_r(int fmt)
> You can use the info in AVPixFmtDescriptor for these.
Didn't know about that, will look into it.
>> + default:
>> + return 0;
> av_assert0(!"reached"); for the default case.
>> + frame->format = convert_format(frame->format);
> I am not sure this is legal. It would probably be wiser to allocate a new
It should be fine, since the frame is made writeable and has noone else
using it. The memory layout of those pixel formats is 100% the same.
>> + outlink->format = convert_format(avctx->inputs->format);
> This is really not legal. You need to return EAGAIN from query_formats()
> until the input format is known.
Ah, so that's how it's supposed to be done!
So basicaly, i check if convert_format(avctx->inputs->format) ==
avctx->outputs->in_formats, and if not, return EAGAIN?
> Or you can solve both problems at once by requiring alpha on the input
> format and not doing any format change at all. I find that solution is the
Yeah, but that would insert another swscaler, and i'm not sure how well
it handles the conversion, but it propably adds another memcpy.
If it handles it without any overhead, that would propably be better.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: OpenPGP digital signature
More information about the ffmpeg-devel