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
qohoscamera.cpp
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
5
8
10
12 : QPlatformCamera(camera), m_session(std::make_unique<QOhosCameraSession>(this))
13{
14 connect(m_session.get(), &QOhosCameraSession::activeChanged, this, &QOhosCamera::activeChanged);
15}
16
17QOhosCamera::~QOhosCamera() = default;
18
19bool QOhosCamera::isActive() const
20{
21 return m_session->isActive();
22}
23
24void QOhosCamera::setActive(bool active)
25{
26 m_session->setActive(active);
27}
28
29void QOhosCamera::setCamera(const QCameraDevice &camera)
30{
31 m_session->setCamera(camera);
32}
33
34bool QOhosCamera::setCameraFormat(const QCameraFormat &format)
35{
36 m_cameraFormat = format;
37 m_session->setCameraFormat(format);
38 return true;
39}
40
41void QOhosCamera::setCaptureSession(QPlatformMediaCaptureSession *session)
42{
43 m_captureSession = static_cast<QOhosMediaCaptureSession *>(session);
44 QVideoSink *sink = m_captureSession ? m_captureSession->videoSink() : nullptr;
45 m_session->setVideoSink(sink);
46}
47
48QT_END_NAMESPACE
49
50#include "moc_qohoscamera_p.cpp"
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
bool setCameraFormat(const QCameraFormat &format) override
void setCaptureSession(QPlatformMediaCaptureSession *session) override
void setCamera(const QCameraDevice &camera) override
void setActive(bool active) override
bool isActive() const override
~QOhosCamera() override
Combined button and popup list for selecting options.