1// Copyright (C) 2021 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 QFFmpegMediaFormatInfo_H
5#define QFFmpegMediaFormatInfo_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 <private/qplatformmediaformatinfo_p.h>
19#include <qhash.h>
20#include <qlist.h>
21#include <qaudioformat.h>
22#include "qffmpeg_p.h"
23
24QT_BEGIN_NAMESPACE
25
26class QFFmpegMediaFormatInfo : public QPlatformMediaFormatInfo
27{
28public:
29 QFFmpegMediaFormatInfo();
30 ~QFFmpegMediaFormatInfo();
31
32 static QMediaFormat::VideoCodec videoCodecForAVCodecId(AVCodecID id);
33 static QMediaFormat::AudioCodec audioCodecForAVCodecId(AVCodecID id);
34 static QMediaFormat::FileFormat fileFormatForAVInputFormat(const AVInputFormat *format);
35
36 static const AVOutputFormat *outputFormatForFileFormat(QMediaFormat::FileFormat format);
37
38 static AVCodecID codecIdForVideoCodec(QMediaFormat::VideoCodec codec);
39 static AVCodecID codecIdForAudioCodec(QMediaFormat::AudioCodec codec);
40
41 static QAudioFormat::SampleFormat sampleFormat(AVSampleFormat format);
42 static AVSampleFormat avSampleFormat(QAudioFormat::SampleFormat format);
43
44 static int64_t avChannelLayout(QAudioFormat::ChannelConfig channelConfig);
45 static QAudioFormat::ChannelConfig channelConfigForAVLayout(int64_t avChannelLayout);
46
47 static QAudioFormat audioFormatFromCodecParameters(AVCodecParameters *codecPar);
48};
49
50QT_END_NAMESPACE
51
52#endif
53

source code of qtmultimedia/src/plugins/multimedia/ffmpeg/qffmpegmediaformatinfo_p.h