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
4
#
include
"qohoscamera_p.h"
5
6
#
include
"qohoscamerasession_p.h"
7
#
include
"qohosmediacapturesession_p.h"
8
9
QT_BEGIN_NAMESPACE
10
11
QOhosCamera
::
QOhosCamera
(
QCamera
*
camera
)
12
: QPlatformCamera(camera), m_session(std::make_unique<QOhosCameraSession>(
this
))
13
{
14
connect(m_session.get(), &QOhosCameraSession::activeChanged,
this
, &QOhosCamera::activeChanged);
15
}
16
17
QOhosCamera
::~
QOhosCamera
() =
default
;
18
19
bool
QOhosCamera
::
isActive
()
const
20
{
21
return
m_session->isActive();
22
}
23
24
void
QOhosCamera
::
setActive
(
bool
active)
25
{
26
m_session->setActive(active);
27
}
28
29
void
QOhosCamera
::
setCamera
(
const
QCameraDevice &camera)
30
{
31
m_session->setCamera(camera);
32
}
33
34
bool
QOhosCamera
::
setCameraFormat
(
const
QCameraFormat &format)
35
{
36
m_cameraFormat = format;
37
m_session->setCameraFormat(format);
38
return
true
;
39
}
40
41
void
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
48
QT_END_NAMESPACE
49
50
#
include
"moc_qohoscamera_p.cpp"
QCamera
The QCamera class provides interface for system camera devices.
Definition
qcamera.h:25
QOhosCamera
Definition
qohoscamera_p.h:28
QOhosCamera::setCameraFormat
bool setCameraFormat(const QCameraFormat &format) override
Definition
qohoscamera.cpp:34
QOhosCamera::setCaptureSession
void setCaptureSession(QPlatformMediaCaptureSession *session) override
Definition
qohoscamera.cpp:41
QOhosCamera::setCamera
void setCamera(const QCameraDevice &camera) override
Definition
qohoscamera.cpp:29
QOhosCamera::setActive
void setActive(bool active) override
Definition
qohoscamera.cpp:24
QOhosCamera::isActive
bool isActive() const override
Definition
qohoscamera.cpp:19
QOhosCamera::~QOhosCamera
~QOhosCamera() override
QOhosMediaCaptureSession
Definition
qohosmediacapturesession_p.h:30
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtmultimedia
src
plugins
multimedia
ohos
mediacapture
qohoscamera.cpp
Generated on
for Qt by
1.16.1