Commit 9ae98ed1 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

implement PHONON_BACKEND_VERSION_4_7's setStreamUuid

due to present limitations in libvlc we cannot actually set the stream
properties interactively. instead setupStreamEnvironment is used to
set the envrionment as close as possible to creation.

also add fallback backend version checks, not sure we actually build with
< 4.6.60 though

CCBUG: 321288
parent 7bb323f6
......@@ -18,7 +18,15 @@ if (MSVC)
endif (KDEWIN_FOUND)
endif (MSVC)
add_definitions(-D_PHONON_BACKEND_VERSION_4_2)
if(${PHONON_VERSION} VERSION_GREATER "4.6.49") # Pre-release 4.7 starts at 4.6.50
message("Building against Phonon 4.7 API")
add_definitions(-DPHONON_BACKEND_VERSION_4_7)
elseif(${PHONON_VERSION} VERSION_GREATER "4.1.99")
message("Building against Phonon 4.2 API")
add_definitions(-DPHONON_BACKEND_VERSION_4_2)
else()
message("Building against Phonon 4.0 API")
endif()
set(phonon_vlc_SRCS
audio/audiooutput.cpp
......
......@@ -54,6 +54,10 @@ void AudioOutput::handleConnectToMediaObject(MediaObject *mediaObject)
void AudioOutput::handleAddToMedia(Media *media)
{
media->addOption(":audio");
PulseSupport *pulse = PulseSupport::getInstance();
if (pulse && pulse->isActive()) {
pulse->setupStreamEnvironment(m_streamUuid);
}
}
qreal AudioOutput::volume() const
......@@ -86,6 +90,7 @@ bool AudioOutput::setOutputDevice(int deviceIndex)
return setOutputDevice(device);
}
#if (PHONON_VERSION >= PHONON_VERSION_CHECK(4, 2, 0))
bool AudioOutput::setOutputDevice(const AudioOutputDevice &newDevice)
{
debug() << Q_FUNC_INFO;
......@@ -105,6 +110,16 @@ bool AudioOutput::setOutputDevice(const AudioOutputDevice &newDevice)
return true;
}
#endif
#if (PHONON_VERSION >= PHONON_VERSION_CHECK(4, 6, 50))
void AudioOutput::setStreamUuid(QString uuid)
{
qDebug() << Q_FUNC_INFO;
qDebug() << uuid;
m_streamUuid = uuid;
}
#endif
void AudioOutput::setOutputDeviceImplementation()
{
......
......@@ -101,6 +101,9 @@ public:
bool setOutputDevice(const AudioOutputDevice &newDevice);
#endif
#if (PHONON_VERSION >= PHONON_VERSION_CHECK(4, 6, 50))
void setStreamUuid(QString uuid);
#endif
signals:
void volumeChanged(qreal volume);
......@@ -121,6 +124,7 @@ private:
qreal m_volume;
AudioOutputDevice m_device;
QString m_streamUuid;
};
} // namespace VLC
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment