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
qavfhelpers_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QAVFHELPERS_P_H
4#define QAVFHELPERS_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/private/qsharedhandle_p.h>
18#include <QtMultimedia/qvideoframe.h>
19#include <QtMultimedia/qvideoframeformat.h>
20
21#include <CoreVideo/CVBase.h>
22#include <CoreVideo/CVPixelBuffer.h>
23#include <CoreVideo/CVImageBuffer.h>
24
25QT_BEGIN_NAMESPACE
26
27using CvPixelFormat = unsigned;
29
30namespace QAVFHelpers
31{
32
34{
36 static constexpr Type invalidValue() noexcept { return nullptr; }
37 static Type ref(Type handle) noexcept
38 {
39 CVPixelBufferRetain(handle);
40 return handle;
41 }
42 static bool unref(Type handle) noexcept
43 {
44 CVPixelBufferRelease(handle);
45 return true;
46 }
47};
49
52Q_MULTIMEDIA_EXPORT CvPixelFormat toCVPixelFormat(QVideoFrameFormat::PixelFormat pixFmt,
54
55Q_MULTIMEDIA_EXPORT QVideoFrameFormat videoFormatForImageBuffer(CVImageBufferRef buffer, bool openGL = false);
56};
57
58QT_END_NAMESPACE
59
60#endif // QAVFHELPERS_P_H
constexpr CvPixelFormat CvPixelFormatInvalid
static constexpr Type invalidValue() noexcept
static Type ref(Type handle) noexcept
static bool unref(Type handle) noexcept