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
qwasmmediacapturesession_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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#ifndef QWASMMEDIACAPTURESESSION_H
5#define QWASMMEDIACAPTURESESSION_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
19
20#include <private/qplatformmediacapture_p.h>
21#include <private/qplatformmediaintegration_p.h>
24
25#include "private/qcapturablewindow_p.h"
26
27#include <QScopedPointer>
28#include <QtCore/qloggingcategory.h>
29#include <common/qwasmvideooutput_p.h>
30
32
33Q_DECLARE_LOGGING_CATEGORY(qWasmMediaCaptureSession)
34
35class QAudioInput;
36class QWasmCamera;
37
39{
40
41public:
42 explicit QWasmMediaCaptureSession();
44
45 QPlatformCamera *camera() override;
46 void setCamera(QPlatformCamera *camera) override;
47
49 void setScreenCapture(QPlatformSurfaceCapture *) override;
50
52 void setWindowCapture(QPlatformSurfaceCapture *) override;
53
55 void setImageCapture(QPlatformImageCapture *imageCapture) override;
56
58 void setMediaRecorder(QPlatformMediaRecorder *recorder) override;
59
60 void setAudioInput(QPlatformAudioInput *input) override;
61 QPlatformAudioInput * audioInput() const { return m_audioInput; }
62 void setVideoPreview(QVideoSink *sink) override;
63 void setAudioOutput(QPlatformAudioOutput *output) override;
64
65 bool hasAudio();
66 QVideoSink *videoSink() { return m_wasmSink; }
67 void setReadyForCapture(bool ready);
68 void setVideoSource(std::string surfacetype);
69
70private:
71 QWasmMediaRecorder *m_mediaRecorder = nullptr;
72
73 QWasmCamera *m_camera = nullptr;
74 QWasmImageCapture *m_imageCapture = nullptr;
75 QPlatformSurfaceCapture *m_windowCapture = nullptr;
76 QPlatformSurfaceCapture *m_screenCapture = nullptr;
77
78 QPlatformAudioInput *m_audioInput = nullptr;
79 QPlatformAudioOutput *m_audioOutput = nullptr;
80 std::unique_ptr<QWasmVideoOutput> m_videoOutput;
81
82 bool m_needsAudio = false;
83 QVideoSink *m_wasmSink = nullptr;
84
85 emscripten::val m_mediaCaptureStream;
86 std::string m_displaySurface;
87 QList<QCapturableWindow> m_capuredWindows;
88};
89
90QT_END_NAMESPACE
91
92#endif // QWASMMEDIACAPTURESESSION_H
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
bool isTorchModeSupported(QCamera::TorchMode mode) const override
void setManualExposureTime(float) override
void setExposureCompensation(float bias) override
void setColorTemperature(int temperature) override
int isoSensitivity() const override
void setWhiteBalanceMode(QCamera::WhiteBalanceMode mode) override
void setTorchMode(QCamera::TorchMode mode) override
bool isWhiteBalanceModeSupported(QCamera::WhiteBalanceMode mode) const override
void setExposureMode(QCamera::ExposureMode mode) override
bool setCameraFormat(const QCameraFormat &format) override
void setManualIsoSensitivity(int) override
void setFocusMode(QCamera::FocusMode mode) override
QWasmVideoOutput * cameraOutput()
void setActive(bool active) override
bool isFocusModeSupported(QCamera::FocusMode mode) const override
bool isActive() const override
void setCaptureSession(QPlatformMediaCaptureSession *session) override
bool isExposureModeSupported(QCamera::ExposureMode mode) const override
void setCamera(const QCameraDevice &camera) override
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
void setAudioInput(QPlatformAudioInput *input) override
void setScreenCapture(QPlatformSurfaceCapture *) override
QPlatformSurfaceCapture * screenCapture() override
void setAudioOutput(QPlatformAudioOutput *output) override
QPlatformImageCapture * imageCapture() override
QPlatformMediaRecorder * mediaRecorder() override
QPlatformSurfaceCapture * windowCapture() override
void setImageCapture(QPlatformImageCapture *imageCapture) override
void setWindowCapture(QPlatformSurfaceCapture *) override
void setCamera(QPlatformCamera *camera) override
~QWasmMediaCaptureSession() override
void setVideoPreview(QVideoSink *sink) override
QPlatformCamera * camera() override
void setVideoSource(std::string surfacetype)
QPlatformAudioInput * audioInput() const
QWasmMediaRecorder(QMediaRecorder *parent)
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")