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
qlibcamera_stream_p.h
Go to the documentation of this file.
1
// Copyright (C) 2026 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
QLIBCAMERA_STREAM_P_H
4
#
define
QLIBCAMERA_STREAM_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
/
qvideoframe
.
h
>
18
#
include
<
QtMultimedia
/
qvideoframeformat
.
h
>
19
#
include
<
QtCore
/
private
/
qexpected_p
.
h
>
20
#
include
<
QtCore
/
qmutex
.
h
>
21
#
include
<
QtCore
/
qobject
.
h
>
22
23
#
include
<
libcamera
/
controls
.
h
>
24
25
#
include
<
chrono
>
26
#
include
<
mutex
>
27
#
include
<
optional
>
28
29
namespace
libcamera
{
30
class
Camera;
31
class
FrameBuffer;
32
class
Request;
33
class
Stream;
34
}
// namespace libcamera
35
36
QT_BEGIN_NAMESPACE
37
38
namespace
QLibCamera
{
39
40
class
QLibCameraCameraStream
final
:
public
QObject
41
{
42
Q_OBJECT
43
public
:
44
QLibCameraCameraStream
(
std
::
shared_ptr
<
libcamera
::
Camera
>,
libcamera
::
Stream
*,
45
int
bytesPerLine
,
QVideoFrameFormat
,
double
maxFrameRate
);
46
47
// Runs on libcamera's CameraManager thread -- see the class comment above.
48
void
handleRequestCompleted
(
libcamera
::Request *);
49
50
template
<
typename
Fn>
51
void
withPendingControls
(Fn &&fn)
52
{
53
std
::lock_guard lock(m_controlsMutex);
54
fn(m_pendingControls);
55
}
56
57
libcamera
::Stream *
stream
()
const
{
return
m_stream; }
58
59
Q_SIGNALS
:
60
void
newVideoFrame
(
const
QVideoFrame
&);
61
62
private
:
63
const
std::shared_ptr<libcamera::Camera> m_libcameraCamera;
64
libcamera
::Stream *
const
m_stream;
65
const
int
m_bytesPerLine;
66
const
QVideoFrameFormat m_frameFormat;
67
const
double
m_maxFrameRate;
68
69
std
::optional<
std
::chrono::nanoseconds> m_firstFrameTimestamp;
70
71
QMutex m_controlsMutex;
72
libcamera::ControlList m_pendingControls;
73
};
74
75
}
// namespace QLibCamera
76
77
QT_END_NAMESPACE
78
79
#
endif
// QLIBCAMERA_STREAM_P_H
QLibCamera::QLibCameraCameraStream::withPendingControls
void withPendingControls(Fn &&fn)
Definition
qlibcamera_stream_p.h:51
QLibCamera::QLibCameraCameraStream::handleRequestCompleted
void handleRequestCompleted(libcamera::Request *)
Definition
qlibcamera_stream.cpp:77
QLibCamera::QLibCameraCameraStream::QLibCameraCameraStream
QLibCameraCameraStream(std::shared_ptr< libcamera::Camera >, libcamera::Stream *, int bytesPerLine, QVideoFrameFormat, double maxFrameRate)
Definition
qlibcamera_stream.cpp:66
QLibCamera::QLibCameraCameraStream::stream
libcamera::Stream * stream() const
Definition
qlibcamera_stream_p.h:57
QLibCamera::QLibCameraCamera::setExposureCompensation
void setExposureCompensation(float compensation) override
Definition
qlibcamera_camera.cpp:394
QLibCamera::QLibCameraCamera::setManualIsoSensitivity
void setManualIsoSensitivity(int iso) override
Definition
qlibcamera_camera.cpp:402
QLibCamera::QLibCameraCamera::setActive
void setActive(bool active) override
Definition
qlibcamera_camera.cpp:79
QLibCamera::QLibCameraCamera::setCamera
void setCamera(const QCameraDevice &) override
Definition
qlibcamera_camera.cpp:99
QLibCamera::QLibCameraCamera::setManualExposureTime
void setManualExposureTime(float seconds) override
Definition
qlibcamera_camera.cpp:410
QLibCamera::QLibCameraCamera::setCameraFormat
bool setCameraFormat(const QCameraFormat &) override
Definition
qlibcamera_camera.cpp:125
QLibCamera::QLibCameraCamera::zoomTo
void zoomTo(float newZoomFactor, float rate=-1.) override
Definition
qlibcamera_camera.cpp:436
QLibCamera::QLibCameraCamera::~QLibCameraCamera
~QLibCameraCamera() override
Definition
qlibcamera_camera.cpp:57
QLibCamera::QLibCameraCamera::setExposureMode
void setExposureMode(QCamera::ExposureMode) override
Definition
qlibcamera_camera.cpp:379
QLibCamera::QLibCameraCamera::frameFormat
QVideoFrameFormat frameFormat() const override
Definition
qlibcamera_camera.cpp:447
QLibCamera::QLibCameraCamera::cameraPixelFormatScore
int cameraPixelFormatScore(QVideoFrameFormat::PixelFormat, QVideoFrameFormat::ColorRange) const override
Definition
qlibcamera_camera.cpp:62
QLibCamera::QLibCameraCamera::setColorTemperature
void setColorTemperature(int temperature) override
Definition
qlibcamera_camera.cpp:428
QLibCamera::QLibCameraCamera::isActive
bool isActive() const override
Definition
qlibcamera_camera_p.h:47
QLibCamera::QLibCameraCamera::setWhiteBalanceMode
void setWhiteBalanceMode(QCamera::WhiteBalanceMode) override
Definition
qlibcamera_camera.cpp:418
QLibCamera::QLibCameraCamera::isExposureModeSupported
bool isExposureModeSupported(QCamera::ExposureMode mode) const override
Definition
qlibcamera_camera.cpp:389
QLibCamera::QLibCameraInstance
Definition
qlibcamera_instance_p.h:32
QLibCamera::QLibCameraControls
Definition
qlibcamera_controls.cpp:16
QLibCamera::QLibCameraControls::setExposureCompensation
void setExposureCompensation(ControlList &pending, float stops)
Definition
qlibcamera_controls.cpp:48
QLibCamera::QLibCameraControls::setAnalogueGainForIso
void setAnalogueGainForIso(ControlList &pending, int iso)
Definition
qlibcamera_controls.cpp:53
QLibCamera::QLibCameraControls::setAwbEnable
void setAwbEnable(ControlList &pending, bool enable)
Definition
qlibcamera_controls.cpp:60
QLibCamera::QLibCameraControls::setZoomFactor
void setZoomFactor(ControlList &pending, const ControlInfoMap &controls, float zoomFactor)
Definition
qlibcamera_controls.cpp:71
QLibCamera::QLibCameraControls::setColorTemperature
void setColorTemperature(ControlList &pending, int kelvin)
Definition
qlibcamera_controls.cpp:65
QLibCamera::QLibCameraControls::setManualExposureTime
void setManualExposureTime(ControlList &pending, float seconds)
Definition
qlibcamera_controls.cpp:41
QLibCamera::QLibCameraControls::setAeEnable
void setAeEnable(ControlList &pending, bool enable)
Definition
qlibcamera_controls.cpp:36
QLibCamera::QLibCameraFormatSupport
Definition
qlibcamera_format_support.cpp:26
QLibCamera
Definition
qplatformlibcameraintegration.cpp:13
libcamera
Definition
qlibcamera_camera_p.h:27
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtmultimedia
src
plugins
libcamera
qlibcamera_stream_p.h
Generated on
for Qt by
1.18.0