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
qwindowsd3d11planesplitter_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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#ifndef QWINDOWSD3D11PLANESPLITTER_P_H
4#define QWINDOWSD3D11PLANESPLITTER_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtMultimedia/qtmultimediaexports.h>
18#include <QtMultimedia/qvideoframeformat.h>
19
20#include <QtCore/qsize.h>
21#include <QtCore/private/qcomptr_p.h>
22
23#include <d3d11.h>
24
25#include <memory>
26#include <optional>
27#include <utility>
28#include <vector>
29
30QT_BEGIN_NAMESPACE
31
32namespace QtMultimediaPrivate {
33
34/*! \internal
35 Splits one array slice of a multi-planar D3D11 texture (NV12, P010) into one single-plane
36 texture per plane, cropped to a given frame size, for import into single-plane-only QRhi
37 backends. Planes are copied with a texel-fetch shader because D3D11 rejects direct copies
38 between planar and single-channel formats. Instances are bound to one device: create them
39 with create(), which returns null if the shaders cannot be created.
40*/
41class Q_MULTIMEDIA_EXPORT QWindowsD3D11PlaneSplitter
42{
43public:
45
47
50
56
57 // Splits slice 'subresourceIndex' of 'texture' into one texture per plane, cropped to 'frameSize'
62
63private:
65
67
68 // Returns 'texture' itself when it has shader access, otherwise a cached internal copy.
72
73 ComPtr<ID3D11Device> m_shaderDevice; // device the shaders below were created for
76
77 // Reused across frames; recreated when the device, format or size of the source changes.
79};
80
81} // namespace QtMultimediaPrivate
82
83QT_END_NAMESPACE
84
85#endif // QWINDOWSD3D11PLANESPLITTER_P_H
Combined button and popup list for selecting options.