>> +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.

Yep

>> +    frame->format = convert_format(frame->format);
> 
> I am not sure this is legal. It would probably be wiser to allocate a new
> frame.

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[0]->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[0]->format) ==
avctx->outputs[0]->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
> best.

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.



Thanks,
Timo

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to