Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qandroidmediacapturesession.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2016 Ruslan Baratov
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
6
9#include "qandroidcamera_p.h"
12#include "qmediadevices.h"
13#include "qaudiodevice.h"
14
16
22
24{
25 delete m_captureSession;
26 delete m_cameraSession;
27}
28
30{
31 return m_cameraControl;
32}
33
35{
36 if (camera) {
37 m_captureSession->setCameraSession(m_cameraSession);
38 } else {
39 m_captureSession->setCameraSession(nullptr);
40 }
41
42 QAndroidCamera *control = static_cast<QAndroidCamera *>(camera);
43 if (m_cameraControl == control)
44 return;
45
46 if (m_cameraControl)
47 m_cameraControl->setCaptureSession(nullptr);
48
49 m_cameraControl = control;
50 if (m_cameraControl)
51 m_cameraControl->setCaptureSession(this);
52
54}
55
57{
58 return m_imageCaptureControl;
59}
60
62{
64 if (m_imageCaptureControl == control)
65 return;
66
67 if (m_imageCaptureControl)
68 m_imageCaptureControl->setCaptureSession(nullptr);
69
70 m_imageCaptureControl = control;
71 if (m_imageCaptureControl)
72 m_imageCaptureControl->setCaptureSession(this);
73}
74
79
81{
82 QAndroidMediaEncoder *control = static_cast<QAndroidMediaEncoder *>(recorder);
83
84 if (m_encoder == control)
85 return;
86
87 if (m_encoder)
88 m_encoder->setCaptureSession(nullptr);
89
90 m_encoder = control;
91 if (m_encoder)
92 m_encoder->setCaptureSession(this);
93
95
96}
97
102
107
112
114
115#include "moc_qandroidmediacapturesession_p.cpp"
AVCaptureSession * m_captureSession
void setVideoSink(QVideoSink *surface)
void setCaptureSession(QPlatformMediaCaptureSession *session) override
void setAudioInput(QPlatformAudioInput *input)
void setAudioOutput(QPlatformAudioOutput *output)
void setCameraSession(QAndroidCameraSession *cameraSession=0)
void setCaptureSession(QPlatformMediaCaptureSession *session)
void setCamera(QPlatformCamera *camera) override
void setAudioOutput(QPlatformAudioOutput *output) override
void setVideoPreview(QVideoSink *sink) override
QPlatformCamera * camera() override
QPlatformMediaRecorder * mediaRecorder() override
void setImageCapture(QPlatformImageCapture *imageCapture) override
QPlatformImageCapture * imageCapture() override
void setAudioInput(QPlatformAudioInput *input) override
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
void setCaptureSession(QPlatformMediaCaptureSession *session)
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
QMediaRecorder * recorder
Definition camera.cpp:20
QCamera * camera
Definition camera.cpp:19
QImageCapture * imageCapture
Definition camera.cpp:21
Combined button and popup list for selecting options.
GLsizei GLenum GLboolean sink
GLenum GLenum GLenum input
#define emit
QT_BEGIN_NAMESPACE typedef uchar * output