[FFmpeg-devel] [PATCH] lavfi: add ff_all_channel_layouts internal symbol

Michael Niedermayer michaelni at gmx.at
Fri Sep 9 03:25:00 CEST 2011


On Thu, Sep 08, 2011 at 02:12:53AM +0200, Stefano Sabatini wrote:
[...]
> 8 channels (FC|LFE|BL|BR|SL|SR|DL|DR)
> 8 channels (FL|FR|BL|BR|SL|SR|DL|DR)
> 9 channels (FL|FR|LFE|BL|BR|SL|SR|DL|DR)
> 9 channels (FL|FR|FC|BL|BR|SL|SR|DL|DR)

> 7.1+downmix

this is 10 channels


> 6 channels (FC|BC|SL|SR|DL|DR)
> 7 channels (FC|LFE|BC|SL|SR|DL|DR)
> 7 channels (FL|FR|BC|SL|SR|DL|DR)
> 8 channels (FL|FR|LFE|BC|SL|SR|DL|DR)
> 8 channels (FL|FR|FC|BC|SL|SR|DL|DR)
> 9 channels (FL|FR|FC|LFE|BC|SL|SR|DL|DR)
> 
> with some 9-channels formats, which are not supported by libavfilter
> (max 8 channels).

we should raise this to 16 on the next ABI bump


[...]

my suggestion:

AVFilterFormats *avfilter_all_channel_layouts(void)
{
    static int64_t cls[] = {
#define A(x) (x), (x)|AV_CH_LOW_FREQUENCY
#define B(x) A(x|AV_CH_FRONT_CENTER), A(x|AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT), A(x|AV_CH_FRONT_CENTER|AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
#define C(x) B(x), B(x|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT), B(x|AV_CH_BACK_CENTER)
#define D(x) C(x), C(x|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
        D(0), D(AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
    };

    for (i = 0; i < FF_ARRAY_ELEMS(cls); i++) {
        if (get_channel_layout_nb_channels(cls[i]) > 8) {
            cls[i]=AV_CH_FRONT_CENTER;
        }
    }
    return avfilter_make_format64_list(cls);
}

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110909/f71f399c/attachment.asc>


More information about the ffmpeg-devel mailing list