Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qv4l2memorytransfer_p.h
Go to the documentation of this file.
1
// Copyright (C) 2023 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
4
#
ifndef
QV4L2MEMORYTRANSFER_P_H
5
#
define
QV4L2MEMORYTRANSFER_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtMultimedia
/
qabstractvideobuffer
.
h
>
19
#
include
<
QtMultimedia
/
private
/
qtmultimediaglobal_p
.
h
>
20
#
include
<
QtCore
/
qtypes
.
h
>
21
#
include
<
QtCore
/
private
/
qexpected_p
.
h
>
22
23
#
include
<
linux
/
videodev2
.
h
>
24
#
include
<
sys
/
time
.
h
>
25
26
#
include
<
memory
>
27
#
include
<
optional
>
28
29
QT_BEGIN_NAMESPACE
30
31
namespace
QtV4L2
{
32
33
class
QV4L2FileDescriptor
;
34
using
QV4L2FileDescriptorPtr
=
std
::shared_ptr<
QV4L2FileDescriptor
>;
35
36
class
QV4L2MemoryTransfer
37
{
38
public
:
39
struct
Frame
40
{
41
timeval
timestamp
= {};
42
std
::
unique_ptr
<
QAbstractVideoBuffer
>
videoBuffer
;
43
};
44
45
QV4L2MemoryTransfer
(
QV4L2FileDescriptorPtr
fileDescriptor);
46
47
virtual
~
QV4L2MemoryTransfer
();
48
49
virtual
std
::optional<
Frame
>
dequeueFrame
() = 0;
50
51
virtual
quint32
buffersCount
()
const
= 0;
52
53
protected
:
54
virtual
bool
enqueueBuffer
(quint32 index) = 0;
55
56
bool
enqueueBuffers
();
57
58
q23
::
expected
<
int
,
std
::
error_code
>
ioctl
(
int
request,
void
*arg);
59
const
QV4L2FileDescriptor
&
fileDescriptor
()
const
{
return
*m_fileDescriptor; }
60
61
private
:
62
QV4L2FileDescriptorPtr
m_fileDescriptor;
63
};
64
65
using
QV4L2MemoryTransferUPtr
=
std
::
unique_ptr
<
QV4L2MemoryTransfer
>;
66
67
QV4L2MemoryTransferUPtr
makeUserPtrMemoryTransfer
(
QV4L2FileDescriptorPtr
fileDescriptor,
68
const
v4l2_pix_format &format);
69
70
QV4L2MemoryTransferUPtr
makeMMapMemoryTransfer
(
QV4L2FileDescriptorPtr
fileDescriptor,
71
const
v4l2_pix_format &format);
72
73
#
if
QT_CONFIG
(
linux_dmabuf
)
74
QV4L2MemoryTransferUPtr
makeDmaBufMemoryTransfer
(
const
QV4L2FileDescriptorPtr
&
fileDescriptor
,
75
const
v4l2_pix_format
&
format
);
76
#
endif
77
78
}
// namespace QtV4L2
79
80
QT_END_NAMESPACE
81
82
#
endif
// QV4L2MEMORYTRANSFER_P_H
QtV4L2::QV4L2FileDescriptor
Definition
qv4l2filedescriptor_p.h:33
QtV4L2::QV4L2MemoryTransfer
Definition
qv4l2memorytransfer_p.h:37
QtV4L2::QV4L2MemoryTransfer::QV4L2MemoryTransfer
QV4L2MemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor)
Definition
qv4l2memorytransfer.cpp:356
QtV4L2::QV4L2MemoryTransfer::enqueueBuffers
bool enqueueBuffers()
Definition
qv4l2memorytransfer.cpp:368
QtV4L2::QV4L2MemoryTransfer::enqueueBuffer
virtual bool enqueueBuffer(quint32 index)=0
QtV4L2::QV4L2MemoryTransfer::dequeueFrame
virtual std::optional< Frame > dequeueFrame()=0
QtV4L2::QV4L2MemoryTransfer::fileDescriptor
const QV4L2FileDescriptor & fileDescriptor() const
Definition
qv4l2memorytransfer_p.h:59
QtV4L2::QV4L2MemoryTransfer::ioctl
q23::expected< int, std::error_code > ioctl(int request, void *arg)
Definition
qv4l2memorytransfer.cpp:377
QtV4L2::QV4L2MemoryTransfer::~QV4L2MemoryTransfer
virtual ~QV4L2MemoryTransfer()
Definition
qv4l2memorytransfer.cpp:363
QtV4L2::QV4L2MemoryTransfer::buffersCount
virtual quint32 buffersCount() const =0
QtV4L2
Definition
qv4l2camera.cpp:22
QtV4L2::makeUserPtrMemoryTransfer
QV4L2MemoryTransferUPtr makeUserPtrMemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor, const v4l2_pix_format &format)
Definition
qv4l2memorytransfer.cpp:382
QtV4L2::Q_STATIC_LOGGING_CATEGORY
Q_STATIC_LOGGING_CATEGORY(qLcV4L2Camera, "qt.multimedia.v4l2.camera")
QtV4L2::makeMMapMemoryTransfer
QV4L2MemoryTransferUPtr makeMMapMemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor, const v4l2_pix_format &format)
Definition
qv4l2memorytransfer.cpp:389
QtV4L2::QV4L2FileDescriptorPtr
std::shared_ptr< QV4L2FileDescriptor > QV4L2FileDescriptorPtr
Definition
qv4l2memorytransfer_p.h:34
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
MAP_FAILED
#define MAP_FAILED
Definition
qresource.cpp:1189
QtV4L2::QV4L2MemoryTransfer::Frame
Definition
qv4l2memorytransfer_p.h:40
QtV4L2::QV4L2MemoryTransfer::Frame::timestamp
timeval timestamp
Definition
qv4l2memorytransfer_p.h:41
QtV4L2::QV4L2MemoryTransfer::Frame::videoBuffer
std::unique_ptr< QAbstractVideoBuffer > videoBuffer
Definition
qv4l2memorytransfer_p.h:42
qtmultimedia
src
multimedia
v4l2
qv4l2memorytransfer_p.h
Generated on
for Qt by
1.18.0