[FFmpeg-devel] [PATCH] extractplanes filter
Paul B Mahol
onemda at gmail.com
Thu May 2 15:58:29 CEST 2013
On 5/2/13, Nicolas George <nicolas.george at normalesup.org> wrote:
> Le duodi 12 floreal, an CCXXI, Paul B Mahol a ecrit :
>> Yes, I'm aware of that, either I could query for different formats if
>> r/g/b are
>> set, or leave it to user by renaming r/g/b/y/u/v to c0/c1.., or just
>> return nothing
>> if input does not have r/g/b.
>>
>> I think I will pick first one.
>
> I am not sure the first one is best: if the user request "r" from a yuv
> input, it will silently insert a convert filter, while this is more likely
> a
> user error.
>
> I suggest something like that:
>
> enum {
> PLANE_R = 0x01,
> PLANE_G = 0x02,
> PLANE_B = 0x04,
> PLANE_A = 0x08,
> PLANE_Y = 0x10,
> PLANE_U = 0x20,
> PLANE_V = 0x40,
> };
>
> plane_avail = (gray ? PLANE_Y :
> rgb ? PLANE_R | PLANE_G | PLANE_B :
> PLANE_Y | PLANE_U | PLANE_V) |
> (alpha ? PLANE_A : 0);
> if (plane_requested & ~plane_avail) {
> av_error(ctx, AV_LOG_ERROR, "Requested planes not available\n");
> return AVERROR(EINVAL);
> }
> plane_actual = (plane_requested & 0xF) | (plane_requested >> 4);
>
>> So return AVERROR_EOF only if EOF happend for all outputs and
>> otherwise just return 0?
>
> Yes, exactly.
>
>> greping shows its required.
>
> Yes, indeed, and seeing it in your patch makes me think we should try to
> make it unnecessary, but that is completely unrelated.
I wonder how format renegotiation works. I would like to pick 16bit gray
with right endianess depending on input format - if its 16 bit at all otherwise
just pick 8bit one.
I can't find where its explained how to do that.
>
> Regards,
>
> --
> Nicolas George
>
More information about the ffmpeg-devel
mailing list