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
qwindowsmediadevicesession_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QWINDOWSMEDIADEVICESESSION_H
5#define QWINDOWSMEDIADEVICESESSION_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
18#include <private/qtmultimediaglobal_p.h>
19#include <qcamera.h>
20#include <qaudiodevice.h>
21#include <private/qwindowsmultimediautils_p.h>
22#include <private/qplatformmediarecorder_p.h>
23
25
26class QAudioInput;
27class QAudioOutput;
28class QVideoSink;
30
32{
34public:
35 explicit QWindowsMediaDeviceSession(QObject *parent = nullptr);
37
38 bool isActive() const;
39 void setActive(bool active);
40
41 bool isActivating() const;
42
45
46 void setCameraFormat(const QCameraFormat &cameraFormat);
47
48 void setVideoSink(QVideoSink *surface);
49
50public Q_SLOTS:
51 void setAudioInputMuted(bool muted);
52 void setAudioInputVolume(float volume);
54 void setAudioOutputMuted(bool muted);
55 void setAudioOutputVolume(float volume);
57
58public:
61
63 void stopRecording();
64 bool pauseRecording();
65 bool resumeRecording();
66
68 void activeChanged(bool);
70 void durationChanged(qint64 duration);
73 void streamingError(int errorCode);
74 void recordingError(int errorCode);
76
77private Q_SLOTS:
78 void handleStreamingStarted();
79 void handleStreamingStopped();
80 void handleStreamingError(int errorCode);
81 void handleVideoFrameChanged(const QVideoFrame &frame);
82
83private:
84 void reactivate();
85 quint32 estimateVideoBitRate(const GUID &videoFormat, quint32 width, quint32 height,
87 quint32 estimateAudioBitRate(const GUID &audioFormat, QMediaRecorder::Quality quality);
88 bool m_active = false;
89 bool m_activating = false;
90 QCameraDevice m_activeCameraDevice;
91 QCameraFormat m_cameraFormat;
92 QWindowsMediaDeviceReader *m_mediaDeviceReader = nullptr;
93 QAudioInput *m_audioInput = nullptr;
94 QAudioOutput *m_audioOutput = nullptr;
95 QVideoSink *m_surface = nullptr;
96};
97
99
100#endif // QWINDOWSMEDIADEVICESESSION_H
\qmltype AudioInput \instantiates QAudioInput
Definition qaudioinput.h:19
\qmltype AudioOutput \instantiates QAudioOutput
The QCameraDevice class provides general information about camera devices.
The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia...
Quality
\qmlproperty enumeration QtMultimedia::MediaRecorder::quality
Error
\qmlproperty enumeration QtMultimedia::MediaRecorder::error
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:27
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
void videoFrameChanged(const QVideoFrame &frame)
void setActiveCamera(const QCameraDevice &camera)
QMediaRecorder::Error startRecording(QMediaEncoderSettings &settings, const QString &fileName, bool audioOnly)
void recordingError(int errorCode)
void setAudioOutput(QAudioOutput *output)
QWindowsMediaDeviceSession(QObject *parent=nullptr)
void durationChanged(qint64 duration)
void setCameraFormat(const QCameraFormat &cameraFormat)
void streamingError(int errorCode)
QCamera * camera
Definition camera.cpp:19
Combined button and popup list for selecting options.
GLint GLsizei GLsizei height
GLint GLsizei width
GLenum GLenum GLenum input
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
unsigned int quint32
Definition qtypes.h:50
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QT_BEGIN_NAMESPACE typedef uchar * output
QSettings settings("MySoft", "Star Runner")
[0]
QFrame frame
[0]