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
qqnxmediacapturesession.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 Research In Motion
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "common/qqnxaudioinput_p.h"
6#include "camera/qqnxplatformcamera_p.h"
7#include "camera/qqnximagecapture_p.h"
9#include <QtMultimedia/private/qplatformvideosink_p.h>
10#include "qvideosink.h"
11
13
14QQnxMediaCaptureSession::QQnxMediaCaptureSession()
15 : QPlatformMediaCaptureSession()
16{
17}
18
22
24{
25 return m_camera;
26}
27
28void QQnxMediaCaptureSession::setCamera(QPlatformCamera *camera)
29{
30 if (camera == m_camera)
31 return;
32
33 if (m_camera)
34 m_camera->setCaptureSession(nullptr);
35
36 m_camera = static_cast<QQnxPlatformCamera *>(camera);
37
38 if (m_camera)
39 m_camera->setCaptureSession(this);
40
41 Q_EMIT cameraChanged();
42}
43
45{
46 return m_imageCapture;
47}
48
49void QQnxMediaCaptureSession::setImageCapture(QPlatformImageCapture *imageCapture)
50{
51 if (m_imageCapture == imageCapture)
52 return;
53
54 if (m_imageCapture)
55 m_imageCapture->setCaptureSession(nullptr);
56
57 m_imageCapture = static_cast<QQnxImageCapture *>(imageCapture);
58
59 if (m_imageCapture)
60 m_imageCapture->setCaptureSession(this);
61
62 Q_EMIT imageCaptureChanged();
63}
64
66{
67 return m_mediaRecorder;
68}
69
70void QQnxMediaCaptureSession::setMediaRecorder(QPlatformMediaRecorder *mediaRecorder)
71{
72 if (m_mediaRecorder == mediaRecorder)
73 return;
74
75 if (m_mediaRecorder)
76 m_mediaRecorder->setCaptureSession(nullptr);
77
78 m_mediaRecorder = static_cast<QQnxMediaRecorder *>(mediaRecorder);
79
80 if (m_mediaRecorder)
81 m_mediaRecorder->setCaptureSession(this);
82
83 Q_EMIT encoderChanged();
84}
85
86void QQnxMediaCaptureSession::setAudioInput(QPlatformAudioInput *input)
87{
88 if (m_audioInput == input)
89 return;
90
91 m_audioInput = static_cast<QQnxAudioInput*>(input);
92}
93
94void QQnxMediaCaptureSession::setVideoPreview(QVideoSink *sink)
95{
96 m_videoSink = sink->platformVideoSink();
97}
98
99void QQnxMediaCaptureSession::setAudioOutput(QPlatformAudioOutput *output)
100{
101 if (m_audioOutput == output)
102 return;
103 m_audioOutput = output;
104}
105
106QQnxAudioInput * QQnxMediaCaptureSession::audioInput() const
107{
108 return m_audioInput;
109}
110
111QPlatformVideoSink *QQnxMediaCaptureSession::videoSink() const
112{
113 return m_videoSink;
114}
115
116QT_END_NAMESPACE
117
118#include "moc_qqnxmediacapturesession_p.cpp"
void setCaptureSession(QQnxMediaCaptureSession *session)
void setMediaRecorder(QPlatformMediaRecorder *mediaRecorder) override
void setAudioOutput(QPlatformAudioOutput *output) override
void setCamera(QPlatformCamera *camera) override
QPlatformCamera * camera() override
void setAudioInput(QPlatformAudioInput *input) override
QPlatformMediaRecorder * mediaRecorder() override
void setImageCapture(QPlatformImageCapture *imageCapture) override
QPlatformImageCapture * imageCapture() override
QQnxAudioInput * audioInput() const
QPlatformVideoSink * videoSink() const
void setCaptureSession(QQnxMediaCaptureSession *session)
Combined button and popup list for selecting options.