17#if AVCPP_API_NEW_CHANNEL_LAYOUT
19#include <libavutil/channel_layout.h>
95 template<typename Callable>
98 const AVChannelLayout *playout;
99 while ((playout = av_channel_layout_standard(&iter))) {
130 const AVChannelLayout *
raw()
const;
152 uint64_t
subset(uint64_t mask) const noexcept;
FFmpeg version and API compatibility switches.
Common helpers: comparisons, value lookup, non-copyable base, string utilities.
uint64_t layout() const noexcept
The layout as a bit mask when it can be expressed as one.
ChannelLayout clone() const
Deep copy of the layout.
std::string describe() const
Text description of the layout.
int index(AVChannel channel) const
Position of a speaker in the layout.
AVChannelLayout * raw()
The underlying FFmpeg layout, mutable.
const AVChannelLayout * raw() const
The underlying FFmpeg layout, read-only.
AVChannel channel(unsigned int index) const
Speaker at a position.
uint64_t subset(uint64_t mask) const noexcept
Intersection of the layout with a mask.
ChannelLayoutView() noexcept
Create an empty, invalid view.
bool isValid() const noexcept
Whether the view refers to a usable layout.
AVChannelLayout m_layout
The viewed layout; for the view it is a shallow copy of the descriptor.
Definition channellayout.h:226
int channels() const noexcept
Number of channels in the layout.
static void iterate(Callable callable)
Iterate the standard layouts FFmpeg knows about.
Definition channellayout.h:96
static void dumpLayouts()
Print every standard layout through the FFmpeg log system.
Owning channel layout.
Definition channellayout.h:240
void release()
Give up control of the owned description.
ChannelLayout(const ChannelLayoutView &view)
Copy a view into an owning layout.
ChannelLayout()=default
Create an empty layout that owns nothing.
ChannelLayoutView() noexcept
Create an empty, invalid view.
ChannelLayout(const char *str)
Build a layout from its textual form.
ChannelLayout & operator=(const ChannelLayout &other)
Deep copy assignment; the previous contents are released.
ChannelLayout(std::bitset< 64 > mask)
Build a layout from a bit mask.
~ChannelLayout()
Release the owned description.
ChannelLayout(ChannelLayout &&other)
Move a layout.
ChannelLayout(int channels)
Build the default layout for a channel count.
ChannelLayout(const ChannelLayout &other)
Deep copy of a layout.
ChannelLayout & operator=(ChannelLayout &&other)
Move assignment; the previous contents are released.
Root namespace of the library.
Definition audioresampler.h:19
AVChannel channel_from_string(const std::string &name)
Look a speaker position up by name.
std::string channel_name(AVChannel channel)
Name of a speaker position.
std::string channel_description(AVChannel channel)
Human-readable description of a speaker position.