Quoting wm4 (2017-05-06 05:13:37) > On Fri, 5 May 2017 22:20:18 -0400 > Vittorio Giovara <[email protected]> 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)?
FWIW it was my intention from the beginning that this API should allow us to "properly" support retarted things like dual-mono. So yes, any channel can be mapped any number of times with the custom order. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
