8#include <QtCore/qdebug.h>
11#include <libavutil/opt.h>
21#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
22 channelLayout = context->ch_layout;
24 if (context->channel_layout) {
25 channelLayoutMask = context->channel_layout;
27 const auto channelConfig =
28 QAudioFormat::defaultChannelConfigForChannelCount(context->channels);
29 channelLayoutMask = QFFmpegMediaFormatInfo::avChannelLayout(channelConfig);
37#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
38 channelLayout = codecPar->ch_layout;
40 if (codecPar->channel_layout) {
41 channelLayoutMask = codecPar->channel_layout;
43 const auto channelConfig =
44 QAudioFormat::defaultChannelConfigForChannelCount(codecPar->channels);
45 channelLayoutMask = QFFmpegMediaFormatInfo::avChannelLayout(channelConfig);
54 const auto channelConfig = audioFormat.channelConfig() == QAudioFormat::ChannelConfigUnknown
55 ? QAudioFormat::defaultChannelConfigForChannelCount(audioFormat.channelCount())
56 : audioFormat.channelConfig();
58 const auto mask = QFFmpegMediaFormatInfo::avChannelLayout(channelConfig);
60#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
61 av_channel_layout_from_mask(&channelLayout, mask);
63 channelLayoutMask = mask;
70#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
71 lhs.channelLayout == rhs.channelLayout
73 lhs.channelLayoutMask == rhs.channelLayoutMask
81 const char *sampleFormatName = av_get_sample_fmt_name(format.sampleFormat);
82 dbg <<
"sample format:" << (sampleFormatName ? sampleFormatName :
"unknown");
85#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
86 dbg <<
", channel layout:" << format.channelLayout;
88 dbg <<
"channel layout:" << Qt::bin << format.channelLayoutMask << Qt::dec;
bool operator==(const AVAudioFormat &lhs, const AVAudioFormat &rhs)
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
QDebug operator<<(QDebug dbg, const AVAudioFormat &format)