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
qandroidcameraframe_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
4#ifndef QANDROIDCAMERAFRAME_H
5#define QANDROIDCAMERAFRAME_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 <QVideoFrameFormat>
19#include <QJniObject>
20
22{
23public:
24 struct Plane
25 {
26 int pixelStride = 0;
27 int rowStride = 0;
28 int size = 0;
29 uint8_t *data;
30 };
31
34
35 QVideoFrameFormat::PixelFormat format() const { return m_pixelFormat; }
36 int numberPlanes() const { return m_numberPlanes; }
37 Plane plane(int index) const
38 {
39 if (index < 0 || index > numberPlanes())
40 return {};
41
42 return m_planes[index];
43 }
44 QSize size() const { return m_size; }
45 long timestamp() const { return m_timestamp; }
46
47 bool isParsed() const { return m_parsed; }
48
49private:
50 bool parse(const QJniObject &frame);
52
53 QSize m_size = {};
54 long m_timestamp = 0;
55 int m_numberPlanes = 0;
56 Plane m_planes[3]; // 3 max number planes
57 jobject m_frame = nullptr;
58 bool m_parsed = false;
59 QImage m_image;
60
61 enum AndroidImageFormat {
62 RAW_SENSOR = 32,
63 YUV_420_888 = 35,
64 RAW_PRIVATE = 36,
65 YUV_422_888 = 39,
66 YUV_444_888 = 40,
67 FLEX_RGB_888 = 41,
68 FLEX_RGBA_8888 = 42,
69 YCBCR_P010 = 54,
70 JPEG = 256,
71 HEIC = 1212500294
72 };
73};
74
75#endif // QANDROIDCAMERAFRAME_H
QVideoFrameFormat::PixelFormat format() const
Plane plane(int index) const
QAndroidCameraFrame(QJniObject frame)
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore
\inmodule QtCore
Definition qsize.h:25
PixelFormat
Enumerates video data types.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
QFrame frame
[0]