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
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/private/qtmultimediaglobal_p.h>
19#include <QtCore/qbytearray.h>
20
21#include <linux/videodev2.h>
22
23#include <memory>
24
25QT_BEGIN_NAMESPACE
26
27namespace QtV4L2 {
28
31
33{
34public:
35 struct Buffer
36 {
37 v4l2_buffer v4l2Buffer = {};
39 };
40
42
43 virtual ~QV4L2MemoryTransfer();
44
46
47 virtual bool enqueueBuffer(quint32 index) = 0;
48
49 virtual quint32 buffersCount() const = 0;
50
51protected:
52 bool enqueueBuffers();
53
54 const QV4L2FileDescriptor &fileDescriptor() const { return *m_fileDescriptor; }
55
56private:
57 QV4L2FileDescriptorPtr m_fileDescriptor;
58};
59
61
63 quint32 imageSize);
64
66
67} // namespace QtV4L2
68
69QT_END_NAMESPACE
70
71#endif // QV4L2MEMORYTRANSFER_P_H
QV4L2MemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor)
virtual bool enqueueBuffer(quint32 index)=0
virtual std::optional< Buffer > dequeueBuffer()=0
const QV4L2FileDescriptor & fileDescriptor() const
virtual quint32 buffersCount() const =0
QV4L2MemoryTransferUPtr makeMMapMemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor)
Q_STATIC_LOGGING_CATEGORY(qLcV4L2Camera, "qt.multimedia.v4l2.camera")
QV4L2MemoryTransferUPtr makeUserPtrMemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor, quint32 imageSize)
std::shared_ptr< QV4L2FileDescriptor > QV4L2FileDescriptorPtr
#define MAP_FAILED