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
qffmpeghwaccel_videotoolbox_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#ifndef QFFMPEGHWACCEL_VIDEOTOOLBOX_P_H
4#define QFFMPEGHWACCEL_VIDEOTOOLBOX_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 <QtFFmpegMediaPluginImpl/private/qffmpeghwaccel_p.h>
18
19#ifdef Q_OS_DARWIN
20
21#include <QtCore/private/qcore_mac_p.h>
22
23#include <CoreVideo/CVBase.h>
24
25#include <CoreVideo/CVPixelBuffer.h>
26#include <CoreVideo/CVImageBuffer.h>
27#include <CoreVideo/CVMetalTexture.h>
28#include <CoreVideo/CVMetalTextureCache.h>
29#if defined(Q_OS_MACOS)
30#include <CoreVideo/CVOpenGLTextureCache.h>
31#elif defined(Q_OS_IOS)
32#include <CoreVideo/CVOpenGLESTextureCache.h>
33#endif
34
35// forward-declare CVMetalTextureCacheRef for non-Objective C code
36#if !defined(__OBJC__)
37typedef struct CV_BRIDGED_TYPE(id)
38 __CVMetalTextureCache *CVMetalTextureCacheRef CV_SWIFT_NONSENDABLE;
39#endif
40
41QT_BEGIN_NAMESPACE
42
43class QRhi;
44
45namespace QFFmpeg {
46
47class VideoToolBoxTextureConverter : public TextureConverterBackend
48{
49public:
50 VideoToolBoxTextureConverter(QRhi *rhi);
51 ~VideoToolBoxTextureConverter();
52 QVideoFrameTexturesHandlesUPtr
53 createTextureHandles(AVFrame *frame, QVideoFrameTexturesHandlesUPtr oldHandles) override;
54
55private:
56 void freeTextureCaches();
57
58 QCFType<CVMetalTextureCacheRef> cvMetalTextureCache;
59#if defined(Q_OS_MACOS)
60 QCFType<CVOpenGLTextureCacheRef> cvOpenGLTextureCache;
61#elif defined(Q_OS_IOS)
62 QCFType<CVOpenGLESTextureCacheRef> cvOpenGLESTextureCache;
63#endif
64};
65
66}
67
68QT_END_NAMESPACE
69
70#endif
71
72#endif