forked from pool/kaffeine
Accepting request 39485 from KDE:KDE4:Factory:Desktop
Copy from KDE:KDE4:Factory:Desktop/kaffeine based on submit request 39485 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/39485 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kaffeine?expand=0&rev=27
This commit is contained in:
parent
8139d5cfa3
commit
24ca15f221
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 14 13:14:00 UTC 2010 - llunak@novell.com
|
||||
|
||||
- support for on-demand codecs install using ksuseinstall
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 21 22:08:25 CET 2010 - jslaby@suse.de
|
||||
|
||||
|
@ -20,19 +20,20 @@
|
||||
|
||||
Name: kaffeine
|
||||
BuildRequires: libkdepimlibs4-devel
|
||||
BuildRequires: xine-devel
|
||||
BuildRequires: libksuseinstall-devel xine-devel
|
||||
Url: http://kaffeine.sourceforge.net/
|
||||
License: GPLv2+
|
||||
Group: Productivity/Multimedia/Video/Players
|
||||
Summary: Xine-Based Multimedia Player
|
||||
Version: 0.9+1.0pre3
|
||||
Release: 2
|
||||
Release: 3
|
||||
%define rversion 1.0-pre3
|
||||
# http://kaffeine.kde.org/?q=node/22
|
||||
Source0: kaffeine-%rversion.tar.gz
|
||||
Source1: kaffeine-icons.tar.bz2
|
||||
Patch1: fix_plasma_startup_error.diff
|
||||
Patch2: kaffeine-1.0-pre3-include_mkfifo.patch
|
||||
Patch3: ksuseinstall.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Requires: libqt4-sql-sqlite
|
||||
%kde4_runtime_requires
|
||||
@ -54,6 +55,7 @@ Authors:
|
||||
%setup -q -n kaffeine-%rversion -b 1
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
|
||||
%build
|
||||
%cmake_kde4 -d build
|
||||
|
151
ksuseinstall.diff
Normal file
151
ksuseinstall.diff
Normal file
@ -0,0 +1,151 @@
|
||||
--- src/CMakeLists.txt.sav 2010-01-31 18:04:50.000000000 +0100
|
||||
+++ src/CMakeLists.txt 2010-04-14 14:26:48.125514619 +0200
|
||||
@@ -43,6 +43,7 @@ configure_file(config-kaffeine.h.cmake $
|
||||
|
||||
kde4_add_executable(kaffeine ${kaffeine_SRCS})
|
||||
target_link_libraries(kaffeine ${QT_QTSQL_LIBRARY} ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_SOLID_LIBS})
|
||||
+target_link_libraries(kaffeine ksuseinstall)
|
||||
install(TARGETS kaffeine ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(FILES scanfile.dvb DESTINATION ${DATA_INSTALL_DIR}/kaffeine)
|
||||
install(FILES kaffeine.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
|
||||
--- src/backend-xine/xinecommands.h.sav 2010-04-14 14:02:32.000000000 +0200
|
||||
+++ src/backend-xine/xinecommands.h 2010-04-14 14:04:17.590512647 +0200
|
||||
@@ -59,7 +59,8 @@ namespace XineCommands
|
||||
UpdateAngles = 11,
|
||||
UpdateMouseTracking = 12,
|
||||
UpdateMouseCursor = 13,
|
||||
- UpdateVideoSize = 14
|
||||
+ UpdateVideoSize = 14,
|
||||
+ SupportedMimeTypes = 15
|
||||
};
|
||||
};
|
||||
|
||||
@@ -351,6 +352,13 @@ public:
|
||||
reinterpret_cast<const char *>(&videoSize), sizeof(videoSize));
|
||||
}
|
||||
|
||||
+ void supportedMimeTypes(const QString& mime)
|
||||
+ {
|
||||
+ writer->write(XineCommands::SupportedMimeTypes,
|
||||
+ reinterpret_cast<const char *>(mime.constData()),
|
||||
+ static_cast<unsigned int>(mime.size()) * sizeof(QChar));
|
||||
+ }
|
||||
+
|
||||
XinePipeWriterBase *writer;
|
||||
};
|
||||
|
||||
--- src/backend-xine/xinemediawidget.cpp.sav 2010-04-14 14:02:32.000000000 +0200
|
||||
+++ src/backend-xine/xinemediawidget.cpp 2010-04-14 14:38:25.957512431 +0200
|
||||
@@ -22,13 +22,17 @@
|
||||
#include "xinemediawidget_p.h"
|
||||
|
||||
#include <QResizeEvent>
|
||||
+#include <QTimer>
|
||||
#include <KDebug>
|
||||
+#include <KLocale>
|
||||
#include <KMessageBox>
|
||||
#include <KUrl>
|
||||
#include <config-kaffeine.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#include <ksuseinstall.h>
|
||||
+
|
||||
static QString binInstallPath()
|
||||
{
|
||||
return QString::fromUtf8(KAFFEINE_BIN_INSTALL_DIR "/");
|
||||
@@ -214,6 +218,15 @@ void XineProcess::readyRead()
|
||||
|
||||
break;
|
||||
}
|
||||
+ case XineCommands::SupportedMimeTypes: {
|
||||
+ QString mime = reader->readString();
|
||||
+
|
||||
+ if (reader->isValid()) {
|
||||
+ parent->supportedMimeTypes(mime);
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
default:
|
||||
kError() << "unknown command" << command;
|
||||
continue;
|
||||
@@ -795,6 +808,45 @@ void XineMediaWidget::updateVideoSize(un
|
||||
}
|
||||
}
|
||||
|
||||
+void XineMediaWidget::supportedMimeTypes(const QString &mime)
|
||||
+{
|
||||
+ // This is a bit lame, but simply check for a mimetype that the crippled package
|
||||
+ // does not provide.
|
||||
+ foreach( const QString& item, mime.split( ';' )) {
|
||||
+ QStringList fields = item.split( ':' );
|
||||
+ if( fields.count() == 3 ) {
|
||||
+ if( fields.first() == "audio/mp3" ) {
|
||||
+ return; // ok
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ QTimer::singleShot( 0, this, SLOT( installAdditionalCodecs()));
|
||||
+}
|
||||
+
|
||||
+void XineMediaWidget::installAdditionalCodecs()
|
||||
+{
|
||||
+ KGuiItem installGuiItem( KStandardGuiItem::yes());
|
||||
+ installGuiItem.setText( i18nc( "@action:button", "Install" ));
|
||||
+ if( KMessageBox::warningContinueCancel( window(),
|
||||
+ i18n( "Kaffeine currently cannot play some file formats. Do you want to install additional support?" ),
|
||||
+ i18n( "Install Additional Codecs" ),
|
||||
+ installGuiItem, KStandardGuiItem::no(), "suse_additional_codecs" ) != KMessageBox::Continue )
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ if( KSUSEInstall::installCapabilities( QStringList() << "libxine1-codecs",
|
||||
+ KSUSEInstall::FullInstallRequired, window()))
|
||||
+ { // TODO use the items
|
||||
+ KGuiItem restartNowGuiItem( KStandardGuiItem::yes());
|
||||
+ restartNowGuiItem.setText( i18nc( "@action:button", "Restart Now" ));
|
||||
+ KGuiItem restartLaterGuiItem( KStandardGuiItem::no());
|
||||
+ restartLaterGuiItem.setText( i18nc( "@action:button", "Restart Later" ));
|
||||
+ KMessageBox::information( window(),
|
||||
+ i18n( "The necessary support has been successfully installed."
|
||||
+ " It may be necessary to restart the application for the support to be activated." ));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void XineMediaWidget::playEncodedUrl(const QByteArray &encodedUrl, StateFlags stateFlags)
|
||||
{
|
||||
++sequenceNumber;
|
||||
--- src/backend-xine/xinemediawidget.h.sav 2010-01-31 18:04:50.000000000 +0100
|
||||
+++ src/backend-xine/xinemediawidget.h 2010-04-14 14:31:17.301512132 +0200
|
||||
@@ -127,6 +127,9 @@ public:
|
||||
|
||||
Q_DECLARE_FLAGS(DirtyFlags, DirtyFlag)
|
||||
|
||||
+private slots:
|
||||
+ void installAdditionalCodecs();
|
||||
+
|
||||
private:
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
@@ -149,6 +152,7 @@ private:
|
||||
void updateMouseTracking(bool mouseTrackingEnabled);
|
||||
void updateMouseCursor(bool pointingMouseCursor);
|
||||
void updateVideoSize(unsigned int videoSize_);
|
||||
+ void supportedMimeTypes(const QString &mime);
|
||||
|
||||
void playEncodedUrl(const QByteArray &encodedUrl, StateFlags stateFlags = 0);
|
||||
void stateChanged();
|
||||
--- src/backend-xine/xineapplication.cpp.sav 2010-04-14 14:02:32.000000000 +0200
|
||||
+++ src/backend-xine/xineapplication.cpp 2010-04-14 14:38:37.521511436 +0200
|
||||
@@ -292,6 +292,10 @@ void XineObject::init(quint64 windowId)
|
||||
QFile::encodeName(KStandardDirs::locateLocal("data", "kaffeine/xine-config")));
|
||||
xine_init(engine);
|
||||
|
||||
+ if( char* mimes = xine_get_mime_types( engine )) {
|
||||
+ parentProcess->supportedMimeTypes( mimes );
|
||||
+ }
|
||||
+
|
||||
QVector<const char *> audioDrivers;
|
||||
audioDrivers.append("auto");
|
||||
|
Loading…
x
Reference in New Issue
Block a user