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
25
QT_BEGIN_NAMESPACE
26
27
using
CvPixelFormat =
unsigned
;
28
constexpr
CvPixelFormat
CvPixelFormatInvalid
= 0;
29
30
namespace
QAVFHelpers
31
{
32
33
struct
QSharedCVPixelBufferHandleTraits
34
{
35
using
Type
=
CVPixelBufferRef
;
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
};
48
using
QSharedCVPixelBuffer
=
QtPrivate
::
QSharedHandle
<
QSharedCVPixelBufferHandleTraits
>;
49
50
Q_MULTIMEDIA_EXPORT
QVideoFrameFormat
::
ColorRange
colorRangeForCVPixelFormat
(
CvPixelFormat
cvPixelFormat
);
51
Q_MULTIMEDIA_EXPORT
QVideoFrameFormat
::
PixelFormat
fromCVPixelFormat
(
CvPixelFormat
cvPixelFormat
);
52
Q_MULTIMEDIA_EXPORT CvPixelFormat
toCVPixelFormat
(
QVideoFrameFormat
::
PixelFormat
pixFmt
,
53
QVideoFrameFormat
::
ColorRange
colorRange
);
54
55
Q_MULTIMEDIA_EXPORT QVideoFrameFormat
videoFormatForImageBuffer
(
CVImageBufferRef
buffer
,
bool
openGL
=
false
);
56
};
57
58
QT_END_NAMESPACE
59
60
#
endif
// QAVFHELPERS_P_H
QAVFHelpers
Definition
qavfhelpers_p.h:31
CvPixelFormatInvalid
constexpr CvPixelFormat CvPixelFormatInvalid
Definition
qavfhelpers_p.h:28
QAVFHelpers::QSharedCVPixelBufferHandleTraits
Definition
qavfhelpers_p.h:34
QAVFHelpers::QSharedCVPixelBufferHandleTraits::invalidValue
static constexpr Type invalidValue() noexcept
Definition
qavfhelpers_p.h:36
QAVFHelpers::QSharedCVPixelBufferHandleTraits::ref
static Type ref(Type handle) noexcept
Definition
qavfhelpers_p.h:37
QAVFHelpers::QSharedCVPixelBufferHandleTraits::unref
static bool unref(Type handle) noexcept
Definition
qavfhelpers_p.h:42
qtmultimedia
src
multimedia
darwin
qavfhelpers_p.h
Generated on
for Qt by
1.14.0