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
21#include <common/qwasmvideooutput_p.h>
22
23#include <QtMultimedia/private/qcapturablewindow_p.h>
24#include <QtMultimedia/private/qplatformmediacapture_p.h>
25#include <QtMultimedia/private/qplatformmediaintegration_p.h>
26#include <QtCore/qloggingcategory.h>
27#include <QtCore/qscopedpointer.h>
28
30
31Q_DECLARE_LOGGING_CATEGORY(qWasmMediaCaptureSession)
32
33class QAudioInput;
34class QWasmCamera;
35
37{
38
39public:
40 explicit QWasmMediaCaptureSession();
42
43 QPlatformCamera *camera() override;
44 void setCamera(QPlatformCamera *camera) override;
45
47 void setScreenCapture(QPlatformSurfaceCapture *) override;
48
50 void setWindowCapture(QPlatformSurfaceCapture *) override;
51
53 void setImageCapture(QPlatformImageCapture *imageCapture) override;
54
56 void setMediaRecorder(QPlatformMediaRecorder *recorder) override;
57
58 void setAudioInput(QPlatformAudioInput *input) override;
59 QPlatformAudioInput * audioInput() const { return m_audioInput; }
60 void setVideoPreview(QVideoSink *sink) override;
61 void setAudioOutput(QPlatformAudioOutput *output) override;
62
63 bool hasAudio();
64 QVideoSink *videoSink() { return m_wasmSink; }
65 void setReadyForCapture(bool ready);
66 void setVideoSource(std::string surfacetype);
67
68private:
69 QWasmMediaRecorder *m_mediaRecorder = nullptr;
70
71 QWasmCamera *m_camera = nullptr;
72 QWasmImageCapture *m_imageCapture = nullptr;
73 QPlatformSurfaceCapture *m_windowCapture = nullptr;
74 QPlatformSurfaceCapture *m_screenCapture = nullptr;
75
76 QPlatformAudioInput *m_audioInput = nullptr;
77 QPlatformAudioOutput *m_audioOutput = nullptr;
78 std::unique_ptr<QWasmVideoOutput> m_videoOutput;
79
80 bool m_needsAudio = false;
81 QVideoSink *m_wasmSink = nullptr;
82
83 emscripten::val m_mediaCaptureStream;
84 std::string m_displaySurface;
85 QList<QCapturableWindow> m_capuredWindows;
86};
87
88QT_END_NAMESPACE
89
90#endif // QWASMMEDIACAPTURESESSION_H
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)
Combined button and popup list for selecting options.
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")