Hello community,
here is the log from the commit of package phonon-backend-vlc for
openSUSE:Factory checked in at 2018-02-24 16:39:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/phonon-backend-vlc (Old)
and /work/SRC/openSUSE:Factory/.phonon-backend-vlc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "phonon-backend-vlc"
Sat Feb 24 16:39:34 2018 rev:23 rq:579680 version:0.10.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/phonon-backend-vlc/phonon-backend-vlc.changes
2018-02-19 13:03:35.772389851 +0100
+++
/work/SRC/openSUSE:Factory/.phonon-backend-vlc.new/phonon-backend-vlc.changes
2018-02-24 16:39:36.976938272 +0100
@@ -1,0 +2,23 @@
+Fri Feb 23 21:23:35 UTC 2018 - [email protected]
+
+- Update to 0.10.0:
+ * Changes
+ + Mimetype support list has been synced with latest VLC
+ * Bug Fixes
+ + The health of our users is very dear to us, so we've lowered
+ the default volume to 75% to not blow their ears out in the
+ event of failure or badly configured frontend software
+ + Volume application has been revised and now applies less
+ aggressively. This gives PulseAudio a change to apply/restore
+ its own default volume.
+ + Volume application and correct role forwarding into VLC
+ finally make the PulseAudio notification volume apply
+ properly to notifications issued via Phonon (VLC 3 only).
+ * VLC 3.0 API Pickup
+ + New player role is being used to set the output category on a
+ PulseAudio level. This fixes a long-standing bug where VLC
+ based audio would always be categorized as video.
+ + Various deprecation porting.
+- Add fix-build-with-vlc2.patch to make it compile with VLC 2.x
+
+-------------------------------------------------------------------
Old:
----
phonon-backend-vlc-0.9.1.tar.xz
New:
----
fix-build-with-vlc2.patch
phonon-backend-vlc-0.10.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ phonon-backend-vlc.spec ++++++
--- /var/tmp/diff_new_pack.oesH8h/_old 2018-02-24 16:39:37.964902718 +0100
+++ /var/tmp/diff_new_pack.oesH8h/_new 2018-02-24 16:39:37.968902574 +0100
@@ -18,13 +18,15 @@
%define _phonon_version 4.7.0
Name: phonon-backend-vlc
-Version: 0.9.1
+Version: 0.10.0
Release: 0
Summary: Phonon VLC Backend
License: LGPL-2.1+
Group: System/GUI/KDE
Url: http://phonon.kde.org/
Source:
http://download.kde.org/stable/phonon/%{name}/%{version}/%{name}-%{version}.tar.xz
+# PATCH-FIX-UPSTREAM
+Patch: fix-build-with-vlc2.patch
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: kde4-filesystem
@@ -46,7 +48,8 @@
This is the VLC backend for Phonon.
%prep
-%setup -q -n phonon-backend-vlc-%{version}
+%setup -q -n phonon-vlc-%{version}
+%patch -p1
%build
%cmake_kde4 -d build
++++++ fix-build-with-vlc2.patch ++++++
>From ea4d78ac3fc01f33bc2c0f3fb4a44a4103196da5 Mon Sep 17 00:00:00 2001
From: Antonio Rojas <[email protected]>
Date: Fri, 23 Feb 2018 21:51:45 +0100
Subject: Fix build with VLC<3
libvlc_title_description_t and libvlc_chapter_description_t are not defined in
vlc < 3
Differential Revision: https://phabricator.kde.org/D10775
---
src/mediaplayer.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mediaplayer.h b/src/mediaplayer.h
index 9d413d4..cd847db 100644
--- a/src/mediaplayer.h
+++ b/src/mediaplayer.h
@@ -62,11 +62,13 @@ private:
unsigned int m_size;
};
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
typedef Descriptions<libvlc_title_description_t> TitleDescriptions;
typedef QSharedPointer<const TitleDescriptions> SharedTitleDescriptions;
typedef Descriptions<libvlc_chapter_description_t> ChapterDescriptions;
typedef QSharedPointer<ChapterDescriptions> SharedChapterDescriptions;
+#endif
class MediaPlayer : public QObject
{
--
cgit v0.11.2
++++++ phonon-backend-vlc-0.9.1.tar.xz -> phonon-backend-vlc-0.10.0.tar.xz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/.reviewboardrc
new/phonon-vlc-0.10.0/.reviewboardrc
--- old/phonon-backend-vlc-0.9.1/.reviewboardrc 2017-02-23 11:39:51.000000000
+0100
+++ new/phonon-vlc-0.10.0/.reviewboardrc 1970-01-01 01:00:00.000000000
+0100
@@ -1,3 +0,0 @@
-REVIEWBOARD_URL = "https://git.reviewboard.kde.org"
-REPOSITORY = 'git://anongit.kde.org/phonon-vlc'
-TARGET_GROUPS = 'phonon'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/CMakeLists.txt
new/phonon-vlc-0.10.0/CMakeLists.txt
--- old/phonon-backend-vlc-0.9.1/CMakeLists.txt 2017-02-23 11:39:51.000000000
+0100
+++ new/phonon-vlc-0.10.0/CMakeLists.txt 2018-02-23 15:30:24.000000000
+0100
@@ -24,8 +24,8 @@
include_directories(${PHONON_INCLUDES} ${QT_INCLUDES} ${LIBVLC_INCLUDE_DIR}
${LIBVLC_INCLUDE_DIR}/vlc/plugins)
set(PHONON_VLC_MAJOR_VERSION "0")
-set(PHONON_VLC_MINOR_VERSION "9")
-set(PHONON_VLC_PATCH_VERSION "1")
+set(PHONON_VLC_MINOR_VERSION "10")
+set(PHONON_VLC_PATCH_VERSION "0")
set(PHONON_VLC_VERSION
"${PHONON_VLC_MAJOR_VERSION}.${PHONON_VLC_MINOR_VERSION}.${PHONON_VLC_PATCH_VERSION}")
add_definitions(-DPHONON_VLC_VERSION="${PHONON_VLC_VERSION}")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/MimeTypes.cmake
new/phonon-vlc-0.10.0/MimeTypes.cmake
--- old/phonon-backend-vlc-0.9.1/MimeTypes.cmake 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/MimeTypes.cmake 2018-02-23 15:30:24.000000000
+0100
@@ -4,95 +4,150 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
set(PHONON_VLC_MIME_TYPES
+ application/mpeg4-iod
+ application/mpeg4-muxcodetable
+ application/mxf
application/ogg
- application/x-ogg
+ application/ram
+ application/sdp
+ application/vnd.apple.mpegurl
+ application/vnd.ms-asf
+ application/vnd.ms-wpl
application/vnd.rn-realmedia
- application/x-annodex
+ application/vnd.rn-realmedia-vbr
+ application/x-cd-image
+ application/x-extension-m4a
+ application/x-extension-mp4
+ application/x-flac
application/x-flash-video
+ application/x-matroska
+ application/x-ogg
+ application/x-quicktime-media-link
application/x-quicktimeplayer
- application/x-extension-mp4
- audio/168sv
+ application/x-shockwave-flash
+ application/xspf+xml
audio/3gpp
audio/3gpp2
- audio/8svx
- audio/aiff
- audio/amr
- audio/amr-wb
+ audio/AMR
+ audio/AMR-WB
+ audio/aac
+ audio/ac3
audio/basic
+ audio/dv
+ audio/eac3
+ audio/flac
+ audio/m4a
+ audio/midi
+ audio/mp1
+ audio/mp2
audio/mp3
audio/mp4
- audio/midi
audio/mpeg
- audio/mpeg2
- audio/mpeg3
- audio/prs.sid
+ audio/mpegurl
+ audio/mpg
+ audio/ogg
+ audio/opus
+ audio/scpls
+ audio/vnd.dolby.heaac.1
+ audio/vnd.dolby.heaac.2
+ audio/vnd.dolby.mlp
+ audio/vnd.dts
+ audio/vnd.dts.hd
audio/vnd.rn-realaudio
- audio/vnd.rn-realmedia
+ audio/vorbis
audio/wav
audio/webm
- audio/x-16sv
- audio/x-8svx
+ audio/x-aac
+ audio/x-adpcm
audio/x-aiff
- audio/x-basic
+ audio/x-ape
+ audio/x-flac
+ audio/x-gsm
audio/x-it
audio/x-m4a
audio/x-matroska
audio/x-mod
+ audio/x-mp1
+ audio/x-mp2
audio/x-mp3
audio/x-mpeg
- audio/x-mpeg2
- audio/x-mpeg3
audio/x-mpegurl
+ audio/x-mpg
+ audio/x-ms-asf
+ audio/x-ms-asx
+ audio/x-ms-wax
audio/x-ms-wma
- audio/x-ogg
+ audio/x-musepack
audio/x-pn-aiff
audio/x-pn-au
+ audio/x-pn-realaudio
audio/x-pn-realaudio-plugin
audio/x-pn-wav
audio/x-pn-windows-acm
audio/x-real-audio
audio/x-realaudio
audio/x-s3m
- audio/x-speex+ogg
+ audio/x-scpls
+ audio/x-shorten
+ audio/x-speex
+ audio/x-tta
+ audio/x-vorbis
audio/x-vorbis+ogg
audio/x-wav
+ audio/x-wavpack
audio/x-xm
- image/ilbm
- image/png
- image/x-ilbm
- image/x-png
+ image/vnd.rn-realpix
+ misc/ultravox
+ text/google-video-pointer
+ text/x-google-video-pointer
+ video/3gp
video/3gpp
video/3gpp2
- video/anim
video/avi
video/divx
+ video/dv
+ video/fli
video/flv
- video/mkv
- video/mng
+ video/mp2t
video/mp4
+ video/mp4v-es
video/mpeg
video/mpeg-system
- video/mpg
video/msvideo
video/ogg
video/quicktime
+ video/vnd.divx
+ video/vnd.mpegurl
+ video/vnd.rn-realvideo
video/webm
video/x-anim
- video/x-flic
+ video/x-avi
+ video/x-flc
+ video/x-fli
video/x-flv
- video/x-matroska
- video/x-mng
video/x-m4v
+ video/x-matroska
video/x-mpeg
video/x-mpeg-system
+ video/x-mpeg2
video/x-ms-asf
- video/x-ms-wma
+ video/x-ms-asf-plugin
+ video/x-ms-asx
+ video/x-ms-wm
video/x-ms-wmv
+ video/x-ms-wmx
video/x-ms-wvx
video/x-msvideo
- video/x-quicktime
- audio/x-flac
- audio/x-ape
+ video/x-nsv
+ video/x-ogm
+ video/x-ogm+ogg
+ video/x-theora
+ video/x-theora+ogg
+ x-content/audio-cdda
+ x-content/audio-player
+ x-content/video-dvd
+ x-content/video-svcd
+ x-content/video-vcd
)
macro(CREATE_C_ARRAY var list)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/CMakeLists.txt
new/phonon-vlc-0.10.0/src/CMakeLists.txt
--- old/phonon-backend-vlc-0.9.1/src/CMakeLists.txt 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/CMakeLists.txt 2018-02-23 15:30:24.000000000
+0100
@@ -18,7 +18,10 @@
endif (KDEWIN_FOUND)
endif (MSVC OR (WIN32 AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"))
-if(${PHONON_VERSION} VERSION_GREATER "4.8.50")
+if(${PHONON_VERSION} VERSION_GREATER "4.9.50")
+ message(STATUS "Building against Phonon 4.10 API")
+ set(BACKEND_VERSION_DEFINE -DPHONON_BACKEND_VERSION_4_10)
+elseif(${PHONON_VERSION} VERSION_GREATER "4.8.50")
message(STATUS "Building against Phonon 4.9 API")
set(BACKEND_VERSION_DEFINE -DPHONON_BACKEND_VERSION_4_9)
elseif(${PHONON_VERSION} VERSION_GREATER "4.6.50")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/audio/audiooutput.cpp
new/phonon-vlc-0.10.0/src/audio/audiooutput.cpp
--- old/phonon-backend-vlc-0.9.1/src/audio/audiooutput.cpp 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/audio/audiooutput.cpp 2018-02-23
15:30:24.000000000 +0100
@@ -2,7 +2,7 @@
Copyright (C) 2007-2008 Tanguy Krotoff <[email protected]>
Copyright (C) 2008 Lukas Durfina <[email protected]>
Copyright (C) 2009 Fathi Boudra <[email protected]>
- Copyright (C) 2013-2015 Harald Sitter <[email protected]>
+ Copyright (C) 2013-2018 Harald Sitter <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -34,9 +34,11 @@
namespace VLC {
AudioOutput::AudioOutput(QObject *parent)
- : QObject(parent),
- m_volume(1.0)
+ : QObject(parent)
+ , m_volume(0.75)
+ , m_explicitVolume(false)
, m_muted(false)
+ , m_category(Phonon::NoCategory)
{
}
@@ -44,17 +46,44 @@
{
}
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+static libvlc_media_player_role categoryToRole(Category category)
+{
+ switch(category) {
+ case NoCategory:
+ return libvlc_role_None;
+ case NotificationCategory:
+ return libvlc_role_Notification;
+ case MusicCategory:
+ return libvlc_role_Music;
+ case VideoCategory:
+ return libvlc_role_Video;
+ case CommunicationCategory:
+ return libvlc_role_Communication;
+ case GameCategory:
+ return libvlc_role_Game;
+ case AccessibilityCategory:
+ return libvlc_role_Accessibility;
+ }
+ return libvlc_role_None;
+}
+#endif
+
void AudioOutput::handleConnectToMediaObject(MediaObject *mediaObject)
{
Q_UNUSED(mediaObject);
setOutputDeviceImplementation();
if (!PulseSupport::getInstance()->isActive()) {
+ // Rely on libvlc for updates if PASupport is not active
connect(m_player, SIGNAL(mutedChanged(bool)),
this, SLOT(onMutedChanged(bool)));
connect(m_player, SIGNAL(volumeChanged(float)),
this, SLOT(onVolumeChanged(float)));
applyVolume();
}
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ libvlc_media_player_set_role(*m_player, categoryToRole(m_category));
+#endif
}
void AudioOutput::handleAddToMedia(Media *media)
@@ -78,6 +107,7 @@
if (m_player) {
debug() << "async setting of volume to" << volume;
m_volume = volume;
+ m_explicitVolume = true;
applyVolume();
#if (LIBVLC_VERSION_INT < LIBVLC_VERSION(2, 2, 2, 0))
@@ -98,6 +128,11 @@
}
#endif
+void AudioOutput::setCategory(Category category)
+{
+ m_category = category;
+}
+
int AudioOutput::outputDevice() const
{
return m_device.index();
@@ -193,7 +228,7 @@
void AudioOutput::applyVolume()
{
- if (m_player) {
+ if (m_player && m_explicitVolume) {
const int preVolume = m_player->audioVolume();
const int newVolume = m_volume * 100;
m_player->setAudioVolume(newVolume);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/audio/audiooutput.h
new/phonon-vlc-0.10.0/src/audio/audiooutput.h
--- old/phonon-backend-vlc-0.9.1/src/audio/audiooutput.h 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/audio/audiooutput.h 2018-02-23
15:30:24.000000000 +0100
@@ -106,6 +106,8 @@
void setMuted(bool mute);
#endif
+ virtual void setCategory(Phonon::Category category);
+
signals:
void volumeChanged(qreal volume);
void audioDeviceFailed();
@@ -128,9 +130,12 @@
void setOutputDeviceImplementation();
qreal m_volume;
+ // Set after first setVolume to indicate volume was set manually.
+ bool m_explicitVolume;
bool m_muted;
AudioOutputDevice m_device;
QString m_streamUuid;
+ Category m_category;
};
} // namespace VLC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/backend.cpp
new/phonon-vlc-0.10.0/src/backend.cpp
--- old/phonon-backend-vlc-0.9.1/src/backend.cpp 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/backend.cpp 2018-02-23 15:30:24.000000000
+0100
@@ -147,13 +147,14 @@
fatal() << "Phonon::VLC::vlcInit: Failed to initialize VLC";
}
- // Initialise PulseAudio support
- PulseSupport *pulse = PulseSupport::getInstance();
#if (LIBVLC_VERSION_INT < LIBVLC_VERSION(2, 2, 2, 0))
// VLC 2.2 changed the stream creation order around internally which breaks
// the Pulseaudio hijacking. Since VLC upstream doesn't feel like giving us
// any more property control we now consider this feature unsupported. As
// such whatever properties VLC sets will be what pulse knows about us.
+
+ // Initialise PulseAudio support
+ PulseSupport *pulse = PulseSupport::getInstance();
pulse->enable(true);
connect(pulse, SIGNAL(objectDescriptionChanged(ObjectDescriptionType)),
SIGNAL(objectDescriptionChanged(ObjectDescriptionType)));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/equalizereffect.cpp
new/phonon-vlc-0.10.0/src/equalizereffect.cpp
--- old/phonon-backend-vlc-0.9.1/src/equalizereffect.cpp 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/equalizereffect.cpp 2018-02-23
15:30:24.000000000 +0100
@@ -72,6 +72,7 @@
void EqualizerEffect::handleConnectToMediaObject(MediaObject *mediaObject)
{
+ Q_UNUSED(mediaObject);
m_player->setEqualizer(m_equalizer);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/mediacontroller.cpp
new/phonon-vlc-0.10.0/src/mediacontroller.cpp
--- old/phonon-backend-vlc-0.9.1/src/mediacontroller.cpp 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/mediacontroller.cpp 2018-02-23
15:30:24.000000000 +0100
@@ -3,6 +3,7 @@
Copyright (C) 2008 Lukas Durfina <[email protected]>
Copyright (C) 2009 Fathi Boudra <[email protected]>
Copyright (C) 2009-2011 vlc-phonon AUTHORS <[email protected]>
+ Copyright (C) 2011-2018 Harald Sitter <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -247,12 +248,16 @@
{
GlobalAudioChannels::instance()->clearListFor(this);
- const int currentChannelId = m_player->subtitle();
+ const int currentChannelId = m_player->audioTrack();
int idCount = 0;
VLC_FOREACH_TRACK(it, m_player->audioTrackDescription()) {
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ idCount= it->i_id;
+#else
// LibVLC's internal ID is broken, so we simply count up as internally
// the setter will simply go by position in list anyway.
+#endif
GlobalAudioChannels::instance()->add(this, idCount,
QString::fromUtf8(it->psz_name), "");
if (idCount == currentChannelId) {
#ifdef __GNUC__
@@ -434,10 +439,18 @@
{
m_availableTitles = 0;
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ SharedTitleDescriptions list = m_player->titleDescription();
+ for (unsigned int i = 0; i < list->size(); ++i) {
+ ++m_availableTitles;
+ emit availableTitlesChanged(m_availableTitles);
+ }
+#else
VLC_FOREACH_TRACK(it, m_player->titleDescription()) {
++m_availableTitles;
emit availableTitlesChanged(m_availableTitles);
}
+#endif
}
// -------------------------------- Chapter ---------------------------------
//
@@ -463,10 +476,18 @@
m_availableChapters = 0;
// Get the description of available chapters for specific title
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ SharedChapterDescriptions list = m_player->videoChapterDescription(title);
+ for (unsigned int i = 0; i < list->size(); ++i) {
+ ++m_availableChapters;
+ emit availableChaptersChanged(m_availableChapters);
+ }
+#else
VLC_FOREACH_TRACK(it, m_player->videoChapterDescription(title)) {
++m_availableChapters;
emit availableChaptersChanged(m_availableChapters);
}
+#endif
}
// --------------------------------- Angle ----------------------------------
//
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/mediaobject.cpp
new/phonon-vlc-0.10.0/src/mediaobject.cpp
--- old/phonon-backend-vlc-0.9.1/src/mediaobject.cpp 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/mediaobject.cpp 2018-02-23 15:30:24.000000000
+0100
@@ -320,7 +320,7 @@
debug() << "MediaSource::Url:" << source.url();
if (source.url().scheme().isEmpty()) {
url = "file://";
- // QUrl considers url.scheme.isEmpty() == url.isRelative(),
+ // QUrl considers url.scheme.isEmpty() == url.isRelative(),
// so to be sure the url is not actually absolute we just
// check the first character
if (!source.url().toString().startsWith('/'))
@@ -595,7 +595,11 @@
bool MediaObject::hasVideo() const
{
- return m_player->hasVideoOutput();
+ // Cached: sometimes 4.0.0-dev sends the vout event but then
+ // has_vout is still false. Guard against this by simply always reporting
+ // the last hasVideoChanged value. If that is off we can still drop into
+ // libvlc in case it changed meanwhile.
+ return m_hasVideo || m_player->hasVideoOutput();
}
bool MediaObject::isSeekable() const
@@ -749,11 +753,12 @@
if (m_hasVideo != hasVideo) {
m_hasVideo = hasVideo;
emit hasVideoChanged(m_hasVideo);
- } else
+ } else {
// We can simply return if we are have the appropriate caching already.
// Otherwise we'd do pointless rescans of mediacontroller stuff.
// MC and MO are force-reset on media changes anyway.
return;
+ }
refreshDescriptors();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/mediaplayer.cpp
new/phonon-vlc-0.10.0/src/mediaplayer.cpp
--- old/phonon-backend-vlc-0.9.1/src/mediaplayer.cpp 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/mediaplayer.cpp 2018-02-23 15:30:24.000000000
+0100
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2011-2015 Harald Sitter <[email protected]>
+ Copyright (C) 2011-2018 Harald Sitter <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -177,7 +177,14 @@
bool MediaPlayer::setSubtitle(const QString &file)
{
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ return libvlc_media_player_add_slave(m_player,
+ libvlc_media_slave_type_subtitle,
+ file.toUtf8().data(),
+ true) == 0;
+#else
return libvlc_video_set_subtitle_file(m_player, file.toUtf8().data()) == 1;
+#endif
}
void MediaPlayer::setTitle(int title)
@@ -277,10 +284,11 @@
P_EMIT_STATE(ErrorState);
break;
case libvlc_MediaPlayerVout:
- if (event->u.media_player_vout.new_count > 0)
+ if (event->u.media_player_vout.new_count > 0) {
P_EMIT_HAS_VIDEO(true);
- else
+ } else {
P_EMIT_HAS_VIDEO(false);
+ }
break;
case libvlc_MediaPlayerMediaChanged:
break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/phonon-backend-vlc-0.9.1/src/mediaplayer.h
new/phonon-vlc-0.10.0/src/mediaplayer.h
--- old/phonon-backend-vlc-0.9.1/src/mediaplayer.h 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/mediaplayer.h 2018-02-23 15:30:24.000000000
+0100
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2011 Harald Sitter <[email protected]>
+ Copyright (C) 2011-2018 Harald Sitter <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -18,8 +18,9 @@
#ifndef PHONON_VLC_MEDIAPLAYER_H
#define PHONON_VLC_MEDIAPLAYER_H
-#include <QtCore/QObject>
-#include <QtCore/QSize>
+#include <QObject>
+#include <QSharedPointer>
+#include <QSize>
#include <vlc/libvlc_version.h>
#include <vlc/vlc.h>
@@ -32,6 +33,41 @@
class Media;
+template<class VLCArray>
+class Descriptions
+{
+public:
+ typedef void (*ReleaseFunction) (VLCArray**, unsigned int) ;
+
+ Descriptions(VLCArray **data,
+ unsigned int size,
+ ReleaseFunction release)
+ : m_release(release)
+ , m_data(data)
+ , m_size(size)
+ {
+ }
+
+ ~Descriptions()
+ {
+ m_release(m_data, m_size);
+ }
+
+ unsigned int size() const { return m_size; }
+
+private:
+ ReleaseFunction m_release;
+
+ VLCArray **m_data;
+ unsigned int m_size;
+};
+
+typedef Descriptions<libvlc_title_description_t> TitleDescriptions;
+typedef QSharedPointer<const TitleDescriptions> SharedTitleDescriptions;
+
+typedef Descriptions<libvlc_chapter_description_t> ChapterDescriptions;
+typedef QSharedPointer<ChapterDescriptions> SharedChapterDescriptions;
+
class MediaPlayer : public QObject
{
Q_OBJECT
@@ -113,16 +149,44 @@
int titleCount() const
{ return libvlc_media_player_get_title_count(m_player); }
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ SharedTitleDescriptions titleDescription() const
+ {
+ libvlc_title_description_t **data;
+ unsigned int size =
+ libvlc_media_player_get_full_title_descriptions(m_player,
&data);
+ return SharedTitleDescriptions(
+ new TitleDescriptions(
+ data, size,
+ &libvlc_title_descriptions_release)
+ );
+ }
+#else // deprecated
libvlc_track_description_t *titleDescription() const
{ return libvlc_video_get_title_description(m_player); }
+#endif
void setTitle(int title);
int videoChapterCount() const
{ return libvlc_media_player_get_chapter_count(m_player); }
+#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0))
+ SharedChapterDescriptions videoChapterDescription(int title) const
+ {
+ libvlc_chapter_description_t **data;
+ unsigned int size =
+ libvlc_media_player_get_full_chapter_descriptions(m_player, title,
&data);
+ return SharedChapterDescriptions(
+ new ChapterDescriptions(
+ data, size,
+ &libvlc_chapter_descriptions_release)
+ );
+ }
+#else // deprecated
libvlc_track_description_t *videoChapterDescription(int title) const
{ return libvlc_video_get_chapter_description(m_player, title); }
+#endif
void setChapter(int chapter);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/phonon-backend-vlc-0.9.1/src/video/videomemorystream.h
new/phonon-vlc-0.10.0/src/video/videomemorystream.h
--- old/phonon-backend-vlc-0.9.1/src/video/videomemorystream.h 2017-02-23
11:39:51.000000000 +0100
+++ new/phonon-vlc-0.10.0/src/video/videomemorystream.h 2018-02-23
15:30:24.000000000 +0100
@@ -18,6 +18,16 @@
#ifndef PHONON_VLC_VIDEOMEMORYSTREAM_H
#define PHONON_VLC_VIDEOMEMORYSTREAM_H
+// VLC 3.0 uses the restrict keyword. restrict is not a thing in C++, so
+// depending on the compiler you use an extension keyword or drop it entirely.
+#if defined(Q_CC_GNU)
+#define restrict __restrict__
+#elif defined(Q_CC_MSVC)
+#define restrict __restrict
+#else
+#define restrict
+#endif
+
#include <vlc/plugins/vlc_common.h>
#include <vlc/plugins/vlc_fourcc.h>
@@ -31,7 +41,7 @@
public:
explicit VideoMemoryStream();
virtual ~VideoMemoryStream();
-
+
/**
* @returns overall buffersize needed
*/