On Sat, 6 May 2017 15:30:35 +0200 Luca Barbato <lu_z...@gentoo.org> wrote:
> On 5/6/17 5:13 AM, wm4 wrote: > > On Fri, 5 May 2017 22:20:18 -0400 > > Vittorio Giovara <vittorio.giov...@gmail.com> wrote: > > > > > >> +enum AVChannelOrder { > >> + /** > >> + * The native channel order, i.e. the channels are in the same order > >> in > >> + * which they are defined in the AVChannel enum. This supports up to > >> 63 > >> + * different channels. > >> + */ > >> + AV_CHANNEL_ORDER_NATIVE, > >> + /** > >> + * The channel order does not correspond to any other predefined > >> order and > >> + * is stored as an explicit map. For example, this could be used to > >> support > >> + * layouts with 64 or more channels. > >> + */ > >> + AV_CHANNEL_ORDER_CUSTOM, > >> + /** > >> + * Only the channel count is specified, without any further > >> information > >> + * about the channels. > >> + */ > >> + AV_CHANNEL_ORDER_UNSPEC, > >> +}; > > > > > >> +typedef struct AVChannelLayout { > >> + /** > >> + * Channel order used in this layout. > >> + */ > >> + enum AVChannelOrder order; > >> + > >> + /** > >> + * Number of channels in this layout. Mandatory field. > >> + */ > >> + int nb_channels; > >> + > >> + /** > >> + * Details about which channels are present in this layout. > >> + * For AV_CHANNEL_ORDER_UNSPEC, this field is undefined and must not > >> be > >> + * used. > >> + */ > >> + union { > >> + /** > >> + * This member must be used for AV_CHANNEL_ORDER_NATIVE. > >> + * It is a bitmask, where the position of each set bit means that > >> the > >> + * AVChannel with the corresponding value is present. > >> + * > >> + * I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then > >> AV_CHAN_FOO > >> + * is present in the layout. Otherwise it is not present. > >> + * > >> + * @note when a channel layout using a bitmask is constructed or > >> + * modified manually (i.e. not using any of the > >> av_channel_layout_* > >> + * functions), the code doing it must ensure that the number of > >> set bits > >> + * is equal to nb_channels. > >> + */ > >> + uint64_t mask; > >> + /** > >> + * This member must be used when the channel order is not native, > >> and > >> + * represents a nb_channels-sized array. Its semantics may > >> depending on > >> + * the channel order. > >> + * > >> + * - For AV_CHANNEL_ORDER_CUSTOM: each element signals the > >> presence of > >> + * the AVChannel with the corresponding value: eg. when map[i] > >> is > >> + * equal to AV_CHAN_FOO, then AV_CHAN_FOO is the i-th channel in > >> + * the audio data. > > > > Does it allow a channel to be mapped more than once? Does it allow > > padding channels (that would be all-0)? > > > >> + */ > >> + uint8_t *map; > >> + } u; > >> +} AVChannelLayout; > > > > So AV_CHANNEL_ORDER_CUSTOM is as powerful as AV_CHANNEL_ORDER_NATIVE, > > just that it allows an arbitrary order? > > > > How would layouts that don't fit into the channel label schema be > > handled? > > > > How would that ambisonic stuff be represented? > > As a different AV_CHANNEL_ORDER I'd still like to see it. AFAIK the whole point of the patchset is because of ambisonics? _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel