diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-12-14 12:53:21 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-01-20 15:08:41 +0000 |
commit | 397cb94d6882940114cb6c96a88e8ac0b64203a4 (patch) | |
tree | d2ac9e1440a208e9fdf2f04d3b2f13d177021c89 /src/multimedia/audio | |
parent | 46381711557aad4f264470e555c77f7d6d07cbb9 (diff) |
Get rid of the unused resource policy and availability control
The only implementation of this was using some Nokia specific
library, that hasn't existed since 2012 anymore.
Change-Id: Ieaec2176ad8e4fc170bb5254944fffc41edccefa
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.cpp | 23 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.h | 9 |
2 files changed, 0 insertions, 32 deletions
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index 51cdde026..03f87bdd5 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -56,8 +56,6 @@ #include "qsoundeffect_pulse_p.h" #include <private/qaudiohelpers_p.h> -#include <private/qmediaresourcepolicy_p.h> -#include <private/qmediaresourceset_p.h> #include <QAudioDeviceInfo> #include <unistd.h> @@ -352,12 +350,6 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): m_ref = new QSoundEffectRef(this); if (pulseDaemon()->context()) pa_sample_spec_init(&m_pulseSpec); - - m_resources = QMediaResourcePolicy::createResourceSet<QMediaPlayerResourceSetInterface>(); - Q_ASSERT(m_resources); - m_resourcesAvailable = m_resources->isAvailable(); - connect(m_resources, &QMediaPlayerResourceSetInterface::availabilityChanged, - this, &QSoundEffectPrivate::handleAvailabilityChanged); } QSoundEffectPrivate::QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QObject *parent) @@ -366,16 +358,6 @@ QSoundEffectPrivate::QSoundEffectPrivate(const QAudioDeviceInfo &audioDevice, QO m_sinkName = audioDevice.deviceName(); } -void QSoundEffectPrivate::handleAvailabilityChanged(bool available) -{ - m_resourcesAvailable = available; -#ifdef DEBUG_RESOURCE - qDebug() << Q_FUNC_INFO << "Resource availability changed " << m_resourcesAvailable; -#endif - if (!m_resourcesAvailable) - stop(); -} - void QSoundEffectPrivate::release() { #ifdef QT_PA_DEBUG @@ -422,8 +404,6 @@ void QSoundEffectPrivate::setCategory(const QString &category) QSoundEffectPrivate::~QSoundEffectPrivate() { - QMediaResourcePolicy::destroyResourceSet(m_resources); - m_resources = nullptr; m_ref->release(); pulseDaemon()->deref(); @@ -627,9 +607,6 @@ void QSoundEffectPrivate::setLoopsRemaining(int loopsRemaining) void QSoundEffectPrivate::play() { - if (!m_resourcesAvailable) - return; - playAvailable(); } diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.h b/src/multimedia/audio/qsoundeffect_pulse_p.h index e0073f0d5..09771ef36 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.h +++ b/src/multimedia/audio/qsoundeffect_pulse_p.h @@ -61,9 +61,6 @@ #include <pulse/pulseaudio.h> #include "qsamplecache_p.h" -#include <private/qmediaresourcepolicy_p.h> -#include <private/qmediaresourceset_p.h> - QT_BEGIN_NAMESPACE class QSoundEffectRef; @@ -120,8 +117,6 @@ private Q_SLOTS: void streamReady(); void emptyComplete(void *stream, bool reload); - void handleAvailabilityChanged(bool available); - private: void playAvailable(); void playSample(); @@ -175,12 +170,8 @@ private: int m_position = 0; QSoundEffectRef *m_ref = nullptr; - bool m_resourcesAvailable = false; - // Protects volume while PuseAudio is accessing it mutable QMutex m_volumeLock; - - QMediaPlayerResourceSetInterface *m_resources = nullptr; }; QT_END_NAMESPACE |