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