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 <CoreVideo/CVBase.h>
22#include <CoreVideo/CVPixelBuffer.h>
23#include <CoreVideo/CVImageBuffer.h>
24
25#include <CoreVideo/CVMetalTexture.h>
26#if defined(Q_OS_MACOS)
27#include <CoreVideo/CVOpenGLTextureCache.h>
28#elif defined(Q_OS_IOS)
29#include <CoreVideo/CVOpenGLESTextureCache.h>
30#endif
31
32QT_BEGIN_NAMESPACE
33
34class QRhi;
35
36namespace QFFmpeg {
37
38class VideoToolBoxTextureConverter : public TextureConverterBackend
39{
40public:
41 VideoToolBoxTextureConverter(QRhi *rhi);
42 ~VideoToolBoxTextureConverter();
43 QVideoFrameTexturesHandlesUPtr
44 createTextureHandles(AVFrame *frame, QVideoFrameTexturesHandlesUPtr oldHandles) override;
45
46private:
47 void freeTextureCaches();
48
49 // can not forward declare that type from C++ :/
50 void *cvMetalTextureCache = nullptr;
51#if defined(Q_OS_MACOS)
52 CVOpenGLTextureCacheRef cvOpenGLTextureCache = nullptr;
53#elif defined(Q_OS_IOS)
54 CVOpenGLESTextureCacheRef cvOpenGLESTextureCache = nullptr;
55#endif
56};
57
58}
59
60QT_END_NAMESPACE
61
62#endif
63
64#endif