Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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#include <private/qtmultimediaglobal_p.h>
8#include <qbytearray.h>
9#include <linux/videodev2.h>
10
11#include <memory>
12
14
15//
16// W A R N I N G
17// -------------
18//
19// This file is not part of the Qt API. It exists purely as an
20// implementation detail. This header file may change from version to
21// version without notice, or even be removed.
22//
23// We mean it.
24//
25
27using QV4L2FileDescriptorPtr = std::shared_ptr<QV4L2FileDescriptor>;
28
30{
31public:
32 struct Buffer
33 {
34 v4l2_buffer v4l2Buffer = {};
36 };
37
39
40 virtual ~QV4L2MemoryTransfer();
41
42 virtual std::optional<Buffer> dequeueBuffer() = 0;
43
44 virtual bool enqueueBuffer(quint32 index) = 0;
45
46 virtual quint32 buffersCount() const = 0;
47
48protected:
49 bool enqueueBuffers();
50
51 const QV4L2FileDescriptor &fileDescriptor() const { return *m_fileDescriptor; }
52
53private:
54 QV4L2FileDescriptorPtr m_fileDescriptor;
55};
56
57using QV4L2MemoryTransferUPtr = std::unique_ptr<QV4L2MemoryTransfer>;
58
61
63
65
66#endif // QV4L2MEMORYTRANSFER_P_H
\inmodule QtCore
Definition qbytearray.h:57
const QV4L2FileDescriptor & fileDescriptor() const
QV4L2MemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor)
virtual quint32 buffersCount() const =0
virtual bool enqueueBuffer(quint32 index)=0
virtual std::optional< Buffer > dequeueBuffer()=0
Combined button and popup list for selecting options.
GLuint index
[2]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
unsigned int quint32
Definition qtypes.h:50
std::unique_ptr< QV4L2MemoryTransfer > QV4L2MemoryTransferUPtr
QV4L2MemoryTransferUPtr makeUserPtrMemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor, quint32 imageSize)
std::shared_ptr< QV4L2FileDescriptor > QV4L2FileDescriptorPtr
QV4L2MemoryTransferUPtr makeMMapMemoryTransfer(QV4L2FileDescriptorPtr fileDescriptor)