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
qwindowsmediafoundation_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#ifndef QWINDOWSMEDIAFOUNDATION_H
5#define QWINDOWSMEDIAFOUNDATION_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/qtmultimediaglobal_p.h>
19#include <QtCore/private/qsystemlibrary_p.h>
20
21#include <mfapi.h>
22#include <mfidl.h>
23#include <mfreadwrite.h>
24
25QT_BEGIN_NAMESPACE
26
27class QWindowsMediaFoundation
28{
29public:
30 static QWindowsMediaFoundation *instance();
31
32 QWindowsMediaFoundation();
33 ~QWindowsMediaFoundation();
34
35 bool valid() const;
36
37 decltype(&::MFStartup) mfStartup = nullptr;
38 decltype(&::MFShutdown) mfShutdown = nullptr;
39 decltype(&::MFCreateMediaType) mfCreateMediaType = nullptr;
40 decltype(&::MFCreateMemoryBuffer) mfCreateMemoryBuffer = nullptr;
41 decltype(&::MFCreateSample) mfCreateSample = nullptr;
42 decltype(&::MFCreateAttributes) mfCreateAttributes = nullptr;
43 decltype(&::MFEnumDeviceSources) mfEnumDeviceSources = nullptr;
44 decltype(&::MFCreateSourceReaderFromMediaSource) mfCreateSourceReaderFromMediaSource = nullptr;
45
46private:
47 QSystemLibrary m_mfplat{ QStringLiteral("Mfplat.dll") };
48 QSystemLibrary m_mf{ QStringLiteral("Mf.dll") };
49 QSystemLibrary m_mfreadwrite{ QStringLiteral("Mfreadwrite.dll") };
50 bool m_valid = false;
51};
52
54{
56public:
59
60private:
61 QWindowsMediaFoundation *m_wmf;
62 HRESULT m_initResult;
63};
64
65QT_END_NAMESPACE
66
67#endif // QWINDOWSMEDIAFOUNDATION_H
Q_GLOBAL_STATIC(QWindowsMediaFoundation, s_wmf)
bool setProcAddress(QSystemLibrary &lib, T &f, const char name[])