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
qffmpegmediacapturesession_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QFFMPEGMEDIACAPTURESESSION_H
5#define QFFMPEGMEDIACAPTURESESSION_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 <QtMultimedia/private/qplatformmediacapture_p.h>
19#include <QtMultimedia/private/qplatformmediaintegration_p.h>
20#include "qpointer.h"
21#include "qiodevice.h"
22
24
27class QVideoFrame;
28class QAudioSink;
30class QAudioBuffer;
31class QPlatformVideoSource;
32class QPlatformAudioBufferInput;
33class QAudioBufferSource;
34
36{
38
39public:
41
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 setVideoFrameInput(QPlatformVideoFrameInput *) override;
56
58 void setImageCapture(QPlatformImageCapture *imageCapture) override;
59
61 void setMediaRecorder(QPlatformMediaRecorder *recorder) override;
62
63 void setAudioInput(QPlatformAudioInput *input) override;
65
66 void setAudioBufferInput(QPlatformAudioBufferInput *input) override;
67
68 void setVideoPreview(QVideoSink *sink) override;
69 void setAudioOutput(QPlatformAudioOutput *output) override;
70
71 QPlatformVideoSource *primaryActiveVideoSource();
72
73 // it might be moved to the base class, but it needs QPlatformAudioInput
74 // to be QAudioBufferSource, which might not make sense
76
77private Q_SLOTS:
78 void updateAudioSink();
79 void updateVolume();
80 void updateVideoFrameConnection();
81 void updatePrimaryActiveVideoSource();
82
85
86private:
87 template<typename VideoSource>
88 bool setVideoSource(QPointer<VideoSource> &source, VideoSource *newSource);
89
90 QPointer<QPlatformCamera> m_camera;
91 QPointer<QPlatformSurfaceCapture> m_screenCapture;
92 QPointer<QPlatformSurfaceCapture> m_windowCapture;
93 QPointer<QPlatformVideoFrameInput> m_videoFrameInput;
94 QPointer<QPlatformVideoSource> m_primaryActiveVideoSource;
95
96 QPointer<QFFmpegAudioInput> m_audioInput;
97 QPointer<QPlatformAudioBufferInput> m_audioBufferInput;
98
99 QFFmpegImageCapture *m_imageCapture = nullptr;
100 QFFmpegMediaRecorder *m_mediaRecorder = nullptr;
101 QPlatformAudioOutput *m_audioOutput = nullptr;
102 QVideoSink *m_videoSink = nullptr;
103 std::unique_ptr<QAudioSink> m_audioSink;
104 QPointer<QIODevice> m_audioIODevice;
105 qsizetype m_audioBufferSize = 0;
106
107 QMetaObject::Connection m_videoFrameConnection;
108};
109
110QT_END_NAMESPACE
111
112#endif // QGSTREAMERCAPTURESERVICE_H
void setMediaRecorder(QPlatformMediaRecorder *recorder) override
void setVideoPreview(QVideoSink *sink) override
QPlatformSurfaceCapture * windowCapture() override
void setWindowCapture(QPlatformSurfaceCapture *) override
void setVideoFrameInput(QPlatformVideoFrameInput *) override
void setScreenCapture(QPlatformSurfaceCapture *) override
void setAudioInput(QPlatformAudioInput *input) override
QPlatformVideoFrameInput * videoFrameInput() override
std::vector< QAudioBufferSource * > activeAudioInputs() const
void setImageCapture(QPlatformImageCapture *imageCapture) override
QPlatformSurfaceCapture * screenCapture() override
QPlatformImageCapture * imageCapture() override
QPlatformAudioInput * audioInput() const
QPlatformVideoSource * primaryActiveVideoSource()
void setCamera(QPlatformCamera *camera) override
QPlatformMediaRecorder * mediaRecorder() override
QPlatformCamera * camera() override
~QFFmpegMediaCaptureSession() override
void setAudioBufferInput(QPlatformAudioBufferInput *input) override
void setAudioOutput(QPlatformAudioOutput *output) override
void setCaptureSession(QFFmpegMediaCaptureSession *session)
static int preferredAudioSinkBufferSize(const QFFmpegAudioInput &input)
#define qCWarning(category,...)
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)