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
qwindowsd3d11texturebridge_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 QWINDOWSD3D11TEXTUREBRIDGE_P_H
4#define QWINDOWSD3D11TEXTUREBRIDGE_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
19#include <QtCore/qsize.h>
20#include <QtCore/private/qcomptr_p.h>
21#include <QtCore/private/quniquehandle_types_p.h>
22
23#include <d3d11.h>
24#include <d3d11_1.h>
25
26QT_BEGIN_NAMESPACE
27
28namespace QtMultimediaPrivate {
29
30/*! \internal Utility class for synchronized transfer of a texture between two D3D devices
31 *
32 * This class is used to copy a texture from one device to another device. This
33 * is implemented using a shared texture, along with keyed mutexes to synchronize
34 * access to the texture.
35 *
36 * This is needed because the source and destination may use different D3D devices,
37 * for example when copying a decoded frame owned by FFmpeg or the Windows Media
38 * Foundation media engine into a texture usable by RHI.
39 */
40class Q_MULTIMEDIA_EXPORT QWindowsD3D11TextureBridge final
41{
42public:
43 /** Copy a texture slice at position 'index' belonging to device 'dev'
44 * into a shared texture, limiting the texture size to the frame size */
46 const QSize &frameSize, UINT index = 0);
48 const ComPtr<ID3D11Texture2D> &, const QSize &frameSize, UINT index = 0);
49
50 // Obtain a copy of the texture on a second device.
53
54 // Obtain a copy of the texture on a second device into a caller-provided destination texture.
57
58private:
61 const QSize &frameSize);
63 const QSize &frameSize) const;
65
67
68 static constexpr UINT kSrcKey = 0;
69 static constexpr UINT kDestKey = 1;
70
73
77
79};
80
81} // namespace QtMultimediaPrivate
82
83QT_END_NAMESPACE
84
85#endif
Combined button and popup list for selecting options.
static constexpr DWORD kMutexTimeoutMs