[FFmpeg-devel] [PATCH] avfilter: add mergeplanes
Paul B Mahol
onemda at gmail.com
Fri Oct 11 13:35:26 CEST 2013
On 10/11/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Oct 07, 2013 at 08:52:56AM +0000, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> [...]
>> +}
>> +
>> +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
>> +{
>> + MergePlanesContext *s = inlink->dst->priv;
>> + return ff_framesync_filter_frame(&s->fs, inlink, in);
>> +}
>> +
>> +static av_cold int init(AVFilterContext *ctx)
>> +{
>> + MergePlanesContext *s = ctx->priv;
>> + enum AVPixelFormat gray;
>> + int i, ret, is_16, is_be;
>> +
>> + s->outdesc = av_pix_fmt_desc_get(s->out_fmt);
>> + if (!(s->outdesc->flags & AV_PIX_FMT_FLAG_PLANAR)) {
>> + av_log(ctx, AV_LOG_ERROR, "Only planar formats are
>> supported.\n");
>> + return AVERROR(EINVAL);
>> + }
>> +
>> + is_16 = s->outdesc->comp[0].depth_minus1 == 15;
>> + is_be = s->outdesc->flags & AV_PIX_FMT_FLAG_BE;
>
>> + gray = is_16 ? is_be ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY16LE :
>> AV_PIX_FMT_GRAY8;
>
> this might be more readable with a ()
>
> also you could support any planar input and just use the first N
> planes, that is for example with 4 inputs and yuva444p as output
> and yuv420 inputs, the 4 y planes could end up being used for the
> yuva planes
> also if you implement above it should then be easy to add support
> for the user to specify which planes of the inputs to use exactly
>
That is easier to say than to do.
What syntax I should use for such feature?
>
> the rest of the patch looks reasonable from a quick look
> i didnt test as it doesnt build (missing framesync patches on my
> side i assume)
>
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I have never wished to cater to the crowd; for what I know they do not
> approve, and what they approve I do not know. -- Epicurus
>
More information about the ffmpeg-devel
mailing list