Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qffmpegavaudioformat_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFFMPEGAVAUDIOFORMAT_P_H
5#define QFFMPEGAVAUDIOFORMAT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtFFmpegMediaPluginImpl/private/qffmpegdefs_p.h>
19#include <QtMultimedia/private/qtmultimediaglobal_p.h>
20
21#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
22[[maybe_unused]] static inline bool operator==(const AVChannelLayout &lhs,
23 const AVChannelLayout &rhs)
24{
25 return lhs.order == rhs.order && lhs.nb_channels == rhs.nb_channels && lhs.u.mask == rhs.u.mask;
26}
27
28[[maybe_unused]] static inline bool operator!=(const AVChannelLayout &lhs,
29 const AVChannelLayout &rhs)
30{
31 return !(lhs == rhs);
32}
33
34#endif
35
36QT_BEGIN_NAMESPACE
37
38class QAudioFormat;
39
40namespace QFFmpeg {
41
43{
44 explicit AVAudioFormat(const AVCodecContext *context);
45 explicit AVAudioFormat(const AVCodecParameters *codecPar);
46 explicit AVAudioFormat(const QAudioFormat &audioFormat);
47
48#if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT
50#else
52#endif
55};
56
57bool operator==(const AVAudioFormat &lhs, const AVAudioFormat &rhs);
58
59inline bool operator!=(const AVAudioFormat &lhs, const AVAudioFormat &rhs)
60{
61 return !(lhs == rhs);
62}
63
65
66} // namespace QFFmpeg
67
68QT_END_NAMESPACE
69
70#endif // QFFMPEGAVAUDIOFORMAT_P_H
The QAudioFormat class stores audio stream parameter information.
constexpr int sampleRate() const noexcept
Returns the current sample rate in Hertz.
bool operator==(const AVAudioFormat &lhs, const AVAudioFormat &rhs)
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)
AVAudioFormat(const AVCodecContext *context)
AVAudioFormat(const QAudioFormat &audioFormat)