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
<
CoreMedia
/
CoreMedia
.
h
>
22
#
include
<
CoreVideo
/
CVBase
.
h
>
23
#
include
<
CoreVideo
/
CVPixelBuffer
.
h
>
24
#
include
<
CoreVideo
/
CVImageBuffer
.
h
>
25
26
#
include
<
chrono
>
27
28
QT_BEGIN_NAMESPACE
29
30
using
CvPixelFormat =
unsigned
;
31
constexpr
CvPixelFormat
CvPixelFormatInvalid
= 0;
32
33
namespace
QAVFHelpers
34
{
35
36
struct
QSharedCVPixelBufferHandleTraits
37
{
38
using
Type
=
CVPixelBufferRef
;
39
static
constexpr
Type
invalidValue
()
noexcept
{
return
nullptr
; }
40
static
Type
ref
(Type handle)
noexcept
41
{
42
CVPixelBufferRetain(handle);
43
return
handle;
44
}
45
static
bool
unref
(Type handle)
noexcept
46
{
47
CVPixelBufferRelease(handle);
48
return
true
;
49
}
50
};
51
using
QSharedCVPixelBuffer
=
QtPrivate
::
QSharedHandle
<
QSharedCVPixelBufferHandleTraits
>;
52
53
Q_MULTIMEDIA_EXPORT
QVideoFrameFormat
::
ColorRange
colorRangeForCVPixelFormat
(
CvPixelFormat
cvPixelFormat
);
54
Q_MULTIMEDIA_EXPORT
QVideoFrameFormat
::
PixelFormat
fromCVPixelFormat
(
CvPixelFormat
cvPixelFormat
);
55
Q_MULTIMEDIA_EXPORT CvPixelFormat
toCVPixelFormat
(
QVideoFrameFormat
::
PixelFormat
pixFmt
,
56
QVideoFrameFormat
::
ColorRange
colorRange
);
57
58
Q_MULTIMEDIA_EXPORT QVideoFrameFormat
videoFormatForImageBuffer
(
CVImageBufferRef
buffer
,
bool
openGL
=
false
);
59
60
[[
nodiscard
]] Q_MULTIMEDIA_EXPORT
std
::chrono::microseconds
CMTimeToMicroseconds
(
const
CMTime
&);
61
62
};
63
64
QT_END_NAMESPACE
65
66
#
endif
// QAVFHELPERS_P_H
QAVFHelpers
Definition
qavfhelpers_p.h:34
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
CvPixelFormatInvalid
constexpr CvPixelFormat CvPixelFormatInvalid
Definition
qavfhelpers_p.h:31
QAVFHelpers::QSharedCVPixelBufferHandleTraits
Definition
qavfhelpers_p.h:37
QAVFHelpers::QSharedCVPixelBufferHandleTraits::invalidValue
static constexpr Type invalidValue() noexcept
Definition
qavfhelpers_p.h:39
QAVFHelpers::QSharedCVPixelBufferHandleTraits::ref
static Type ref(Type handle) noexcept
Definition
qavfhelpers_p.h:40
QAVFHelpers::QSharedCVPixelBufferHandleTraits::unref
static bool unref(Type handle) noexcept
Definition
qavfhelpers_p.h:45
qtmultimedia
src
multimedia
darwin
qavfhelpers_p.h
Generated on
for Qt by
1.16.1