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
qohosmediacapturesession.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
10
12
13QOhosMediaCaptureSession::QOhosMediaCaptureSession() = default;
14
16
18{
19 return m_camera;
20}
21
22void QOhosMediaCaptureSession::setCamera(QPlatformCamera *camera)
23{
24 m_camera = static_cast<QOhosCamera *>(camera);
25 if (m_camera)
26 m_camera->setCaptureSession(this);
27 if (m_imageCapture)
28 m_imageCapture->setCaptureSession(this);
29 if (m_recorder)
30 m_recorder->setCaptureSession(this);
31 emit cameraChanged();
32}
33
35{
36 return m_camera ? m_camera->session() : nullptr;
37}
38
40{
41 return m_imageCapture;
42}
43
44void QOhosMediaCaptureSession::setImageCapture(QPlatformImageCapture *imageCapture)
45{
46 if (m_imageCapture == imageCapture)
47 return;
48 if (m_imageCapture)
49 m_imageCapture->setCaptureSession(nullptr);
50 m_imageCapture = static_cast<QOhosImageCapture *>(imageCapture);
51 if (m_imageCapture)
52 m_imageCapture->setCaptureSession(this);
53 emit imageCaptureChanged();
54}
55
60
61void QOhosMediaCaptureSession::setMediaRecorder(QPlatformMediaRecorder *recorder)
62{
63 if (m_recorder == recorder)
64 return;
65 if (m_recorder)
66 m_recorder->setCaptureSession(nullptr);
67 m_recorder = static_cast<QOhosMediaRecorder *>(recorder);
68 if (m_recorder)
69 m_recorder->setCaptureSession(this);
70 emit encoderChanged();
71}
72
73void QOhosMediaCaptureSession::setAudioInput(QPlatformAudioInput *input)
74{
75 m_audioInput = input;
76}
77
78void QOhosMediaCaptureSession::setAudioOutput(QPlatformAudioOutput *output)
79{
80 m_audioOutput = output;
81}
82
84{
85 if (m_videoSink == sink)
86 return;
87 m_videoSink = sink;
88 if (m_camera)
89 m_camera->setCaptureSession(this);
90}
91
92QT_END_NAMESPACE
93
94#include "moc_qohosmediacapturesession_p.cpp"
void setCamera(QPlatformCamera *camera) override
void setAudioInput(QPlatformAudioInput *input) override
void setImageCapture(QPlatformImageCapture *imageCapture) override
void setVideoPreview(QVideoSink *sink) override
QPlatformCamera * camera() override
void setAudioOutput(QPlatformAudioOutput *output) override
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
QOhosCameraSession * cameraSession() const
QPlatformMediaRecorder * mediaRecorder() override
QPlatformImageCapture * imageCapture() override
~QOhosMediaCaptureSession() override
Combined button and popup list for selecting options.