summaryrefslogtreecommitdiffstats
path: root/src/multimedia/platform/qplatformmediacapture_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-06-04 15:58:15 +0200
committerLars Knoll <lars.knoll@qt.io>2021-06-11 15:12:28 +0200
commitd5b87ad6554a674aa38a3d301918a49f5baf57a7 (patch)
treea2d28e0f72142a13ca602c1ef927f3a81a15eee7 /src/multimedia/platform/qplatformmediacapture_p.h
parent9fd208f11a218d8a8b07fc525258eea3b3596d62 (diff)
Use QAudioInput in QMediaCaptureSession
Convert the audioInput property to use a pointer to a QAudioInput in line with the API changes planned. Not setting up a QAudioInput implies that you do not get any audio. Move the volume and muted properties over to QAudioInput, they should really not be part of the QMediaCaptureSession. Adjust the platform API accordingly and adjust implementations. The Android adaptation is incomplete, but that was the case before as well. This needs some refactoring to properly support setting devices and adjusting volume/muted. Dynamically adjusting to changes of the audio input device is not yet implemented on Windows. Change-Id: I2fb63b9e57908d6dc02130b8d534ef7ac1a1ac85 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/multimedia/platform/qplatformmediacapture_p.h')
-rw-r--r--src/multimedia/platform/qplatformmediacapture_p.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/multimedia/platform/qplatformmediacapture_p.h b/src/multimedia/platform/qplatformmediacapture_p.h
index 13d47033a..46f555d89 100644
--- a/src/multimedia/platform/qplatformmediacapture_p.h
+++ b/src/multimedia/platform/qplatformmediacapture_p.h
@@ -52,7 +52,6 @@
#include <private/qtmultimediaglobal_p.h>
#include <QtCore/qobject.h>
-#include <private/qplatformaudiointerface_p.h>
QT_BEGIN_NAMESPACE
class QPlatformCamera;
@@ -61,9 +60,9 @@ class QPlatformMediaEncoder;
class QAudioDevice;
class QCameraDevice;
class QVideoSink;
-class QAudioInput;
+class QPlatformAudioInput;
-class Q_MULTIMEDIA_EXPORT QPlatformMediaCaptureSession : public QObject, public QPlatformAudioInterface
+class Q_MULTIMEDIA_EXPORT QPlatformMediaCaptureSession : public QObject
{
Q_OBJECT
public:
@@ -79,21 +78,16 @@ public:
virtual QPlatformMediaEncoder *mediaEncoder() = 0;
virtual void setMediaEncoder(QPlatformMediaEncoder *) {}
- void setAudioInput(QAudioInput *input);
+ virtual void setAudioInput(QPlatformAudioInput *input) = 0;
virtual void setVideoPreview(QVideoSink * /*sink*/) {}
virtual QAudioDevice audioPreview() const;
virtual bool setAudioPreview(const QAudioDevice &) { return true; }
Q_SIGNALS:
- void mutedChanged(bool muted);
- void volumeChanged(qreal volume);
void cameraChanged();
void imageCaptureChanged();
void encoderChanged();
-
-private:
- QAudioInput *m_audioInput = nullptr;
};
QT_END_NAMESPACE