[FFmpeg-devel] [PATCH 001/279] Add a new channel layout API
Marton Balint
cus at passwd.hu
Wed Dec 8 12:13:13 EET 2021
On Wed, 8 Dec 2021, Lynne wrote:
> 8 Dec 2021, 02:06 by jamrial at gmail.com:
>
>>
>> +enum AVChannel {
>> + ///< Invalid channel index
>> + AV_CHAN_NONE = -1,
>> + AV_CHAN_FRONT_LEFT,
>>
>
> No, not the pixfmt mistake again. Set AV_CHAN_NONE to 0,
> the rest can follow. Or keep AV_CHAN_NONE to -1
> and add a new AV_CHAN_UNSPECIFIED as 0.
>
>
>> + AV_CHAN_FRONT_RIGHT,
>> + AV_CHAN_FRONT_CENTER,
>> + AV_CHAN_LOW_FREQUENCY,
>> + AV_CHAN_BACK_LEFT,
>> + AV_CHAN_BACK_RIGHT,
>> + AV_CHAN_FRONT_LEFT_OF_CENTER,
>> + AV_CHAN_FRONT_RIGHT_OF_CENTER,
>> + AV_CHAN_BACK_CENTER,
>> + AV_CHAN_SIDE_LEFT,
>> + AV_CHAN_SIDE_RIGHT,
>> + AV_CHAN_TOP_CENTER,
>> + AV_CHAN_TOP_FRONT_LEFT,
>> + AV_CHAN_TOP_FRONT_CENTER,
>> + AV_CHAN_TOP_FRONT_RIGHT,
>> + AV_CHAN_TOP_BACK_LEFT,
>> + AV_CHAN_TOP_BACK_CENTER,
>> + AV_CHAN_TOP_BACK_RIGHT,
>> + /** Stereo downmix. */
>> + AV_CHAN_STEREO_LEFT = 29,
>> + /** See above. */
>> + AV_CHAN_STEREO_RIGHT,
>> + AV_CHAN_WIDE_LEFT,
>> + AV_CHAN_WIDE_RIGHT,
>> + AV_CHAN_SURROUND_DIRECT_LEFT,
>> + AV_CHAN_SURROUND_DIRECT_RIGHT,
>> + AV_CHAN_LOW_FREQUENCY_2,
>> + AV_CHAN_TOP_SIDE_LEFT,
>> + AV_CHAN_TOP_SIDE_RIGHT,
>> + AV_CHAN_BOTTOM_FRONT_CENTER,
>> + AV_CHAN_BOTTOM_FRONT_LEFT,
>> + AV_CHAN_BOTTOM_FRONT_RIGHT,
>> +
>> + /** Channel is empty can be safely skipped. */
>> + AV_CHAN_SILENCE = 64,
>> +};
>>
>
> Why is AV_CHAN_SILENCE set to 64? If it's special,
> set it to follow just after AV_CHAN_NONE or
> AV_CHAN_UNSPECIFIED.
Because of the channel layout bitmask representation and its relation to
the channel ID. We might want to add real channel designations which can
be represented using the bitmask layout, and using SILENCE for that does
not make a lot of sense. E.g. there can be more than one silent channel.
And if somebody wants sparse channel layout then making the extended
representation a hard requirement seems also a good idea.
Regards,
Marton
More information about the ffmpeg-devel
mailing list