Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsresampler_p.h
Go to the documentation of this file.
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
5#ifndef QT_QWINDOWSRESAMPLER_H
6#define QT_QWINDOWSRESAMPLER_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <qbytearray.h>
20#include <qbytearrayview.h>
21#include <qaudioformat.h>
22#include <private/qcomptr_p.h>
23#include <private/qwindowsmediafoundation_p.h>
24#include <qt_windows.h>
25#include <mftransform.h>
26#include <QtCore/private/qfunctions_win_p.h>
27
28struct IMFSample;
29struct IMFTransform;
30
32
34
35class Q_MULTIMEDIA_EXPORT QWindowsResampler
36{
37public:
40
41 bool setup(const QAudioFormat &in, const QAudioFormat &out);
42
43 QByteArray resample(const QByteArrayView &in);
44 QByteArray resample(IMFSample *sample);
45
46 QAudioFormat inputFormat() const { return m_inputFormat; }
47 QAudioFormat outputFormat() const { return m_outputFormat; }
48
49 quint64 outputBufferSize(quint64 inputBufferSize) const;
50 quint64 inputBufferSize(quint64 outputBufferSize) const;
51
52 quint64 totalInputBytes() const { return m_totalInputBytes; }
53 quint64 totalOutputBytes() const { return m_totalOutputBytes; }
54
55private:
56 HRESULT processInput(const QByteArrayView &in);
58
59 QComHelper m_comRuntime;
61 QMFRuntimeInit m_wmfRuntime{ m_wmf };
62 ComPtr<IMFTransform> m_resampler;
63
64 bool m_resamplerNeedsSampleBuffer = false;
65 quint64 m_totalInputBytes = 0;
66 quint64 m_totalOutputBytes = 0;
67 QAudioFormat m_inputFormat;
68 QAudioFormat m_outputFormat;
69
70 DWORD m_inputStreamID = 0;
71};
72
74
75#endif // QT_QWINDOWSRESAMPLER_H
The QAudioFormat class stores audio stream parameter information.
\inmodule QtCore
Definition qbytearray.h:57
static QWindowsMediaFoundation * instance()
quint64 totalInputBytes() const
QAudioFormat inputFormat() const
quint64 totalOutputBytes() const
QAudioFormat outputFormat() const
Combined button and popup list for selecting options.
static void processOutput(QString *html)
Process the string obtained from start mark to end mark. This is duplicated from QtC's Utils::HtmlExt...
GLuint in
unsigned long long quint64
Definition qtypes.h:61
long HRESULT
QTextStream out(stdout)
[7]