On Mon, Oct 28, 2019 at 02:48:21PM +0100, Paul B Mahol wrote: > The new API is more extensible and allows for custom layouts. > More accurate information is exported, eg for decoders that do not > set a channel layout, lavc will not make one up for them. > > Deprecate the old API working with just uint64_t bitmasks. > > Original commit by Anton Khirnov <an...@khirnov.net>. > Expanded and completed by Vittorio Giovara <vittorio.giov...@gmail.com>. > Adapted for FFmpeg by Paul B Mahol <one...@gmail.com>. > > Signed-off-by: Anton Khirnov <an...@khirnov.net> > Signed-off-by: Vittorio Giovara <vittorio.giov...@gmail.com> > Signed-off-by: Paul B Mahol <one...@gmail.com> > --- > libavutil/channel_layout.c | 385 ++++++++++++++++++++++++++++------ > libavutil/channel_layout.h | 411 ++++++++++++++++++++++++++++++++++--- > libavutil/version.h | 3 + > 3 files changed, 709 insertions(+), 90 deletions(-) > > diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c > index 3bd5ee29b7..9112af32a6 100644 > --- a/libavutil/channel_layout.c > +++ b/libavutil/channel_layout.c [...]
./ffmpeg -v 0 -layouts looses the channel names [...] > +void av_channel_layout_from_mask(AVChannelLayout *channel_layout, > + uint64_t mask) > +{ > + channel_layout->order = AV_CHANNEL_ORDER_NATIVE; > + channel_layout->nb_channels = av_popcount64(mask); is this correct in relation to AV_CH_LAYOUT_NATIVE ? > + channel_layout->u.mask = mask; > +} [...] > +/** > + * Initialize a native channel layout from a bitmask indicating which > channels > + * are present. > + * > + * @note channel_layout should be properly allocated as described above. > + * > + * @param channel_layout the layout structure to be initialized > + * @param mask bitmask describing the channel layout > + */ > +void av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t > mask); This possibly should return a error code for example a mask of 0 would not be valid thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have often repented speaking, but never of holding my tongue. -- Xenocrates
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".