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 "qffmpegdefs_p.h" |
19 | #include <private/qtmultimediaglobal_p.h> |
20 | |
21 | #if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT |
22 | inline bool operator==(const AVChannelLayout &lhs, const AVChannelLayout &rhs) |
23 | { |
24 | return lhs.order == rhs.order && lhs.nb_channels == rhs.nb_channels && lhs.u.mask == rhs.u.mask; |
25 | } |
26 | |
27 | inline bool operator!=(const AVChannelLayout &lhs, const AVChannelLayout &rhs) |
28 | { |
29 | return !(lhs == rhs); |
30 | } |
31 | |
32 | #endif |
33 | |
34 | QT_BEGIN_NAMESPACE |
35 | |
36 | class QAudioFormat; |
37 | |
38 | namespace QFFmpeg { |
39 | |
40 | struct AVAudioFormat |
41 | { |
42 | AVAudioFormat(const AVCodecContext *context); |
43 | |
44 | AVAudioFormat(const AVCodecParameters *codecPar); |
45 | |
46 | AVAudioFormat(const QAudioFormat &audioFormat); |
47 | |
48 | #if QT_FFMPEG_HAS_AV_CHANNEL_LAYOUT |
49 | AVChannelLayout channelLayout; |
50 | #else |
51 | uint64_t channelLayoutMask; |
52 | #endif |
53 | AVSampleFormat sampleFormat; |
54 | int sampleRate; |
55 | }; |
56 | |
57 | bool operator==(const AVAudioFormat &lhs, const AVAudioFormat &rhs); |
58 | |
59 | inline bool operator!=(const AVAudioFormat &lhs, const AVAudioFormat &rhs) |
60 | { |
61 | return !(lhs == rhs); |
62 | } |
63 | |
64 | QDebug operator<<(QDebug, const AVAudioFormat &); |
65 | |
66 | } // namespace QFFmpeg |
67 | |
68 | QT_END_NAMESPACE |
69 | |
70 | #endif // QFFMPEGAVAUDIOFORMAT_P_H |
71 | |