Bugzilla – Attachment 229765 Details for
Bug 387406
Knotify crashes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
updated patch
phonon-wakeups.diff (text/plain), 54.46 KB, created by
Dirk Mueller
on 2008-07-24 14:16:06 UTC
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Dirk Mueller
Created:
2008-07-24 14:16:06 UTC
Size:
54.46 KB
patch
obsolete
>diff -ur a/kdebase-runtime-4.0.4/knotify/notifybysound.cpp b/kdebase-runtime-4.0.4/knotify/notifybysound.cpp >--- a/kdebase-runtime-4.0.4/knotify/notifybysound.cpp 2008-01-31 00:51:32.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/knotify/notifybysound.cpp 2008-07-24 16:11:26.000000000 +0200 >@@ -30,6 +30,8 @@ > > // QT headers > #include <QHash> >+#include <QtCore/QBasicTimer> >+#include <QtCore/QTimerEvent> > #include <QtCore/QStack> > #include <QSignalMapper> > >@@ -78,6 +80,7 @@ > > Player *getPlayer(); > void returnPlayer(Player *); >+ void clear(); > > void setVolume(float volume); > >@@ -110,6 +113,12 @@ > } > } > >+void PlayerPool::clear() >+{ >+ qDeleteAll(m_playerPool); >+ m_playerPool.clear(); >+} >+ > void PlayerPool::setVolume(float v) > { > m_volume = v; >@@ -128,6 +137,7 @@ > QHash<int, Player*> playerObjects; > QSignalMapper *signalmapper; > PlayerPool playerPool; >+ QBasicTimer poolTimer; > > int volume; > >@@ -216,6 +226,7 @@ > } > > kDebug(300) << " going to play " << soundFile; >+ d->poolTimer.stop(); > > if(d->playerMode == Private::UsePhonon) > { >@@ -248,6 +259,16 @@ > } > > >+void NotifyBySound::timerEvent(QTimerEvent *e) >+{ >+ if (e->timerId() == d->poolTimer.timerId()) { >+ d->poolTimer.stop(); >+ d->playerPool.clear(); >+ return; >+ } >+ KNotifyPlugin::timerEvent(e); >+} >+ > void NotifyBySound::slotSoundFinished(int id) > { > kDebug(300) << id; >@@ -256,6 +277,7 @@ > Player *player=d->playerObjects.take(id); > disconnect(player->media, SIGNAL(finished()), d->signalmapper, SLOT(map())); > d->playerPool.returnPlayer(player); >+ d->poolTimer.start(1000, this); > } > if(d->processes.contains(id)) > { >@@ -273,6 +295,7 @@ > Player *p = d->playerObjects.take(id); > p->stop(); > d->playerPool.returnPlayer(p); >+ d->poolTimer.start(1000, this); > } > if(d->processes.contains(id)) > { >diff -ur a/kdebase-runtime-4.0.4/knotify/notifybysound.h b/kdebase-runtime-4.0.4/knotify/notifybysound.h >--- a/kdebase-runtime-4.0.4/knotify/notifybysound.h 2008-01-05 00:54:07.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/knotify/notifybysound.h 2008-07-24 16:11:26.000000000 +0200 >@@ -44,7 +44,9 @@ > public: > void setVolume( int v ); > >- >+ protected: >+ void timerEvent(QTimerEvent *); >+ > private Q_SLOTS: > void slotSoundFinished(int id); > }; >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/audiooutput.cpp b/kdebase-runtime-4.0.4/phonon/xine/audiooutput.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/audiooutput.cpp 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/audiooutput.cpp 2008-04-22 12:24:36.000000000 +0200 >@@ -43,8 +43,7 @@ > > #define K_XT(type) (static_cast<type *>(SinkNode::threadSafeObject().data())) > AudioOutput::AudioOutput(QObject *parent) >- : AbstractAudioOutput(new AudioOutputXT, parent), >- m_device(1) >+ : AbstractAudioOutput(new AudioOutputXT, parent) > { > } > >@@ -60,7 +59,7 @@ > > int AudioOutput::outputDevice() const > { >- return m_device; >+ return m_device.index(); > } > > void AudioOutput::setVolume(qreal newVolume) >@@ -85,6 +84,11 @@ > > bool AudioOutput::setOutputDevice(int newDevice) > { >+ return setOutputDevice(AudioOutputDevice::fromIndex(newDevice)); >+} >+ >+bool AudioOutput::setOutputDevice(const AudioOutputDevice &newDevice) >+{ > AudioPort newPort(newDevice); > if (!newPort.isValid()) { > kDebug(610) << "new audio port is invalid"; >@@ -92,7 +96,6 @@ > } > m_device = newDevice; > K_XT(AudioOutputXT)->m_audioPort = newPort; >- K_XT(AudioOutputXT)->m_audioPort.setAudioOutput(this); > SourceNode *src = source(); > if (src) { > QList<WireCall> wireCall; >@@ -126,7 +129,11 @@ > switch (ev->type()) { > case Event::AudioDeviceFailed: > ev->accept(); >- emit audioDeviceFailed(); >+ // we don't know for sure which AudioPort failed. but the one without any >+ // capabilities must be the guilty one >+ if (K_XT(AudioOutputXT)->m_audioPort.hasFailed()) { >+ emit audioDeviceFailed(); >+ } > return true; > default: > return AbstractAudioOutput::event(ev); >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/audiooutput.h b/kdebase-runtime-4.0.4/phonon/xine/audiooutput.h >--- a/kdebase-runtime-4.0.4/phonon/xine/audiooutput.h 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/audiooutput.h 2008-04-21 23:23:36.000000000 +0200 >@@ -1,6 +1,6 @@ > /* This file is part of the KDE project > Copyright (C) 2006 Tim Beaulen <tbscope@gmail.com> >- Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> >+ Copyright (C) 2006-2008 Matthias Kretz <kretz@kde.org> > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU Library General Public >@@ -63,6 +63,7 @@ > // Attributes Setters: > void setVolume(qreal newVolume); > bool setOutputDevice(int newDevice); >+ bool setOutputDevice(const AudioOutputDevice &newDevice); > > void downstreamEvent(Event *); > >@@ -78,7 +79,7 @@ > > private: > qreal m_volume; >- int m_device; >+ AudioOutputDevice m_device; > }; > }} //namespace Phonon::Xine > >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/audioport.cpp b/kdebase-runtime-4.0.4/phonon/xine/audioport.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/audioport.cpp 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/audioport.cpp 2008-07-24 16:09:38.000000000 +0200 >@@ -1,5 +1,5 @@ > /* This file is part of the KDE project >- Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> >+ Copyright (C) 2006-2008 Matthias Kretz <kretz@kde.org> > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU Library General Public >@@ -25,6 +25,7 @@ > #include <QByteArray> > #include <QStringList> > #include <xine.h> >+#include <xine/audio_out.h> > #include <QSharedData> > #include <kdebug.h> > #include <QtCore/QTimerEvent> >@@ -98,56 +99,65 @@ > waitALittleWithDying(); // xine still accesses the port after a rewire :( > } > >-AudioPort::AudioPort(int deviceIndex) >+AudioPort::AudioPort(const AudioOutputDevice &deviceDesc) > : d(new AudioPortData) > { >- QByteArray outputPlugin = XineEngine::audioDriverFor(deviceIndex); >- //kDebug(610) << outputPlugin << alsaDevices; >+ QVariant v = deviceDesc.property("driver"); >+ if (!v.isValid()) { >+ const QByteArray outputPlugin = XineEngine::audioDriverFor(deviceDesc.index()); >+ kDebug(610) << "use output plugin:" << outputPlugin; >+ d->port = xine_open_audio_driver(XineEngine::xine(), outputPlugin.constData(), 0); >+ } else { >+ const QByteArray outputPlugin = v.toByteArray(); >+ v = deviceDesc.property("deviceIds"); >+ const QStringList deviceIds = v.toStringList(); >+ if (deviceIds.isEmpty()) { >+ return; >+ } >+ kDebug(610) << "*** audio output plugin is: " << outputPlugin; > >- if (outputPlugin == "alsa") { >- QStringList alsaDevices = XineEngine::alsaDevicesFor(deviceIndex); >- foreach (QString device, alsaDevices) { >- xine_cfg_entry_t alsaDeviceConfig; >- QByteArray deviceStr = device.toUtf8(); >- if(!xine_config_lookup_entry(XineEngine::xine(), "audio.device.alsa_default_device", >- &alsaDeviceConfig)) { >- // the config key is not registered yet - it is registered when the alsa output >- // plugin is opened. So we open the plugin and close it again, then we can set the >- // setting. :( >- xine_audio_port_t *port = xine_open_audio_driver(XineEngine::xine(), outputPlugin.constData(), 0); >- if (port) { >- xine_close_audio_driver(XineEngine::xine(), port); >- // port == 0 does not have to be fatal, since it might be only the default device >- // that cannot be opened >- //kError(610) << "creating the correct ALSA output failed!"; >- //return; >- } >- // now the config key should be registered >+ if (outputPlugin == "alsa") { >+ foreach (const QString &device, deviceIds) { >+ xine_cfg_entry_t alsaDeviceConfig; >+ QByteArray deviceStr = device.toUtf8(); > if(!xine_config_lookup_entry(XineEngine::xine(), "audio.device.alsa_default_device", > &alsaDeviceConfig)) { >- kError(610) << "cannot set the ALSA device on Xine's ALSA output plugin"; >- return; >+ // the config key is not registered yet - it is registered when the alsa output >+ // plugin is opened. So we open the plugin and close it again, then we can set the >+ // setting. :( >+ xine_audio_port_t *port = xine_open_audio_driver(XineEngine::xine(), "alsa", 0); >+ if (port) { >+ xine_close_audio_driver(XineEngine::xine(), port); >+ // port == 0 does not have to be fatal, since it might be only the default device >+ // that cannot be opened >+ } >+ // now the config key should be registered >+ if(!xine_config_lookup_entry(XineEngine::xine(), "audio.device.alsa_default_device", >+ &alsaDeviceConfig)) { >+ kError(610) << "cannot set the ALSA device on Xine's ALSA output plugin"; >+ return; >+ } >+ } >+ Q_ASSERT(alsaDeviceConfig.type == XINE_CONFIG_TYPE_STRING); >+ alsaDeviceConfig.str_value = deviceStr.data(); >+ xine_config_update_entry(XineEngine::xine(), &alsaDeviceConfig); >+ >+ int err = xine_config_lookup_entry(XineEngine::xine(), "audio.device.alsa_front_device", &alsaDeviceConfig); >+ Q_ASSERT(err); >+ Q_ASSERT(alsaDeviceConfig.type == XINE_CONFIG_TYPE_STRING); >+ alsaDeviceConfig.str_value = deviceStr.data(); >+ xine_config_update_entry(XineEngine::xine(), &alsaDeviceConfig); >+ >+ d->port = xine_open_audio_driver(XineEngine::xine(), "alsa", 0); >+ if (d->port) { >+ kDebug(610) << "use ALSA device: " << device; >+ break; > } > } >- Q_ASSERT(alsaDeviceConfig.type == XINE_CONFIG_TYPE_STRING); >- alsaDeviceConfig.str_value = deviceStr.data(); >- xine_config_update_entry(XineEngine::xine(), &alsaDeviceConfig); >- >- int err = xine_config_lookup_entry(XineEngine::xine(), "audio.device.alsa_front_device", &alsaDeviceConfig); >- Q_ASSERT(err); >- Q_ASSERT(alsaDeviceConfig.type == XINE_CONFIG_TYPE_STRING); >- alsaDeviceConfig.str_value = deviceStr.data(); >- xine_config_update_entry(XineEngine::xine(), &alsaDeviceConfig); >- >- d->port = xine_open_audio_driver(XineEngine::xine(), outputPlugin.constData(), 0); >- if (d->port) { >- kDebug(610) << "use ALSA device: " << device; >- break; >- } >+ } else if (outputPlugin == "oss") { >+ kDebug(610) << "use OSS output"; >+ d->port = xine_open_audio_driver(XineEngine::xine(), "oss", 0); > } >- } else { >- kDebug(610) << "use output plugin:" << outputPlugin; >- d->port = xine_open_audio_driver(XineEngine::xine(), outputPlugin.constData(), 0); > } > kDebug(610) << "----------------------------------------------- audio_port created"; > } >@@ -186,14 +196,16 @@ > return d->port; > } > >-void AudioPort::setAudioOutput(QObject *audioOutput) >-{ >- d->audioOutput = audioOutput; >-} >- >-QObject *AudioPort::audioOutput() const >+bool AudioPort::hasFailed() const > { >- return d->audioOutput; >+ if (!d->port) { >+ return true; >+ } >+ const uint32_t cap = d->port->get_capabilities(d->port); >+ if (cap == AO_CAP_NOCAP) { >+ return true; >+ } >+ return false; > } > > } // namespace Xine >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/audioport.h b/kdebase-runtime-4.0.4/phonon/xine/audioport.h >--- a/kdebase-runtime-4.0.4/phonon/xine/audioport.h 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/audioport.h 2008-04-22 12:24:36.000000000 +0200 >@@ -1,5 +1,5 @@ > /* This file is part of the KDE project >- Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> >+ Copyright (C) 2006-2008 Matthias Kretz <kretz@kde.org> > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU Library General Public >@@ -25,6 +25,7 @@ > #include <xine.h> > #include <QSharedData> > #include <QObject> >+#include <Phonon/AudioOutputDevice> > > > namespace Phonon >@@ -49,7 +50,7 @@ > friend class EffectXT; > public: > AudioPort(); >- AudioPort(int deviceIndex); >+ AudioPort(const AudioOutputDevice &deviceDesc); > > bool isValid() const; > bool operator==(const AudioPort &rhs) const; >@@ -60,11 +61,7 @@ > operator xine_audio_port_t *() const; > xine_audio_port_t *xinePort() const; > >- /** >- * used to send XINE_EVENT_AUDIO_DEVICE_FAILED to the AudioOutput >- */ >- void setAudioOutput(QObject *audioOutput); >- QObject *audioOutput() const; >+ bool hasFailed() const; > > AudioPort(const AudioPort &); > AudioPort &operator=(const AudioPort &); >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/backend.cpp b/kdebase-runtime-4.0.4/phonon/xine/backend.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/backend.cpp 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/backend.cpp 2008-07-24 16:09:38.000000000 +0200 >@@ -20,6 +20,7 @@ > */ > > #include "backend.h" >+//#include <phonon/experimental/backendinterface.h> > #include "mediaobject.h" > #include "effect.h" > #include "events.h" >@@ -28,7 +29,7 @@ > #include "nullsink.h" > #include "visualization.h" > #include "volumefadereffect.h" >-#include "videodataoutput.h" >+//#include "videodataoutput.h" > #include "videowidget.h" > #include "wirecall.h" > #include "xinethread.h" >@@ -44,9 +45,6 @@ > #include <QtCore/QVariant> > #include <QtGui/QApplication> > >-#include <phonon/audiodevice.h> >-#include <phonon/audiodeviceenumerator.h> >- > extern "C" { > #include <xine/xine_plugin.h> > #include "shareddata.h" >@@ -109,8 +107,8 @@ > return new AudioDataOutput(parent); > case VisualizationClass: > return new Visualization(parent); >- case VideoDataOutputClass: >- return new VideoDataOutput(parent); >+ //case Phonon::Experimental::BackendInterface::VideoDataOutputClass: >+ //return new VideoDataOutput(parent); > case EffectClass: > { > Q_ASSERT(args.size() == 1); >@@ -169,7 +167,7 @@ > QString mimeTypes(mimeTypes_c); > free(mimeTypes_c); > QStringList lstMimeTypes = mimeTypes.split(";", QString::SkipEmptyParts); >- foreach (QString mimeType, lstMimeTypes) >+ foreach (const QString &mimeType, lstMimeTypes) > m_supportedMimeTypes << mimeType.left(mimeType.indexOf(':')).trimmed(); > if (m_supportedMimeTypes.contains("application/ogg")) > m_supportedMimeTypes << QLatin1String("audio/x-vorbis+ogg") << QLatin1String("application/ogg"); >@@ -185,15 +183,11 @@ > { > case Phonon::AudioOutputDeviceType: > return XineEngine::audioOutputIndexes(); >-/* >+#if KDE_IS_VERSION(4,1,0) > case Phonon::AudioCaptureDeviceType: >- { >- QList<AudioDevice> devlist = AudioDeviceEnumerator::availableCaptureDevices(); >- foreach (AudioDevice dev, devlist) { >- list << dev.index(); >- } >- } > break; >+#endif >+/* > case Phonon::VideoOutputDeviceType: > { > const char *const *outputPlugins = xine_list_video_output_plugins(XineEngine::xine()); >@@ -224,6 +218,17 @@ > } */ > break; > } >+#if KDE_IS_VERSION(4,1,0) >+ case Phonon::AudioChannelType: >+ case Phonon::SubtitleType: >+ { >+ ObjectDescriptionHash hash = XineEngine::objectDescriptions(); >+ ObjectDescriptionHash::iterator it = hash.find(type); >+ if( it != hash.end() ) >+ list = it.value().keys(); >+ } >+ break; >+#endif > } > return list; > } >@@ -236,39 +241,11 @@ > case Phonon::AudioOutputDeviceType: > ret = XineEngine::audioOutputProperties(index); > break; >- /* >+#if KDE_IS_VERSION(4,1,0) > case Phonon::AudioCaptureDeviceType: >- { >- QList<AudioDevice> devlist = AudioDeviceEnumerator::availableCaptureDevices(); >- foreach (AudioDevice dev, devlist) { >- if (dev.index() == index) { >- ret.insert("name", dev.cardName()); >- switch (dev.driver()) { >- case Solid::AudioInterface::Alsa: >- ret.insert("description", i18n("ALSA Capture Device")); >- break; >- case Solid::AudioInterface::OpenSoundSystem: >- ret.insert("description", i18n("OSS Capture Device")); >- break; >- case Solid::AudioInterface::UnknownAudioDriver: >- break; >- } >- ret.insert("icon", dev.iconName()); >- ret.insert("available", dev.isAvailable()); >- break; >- } >- } >- } >- switch (index) { >- case 20000: >- ret.insert("name", QLatin1String("Soundcard")); >- break; >- case 20001: >- ret.insert("name", QLatin1String("DV")); >- break; >- } >- //kDebug(610) << ret["name"]; > break; >+#endif >+ /* > case Phonon::VideoOutputDeviceType: > { > const char *const *outputPlugins = xine_list_video_output_plugins(XineEngine::xine()); >@@ -324,6 +301,24 @@ > } */ > } > break; >+#if KDE_IS_VERSION(4,1,0) >+ case Phonon::AudioChannelType: >+ case Phonon::SubtitleType: >+ { >+ ObjectDescriptionHash descriptionHash = XineEngine::objectDescriptions(); >+ ObjectDescriptionHash::iterator descIt = descriptionHash.find(type); >+ if(descIt != descriptionHash.end()) >+ { >+ ChannelIndexHash indexHash = descIt.value(); >+ ChannelIndexHash::iterator indexIt = indexHash.find(index); >+ if(indexIt != indexHash.end() ) >+ { >+ ret = indexIt.value(); >+ } >+ } >+ } >+ break; >+#endif > } > return ret; > } >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/backend.h b/kdebase-runtime-4.0.4/phonon/xine/backend.h >--- a/kdebase-runtime-4.0.4/phonon/xine/backend.h 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/backend.h 2008-03-13 17:26:03.000000000 +0100 >@@ -21,9 +21,12 @@ > #ifndef Phonon_XINE_BACKEND_H > #define Phonon_XINE_BACKEND_H > >+#include <QByteArray> >+#include <QHash> > #include <QList> > #include <QPointer> > #include <QStringList> >+#include <QVariant> > > #include <xine.h> > #include <xine/xineutils.h> >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/bytestream.cpp b/kdebase-runtime-4.0.4/phonon/xine/bytestream.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/bytestream.cpp 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/bytestream.cpp 2008-07-18 21:32:49.000000000 +0200 >@@ -223,11 +223,12 @@ > Q_ASSERT(m_eod); > if (m_buffersize > 0) { > PXINE_VDEBUG << "calling pullBuffer with m_buffersize = " << m_buffersize; >- pullBuffer(static_cast<char *>(buf), m_buffersize); >- m_currentPosition += m_buffersize; >+ const int len = m_buffersize; >+ pullBuffer(static_cast<char *>(buf), len); >+ m_currentPosition += len; > PXINE_DEBUG << "returning less data than requested, the stream is at its end"; > //kDebug(610) << "UNLOCKING m_mutex: "; >- return m_buffersize; >+ return len; > } > PXINE_DEBUG << "return 0, the stream is at its end"; > //kDebug(610) << "UNLOCKING m_mutex: "; >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/bytestream.h b/kdebase-runtime-4.0.4/phonon/xine/bytestream.h >--- a/kdebase-runtime-4.0.4/phonon/xine/bytestream.h 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/bytestream.h 2008-05-26 19:19:31.000000000 +0200 >@@ -26,7 +26,7 @@ > #include <xine.h> > > #include "xineengine.h" >-#include <phonon/streaminterface.h> >+#include <Phonon/StreamInterface> > #include <QByteArray> > #include <QSharedData> > #include <QQueue> >@@ -46,7 +46,6 @@ > class ByteStream : public QObject, public StreamInterface, public QSharedData > { > Q_OBJECT >- Q_INTERFACES(Phonon::StreamInterface) > public: > static ByteStream *fromMrl(const QByteArray &mrl); > ByteStream(const MediaSource &, MediaObject *parent); >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/bytestreamplugin.cpp b/kdebase-runtime-4.0.4/phonon/xine/bytestreamplugin.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/bytestreamplugin.cpp 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/bytestreamplugin.cpp 2008-06-06 21:18:48.000000000 +0200 >@@ -200,7 +200,7 @@ > if (kbytestream_plugin_get_length (this_gen) == 0) { > _x_message(that->stream(), XINE_MSG_FILE_EMPTY, that->mrl(), NULL); > xine_log (that->stream()->xine, XINE_LOG_MSG, >- _("input_kbytestream: File empty: >%s<\n"), that->mrl()); >+ "input_kbytestream: File empty: >%s<\n", that->mrl()); > return 0; > } > >@@ -249,22 +249,33 @@ > return that; > } > >+#define PLUGIN_DESCRIPTION "kbytestream input plugin" >+#define PLUGIN_IDENTIFIER "kbytestream" >+ >+#if XINE_MAJOR_VERSION < 1 || ( XINE_MAJOR_VERSION == 1 && ( XINE_MINOR_VERSION < 1 || ( XINE_MINOR_VERSION == 1 && XINE_SUB_VERSION < 90 ) ) ) >+#define NEED_DESCRIPTION_FUNCTION 1 >+#else >+#define NEED_DESCRIPTION_FUNCTION 0 >+#endif >+ >+#if NEED_DESCRIPTION_FUNCTION > #if (XINE_SUB_VERSION > 3 && XINE_MINOR_VERSION == 1) || (XINE_MINOR_VERSION > 1 && XINE_MAJOR_VERSION == 1) || XINE_MAJOR_VERSION > 1 > static const char *kbytestream_class_get_description(input_class_t *) > { >- return _("kbytestream input plugin"); >+ return PLUGIN_DESCRIPTION; > } > #else > static char *kbytestream_class_get_description(input_class_t *) > { >- return const_cast<char *>(_("kbytestream input plugin")); >+ return const_cast<char *>(PLUGIN_DESCRIPTION); > } > #endif > > static const char *kbytestream_class_get_identifier(input_class_t *) > { >- return "kbytestream"; >+ return PLUGIN_IDENTIFIER; > } >+#endif /* NEED_DESCRIPTION_FUNCTIONS */ > > static void kbytestream_class_dispose (input_class_t *this_gen) > { >@@ -279,8 +290,14 @@ > memset(that, 0, sizeof(that)); > > that->get_instance = kbytestream_class_get_instance; >+#if NEED_DESCRIPTION_FUNCTION > that->get_identifier = kbytestream_class_get_identifier; > that->get_description = kbytestream_class_get_description; >+#else >+ that->description = PLUGIN_DESCRIPTION; >+ that->text_domain = "phonon-xine"; >+ that->identifier = PLUGIN_IDENTIFIER; >+#endif > that->get_dir = NULL; > that->get_autoplay_list = NULL; > that->dispose = kbytestream_class_dispose; >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/CMakeLists.txt b/kdebase-runtime-4.0.4/phonon/xine/CMakeLists.txt >--- a/kdebase-runtime-4.0.4/phonon/xine/CMakeLists.txt 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/CMakeLists.txt 2008-07-24 16:09:38.000000000 +0200 >@@ -18,7 +18,7 @@ > effect.cpp > audiooutput.cpp > mediaobject.cpp >- videodataoutput.cpp >+ #videodataoutput.cpp > visualization.cpp > backend.cpp > volumefadereffect.cpp >@@ -43,7 +43,7 @@ > macro_log_feature(XCB_VIDEO "XCB" "XCB is needed for the video widget, libxine needs to be compiled with XCB" "http://xcb.freedesktop.org/") > > kde4_add_plugin(phonon_xine ${phonon_xine_PART_SRCS}) >-target_link_libraries(phonon_xine ${QT_QTGUI_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_PHONON_LIBS} ${XINE_LIBRARY} ${KDE4_KAUDIODEVICELIST_LIBS}) >+target_link_libraries(phonon_xine ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_PHONON_LIBS} ${XINE_LIBRARY} ${KDE4_KAUDIODEVICELIST_LIBS}) > if(XCB_FOUND AND XINE_XCB_FOUND) > target_link_libraries(phonon_xine ${LIBXCB_LIBRARIES}) > endif(XCB_FOUND AND XINE_XCB_FOUND) >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/mediaobject.cpp b/kdebase-runtime-4.0.4/phonon/xine/mediaobject.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/mediaobject.cpp 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/mediaobject.cpp 2008-07-24 16:09:38.000000000 +0200 >@@ -1,6 +1,7 @@ > /* This file is part of the KDE project > Copyright (C) 2006 Tim Beaulen <tbscope@gmail.com> > Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> >+ Copyright (C) 2008 Ian Monroe <imonroe@kde.org> > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU Library General Public >@@ -35,6 +36,7 @@ > > #include <kdebug.h> > #include <klocale.h> >+#include <kdeversion.h> > > #include <cmath> > #include "xinethread.h" >@@ -76,6 +78,8 @@ > connect(m_stream, SIGNAL(hasVideoChanged(bool)), SLOT(handleHasVideoChanged(bool))); > connect(m_stream, SIGNAL(bufferStatus(int)), SIGNAL(bufferStatus(int))); > connect(m_stream, SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); >+ connect(m_stream, SIGNAL(availableSubtitlesChanged()), SIGNAL(availableSubtitlesChanged())); >+ connect(m_stream, SIGNAL(availableAudioChannelsChanged()), SIGNAL(availableAudioChannelsChanged())); > connect(m_stream, SIGNAL(availableChaptersChanged(int)), SIGNAL(availableChaptersChanged(int))); > connect(m_stream, SIGNAL(chapterChanged(int)), SIGNAL(chapterChanged(int))); > connect(m_stream, SIGNAL(availableAnglesChanged(int)), SIGNAL(availableAnglesChanged(int))); >@@ -204,71 +208,6 @@ > m_stream->setTickInterval(m_tickInterval); > } > >-/* >-QList<AudioStreamDescription> MediaObject::availableAudioStreams() const >-{ >- // TODO >- QStringList ret; >- ret << QLatin1String("en") << QLatin1String("de"); >- return ret; >-} >- >-QList<VideoStreamDescription> MediaObject::availableVideoStreams() const >-{ >- // TODO >- QStringList ret; >- ret << QLatin1String("en") << QLatin1String("de"); >- return ret; >-} >- >-QList<SubtitleStreamDescription> MediaObject::availableSubtitleStreams() const >-{ >- // TODO >- QStringList ret; >- ret << QLatin1String("en") << QLatin1String("de"); >- return ret; >-} >- >-AudioStreamDescription MediaObject::currentAudioStream(const QObject *audioPath) const >-{ >- // TODO >- return m_currentAudioStream[audioPath]; >-} >- >-VideoStreamDescription MediaObject::currentVideoStream(const QObject *videoPath) const >-{ >- // TODO >- return m_currentVideoStream[videoPath]; >-} >- >-SubtitleStreamDescription MediaObject::currentSubtitleStream(const QObject *videoPath) const >-{ >- // TODO >- return m_currentSubtitleStream[videoPath]; >-} >- >-void MediaObject::setCurrentAudioStream(const QString &streamName, const QObject *audioPath) >-{ >- // TODO >- if(availableAudioStreams().contains(streamName)) >- m_currentAudioStream[audioPath] = streamName; >-} >- >-void MediaObject::setCurrentVideoStream(const QString &streamName, const QObject *videoPath) >-{ >- // TODO >- if(availableVideoStreams().contains(streamName)) >- m_currentVideoStream[videoPath] = streamName; >-} >- >-void MediaObject::setCurrentSubtitleStream(const QString &streamName, const QObject *videoPath) >-{ >- // TODO >- if(availableSubtitleStreams().contains(streamName)) >- m_currentSubtitleStream[videoPath] = streamName; >-} >-*/ >- > void MediaObject::play() > { > kDebug(610) << green << "PLAY" << normal; >@@ -558,6 +497,18 @@ > return true; > } > break; >+#if KDE_IS_VERSION(4,1,0) >+ case AddonInterface::SubtitleInterface: >+ if (stream().subtitlesSize() > 0) { //subtitles off by default, enable if any >+ return true; >+ } >+ break; >+ case AddonInterface::AudioChannelInterface: >+ if (stream().audioChannelsSize() > 1) { //first audio channel on by default, enable if > 1 >+ return true; >+ } >+ break; >+#endif > } > return false; > } >@@ -581,6 +532,7 @@ > QVariant MediaObject::interfaceCall(Interface interface, int command, const QList<QVariant> &arguments) > { > kDebug(610) << interface << ", " << command; >+ > switch (interface) { > case AddonInterface::ChapterInterface: > switch (static_cast<AddonInterface::ChapterCommand>(command)) { >@@ -632,7 +584,8 @@ > } > kDebug(610) << "change title from " << m_currentTitle << " to " << t; > m_currentTitle = t; >- stream().setMrl(m_titles[t - 1], m_autoplayTitles ? XineStream::KeepState : XineStream::StoppedState); >+ stream().setMrl(m_titles[t - 1], >+ m_autoplayTitles ? XineStream::KeepState : XineStream::StoppedState); > if (m_mediaSource.discType() == Phonon::Cd) { > emit titleChanged(m_currentTitle); > } >@@ -662,6 +615,41 @@ > return true; > } > } >+ break; >+#if KDE_IS_VERSION(4,1,0) >+ case AddonInterface::SubtitleInterface: >+ switch (static_cast<AddonInterface::SubtitleCommand>(command)) >+ { >+ case AddonInterface::availableSubtitles: >+ return QVariant::fromValue( m_stream->availableSubtitles() ); >+ case AddonInterface::currentSubtitle: >+ return QVariant::fromValue(m_stream->currentSubtitle()); >+ case AddonInterface::setCurrentSubtitle: >+ if (arguments.isEmpty() || !arguments.first().canConvert<SubtitleDescription>() ) { >+ kDebug(610) << "arguments invalid"; >+ return false; >+ } >+ m_stream->setCurrentSubtitle( arguments.first().value<SubtitleDescription>() ); >+ return true; >+ } >+ break; >+ case AddonInterface::AudioChannelInterface: >+ switch (static_cast<AddonInterface::AudioChannelCommand>(command)) >+ { >+ case AddonInterface::availableAudioChannels: >+ return QVariant::fromValue( m_stream->availableAudioChannels() ); >+ case AddonInterface::currentAudioChannel: >+ return QVariant::fromValue( m_stream->currentAudioChannel() ); >+ case AddonInterface::setCurrentAudioChannel: >+ if (arguments.isEmpty() || !arguments.first().canConvert<AudioChannelDescription>() ) { >+ kDebug(610) << "arguments invalid"; >+ return false; >+ } >+ m_stream->setCurrentAudioChannel( arguments.first().value<AudioChannelDescription>() ); >+ return true; >+ } >+ break; >+#endif > } > return QVariant(); > } >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/mediaobject.h b/kdebase-runtime-4.0.4/phonon/xine/mediaobject.h >--- a/kdebase-runtime-4.0.4/phonon/xine/mediaobject.h 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/mediaobject.h 2008-03-15 23:03:10.000000000 +0100 >@@ -62,20 +62,6 @@ > Q_INVOKABLE qint64 remainingTime() const; > qint32 tickInterval() const; > >- /* >- QList<AudioStreamDescription> availableAudioStreams() const; >- QList<VideoStreamDescription> availableVideoStreams() const; >- QList<SubtitleStreamDescription> availableSubtitleStreams() const; >- >- AudioStreamDescription currentAudioStream(const QObject *audioPath) const; >- VideoStreamDescription currentVideoStream(const QObject *videoPath) const; >- SubtitleStreamDescription currentSubtitleStream(const QObject *videoPath) const; >- >- void setCurrentAudioStream(const QString &streamName, const QObject *audioPath); >- void setCurrentVideoStream(const QString &streamName, const QObject *videoPath); >- void setCurrentSubtitleStream(const QString &streamName, const QObject *videoPath); >- */ >- > void setTickInterval(qint32 newTickInterval); > void play(); > void pause(); >@@ -123,6 +109,8 @@ > void asyncSeek(xine_stream_t *, qint64, bool); > > // AddonInterface >+ void availableSubtitlesChanged(); >+ void availableAudioChannelsChanged(); > void availableTitlesChanged(int); > void titleChanged(int); > void availableChaptersChanged(int); >@@ -154,10 +142,6 @@ > qint32 m_tickInterval; > QPointer<ByteStream> m_bytestream; > >- QHash<const QObject *, QString> m_currentAudioStream; >- QHash<const QObject *, QString> m_currentVideoStream; >- QHash<const QObject *, QString> m_currentSubtitleStream; >- > mutable int m_currentTimeOverride; > MediaSource m_mediaSource; > QList<QByteArray> m_titles; >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.cpp b/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.cpp 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.cpp 2008-05-27 09:18:57.000000000 +0200 >@@ -21,6 +21,9 @@ > #include "videodataoutput.h" > #include <kdebug.h> > #include "sourcenode.h" >+#include <Phonon/Experimental/AbstractVideoDataOutput> >+ >+#define K_XT(type) (static_cast<type *>(SinkNode::threadSafeObject().data())) > > namespace Phonon > { >@@ -29,13 +32,86 @@ > class VideoDataOutputXT : public SinkNodeXT > { > public: >+ VideoDataOutputXT(); >+ ~VideoDataOutputXT(); > xine_video_port_t *videoPort() const { return m_videoPort; } > void rewireTo(SourceNodeXT *); > >+ Phonon::Experimental::AbstractVideoDataOutput *m_frontend; > private: >+ struct Frame >+ { >+ int format; >+ int width; >+ int height; >+ double aspectRatio; >+ void *data0; >+ void *data1; >+ void *data2; >+ }; >+ static void raw_output_cb(void *user_data, int frame_format, int frame_width, >+ int frame_height, double frame_aspect, void *data0, void *data1, void *data2); >+ static void raw_overlay_cb(void *user_data, int num_ovl, raw_overlay_t *overlay_array); >+ >+#ifdef XINE_VISUAL_TYPE_RAW >+ raw_visual_t m_visual; >+#endif > xine_video_port_t *m_videoPort; > }; > >+void VideoDataOutputXT::raw_output_cb(void *user_data, int format, int width, >+ int height, double aspect, void *data0, void *data1, void *data2) >+{ >+ VideoDataOutputXT* vw = reinterpret_cast<VideoDataOutputXT *>(user_data); >+ const Experimental::VideoFrame f = { >+ width, >+ height, >+ aspect, >+ ((format == XINE_VORAW_YV12) ? Experimental::VideoFrame::Format_YV12 : >+ (format == XINE_VORAW_YUY2) ? Experimental::VideoFrame::Format_YUY2 : >+ (format == XINE_VORAW_RGB ) ? Experimental::VideoFrame::Format_RGB888 : >+ Experimental::VideoFrame::Format_Invalid), >+ QByteArray::fromRawData(reinterpret_cast<const char *>(data0), ((format == XINE_VORAW_RGB) ? 3 : (format == XINE_VORAW_YUY2) ? 2 : 1) * width * height), >+ QByteArray::fromRawData(reinterpret_cast<const char *>(data1), (format == XINE_VORAW_YV12) ? (width >> 1) + (height >> 1) : 0), >+ QByteArray::fromRawData(reinterpret_cast<const char *>(data2), (format == XINE_VORAW_YV12) ? (width >> 1) + (height >> 1) : 0) >+ }; >+ if (vw->m_frontend) { >+ //kDebug(610) << "send frame to frontend"; >+ vw->m_frontend->frameReady(f); >+ } >+} >+ >+void VideoDataOutputXT::raw_overlay_cb(void *user_data, int num_ovl, raw_overlay_t *overlay_array) >+{ >+ VideoDataOutputXT* vw = reinterpret_cast<VideoDataOutputXT *>(user_data); >+ Q_UNUSED(vw); >+ Q_UNUSED(num_ovl); >+ Q_UNUSED(overlay_array); >+} >+ >+VideoDataOutputXT::VideoDataOutputXT() >+ : m_frontend(0), >+ m_videoPort(0) >+{ >+#ifdef XINE_VISUAL_TYPE_RAW >+ m_visual.user_data = static_cast<void *>(this); >+ m_visual.raw_output_cb = &Phonon::Xine::VideoDataOutputXT::raw_output_cb; >+ m_visual.raw_overlay_cb = &Phonon::Xine::VideoDataOutputXT::raw_overlay_cb; >+ m_visual.supported_formats = /*XINE_VORAW_YV12 | XINE_VORAW_YUY2 |*/ XINE_VORAW_RGB; // TODO >+ m_videoPort = xine_open_video_driver(XineEngine::xine(), "auto", XINE_VISUAL_TYPE_RAW, static_cast<void *>(&m_visual)); >+#endif >+} >+ >+VideoDataOutputXT::~VideoDataOutputXT() >+{ >+ if (m_videoPort) { >+ xine_video_port_t *vp = m_videoPort; >+ m_videoPort = 0; >+ >+ xine_close_video_driver(XineEngine::xine(), vp); >+ } >+} >+ > VideoDataOutput::VideoDataOutput(QObject *parent) > : QObject(parent), > SinkNode(new VideoDataOutputXT) >@@ -48,45 +124,24 @@ > > void VideoDataOutputXT::rewireTo(SourceNodeXT *source) > { >+ if (!source->videoOutputPort()) { >+ return; >+ } > xine_post_wire_video_port(source->videoOutputPort(), videoPort()); > } > >-quint32 VideoDataOutput::format() const >-{ >- return m_fourcc; >-} >- >-int VideoDataOutput::frameRate() const >-{ >- return m_frameRate; >-} >- >-void VideoDataOutput::setFrameRate(int frameRate) >+Experimental::AbstractVideoDataOutput *VideoDataOutput::frontendObject() const > { >- m_frameRate = frameRate; >+ return K_XT(const VideoDataOutputXT)->m_frontend; > } > >-QSize VideoDataOutput::naturalFrameSize() const >+void VideoDataOutput::setFrontendObject(Experimental::AbstractVideoDataOutput *x) > { >- return QSize(320, 240); >-} >- >-QSize VideoDataOutput::frameSize() const >-{ >- return m_frameSize; >-} >- >-void VideoDataOutput::setFrameSize(const QSize &frameSize) >-{ >- m_frameSize = frameSize; >-} >- >-void VideoDataOutput::setFormat(quint32 fourcc) >-{ >- m_fourcc = fourcc; >+ K_XT(VideoDataOutputXT)->m_frontend = x; > } > > }} //namespace Phonon::Xine > >+#undef K_XT >+ > #include "videodataoutput.moc" >-// vim: sw=4 ts=4 >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.h b/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.h >--- a/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.h 2008-01-05 00:54:43.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/videodataoutput.h 2008-05-27 09:18:57.000000000 +0200 >@@ -1,5 +1,5 @@ > /* This file is part of the KDE project >- Copyright (C) 2006 Matthias Kretz <kretz@kde.org> >+ Copyright (C) 2006,2008 Matthias Kretz <kretz@kde.org> > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU Library General Public >@@ -17,57 +17,40 @@ > Boston, MA 02110-1301, USA. > > */ >-#ifndef Phonon_XINE_VIDEODATAOUTPUT_H >-#define Phonon_XINE_VIDEODATAOUTPUT_H >+#ifndef PHONON_XINE_VIDEODATAOUTPUT_H >+#define PHONON_XINE_VIDEODATAOUTPUT_H > >-#include <phonon/experimental/videoframe.h> >-#include <QVector> >-#include <QByteArray> >-#include <QObject> >-#include <QSize> >-#include <QList> > #include "sinknode.h" > >+#include <Phonon/Experimental/VideoDataOutputInterface> >+#include <Phonon/Experimental/VideoFrame> >+ >+#include <QtCore/QByteArray> >+#include <QtCore/QList> >+#include <QtCore/QObject> >+#include <QtCore/QSize> >+#include <QtCore/QVector> >+ > #include <xine.h> > > namespace Phonon > { > namespace Xine > { >-/** >- * \author Matthias Kretz <kretz@kde.org> >- */ >-class VideoDataOutput : public QObject, public Phonon::Xine::SinkNode >+ >+class VideoDataOutput : public QObject, public Phonon::Experimental::VideoDataOutputInterface, public Phonon::Xine::SinkNode > { > Q_OBJECT >- Q_INTERFACES(Phonon::Xine::SinkNode) >+ Q_INTERFACES(Phonon::Experimental::VideoDataOutputInterface Phonon::Xine::SinkNode) > public: > VideoDataOutput(QObject *parent); > ~VideoDataOutput(); > > MediaStreamTypes inputMediaStreamTypes() const { return Phonon::Xine::Video; } > >- public slots: >- int frameRate() const; >- void setFrameRate(int frameRate); >- >- QSize naturalFrameSize() const; >- QSize frameSize() const; >- void setFrameSize(const QSize &frameSize); >- >- quint32 format() const; >- void setFormat(quint32 fourcc); >- >- signals: >- void frameReady(const Phonon::Experimental::VideoFrame &frame); >- void endOfMedia(); >- >- private: >- quint32 m_fourcc; >- int m_frameRate; >- QSize m_frameSize; >+ Experimental::AbstractVideoDataOutput *frontendObject() const; >+ void setFrontendObject(Experimental::AbstractVideoDataOutput *); > }; > }} //namespace Phonon::Xine > >-// vim: sw=4 ts=4 tw=80 >-#endif // Phonon_XINE_VIDEODATAOUTPUT_H >+#endif // PHONON_XINE_VIDEODATAOUTPUT_H >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/volumefader_plugin.cpp b/kdebase-runtime-4.0.4/phonon/xine/volumefader_plugin.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/volumefader_plugin.cpp 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/volumefader_plugin.cpp 2008-06-06 21:18:48.000000000 +0200 >@@ -426,19 +426,30 @@ > return &that->post; > } > >+#if XINE_MAJOR_VERSION < 1 || ( XINE_MAJOR_VERSION == 1 && ( XINE_MINOR_VERSION < 1 || ( XINE_MINOR_VERSION == 1 && XINE_SUB_VERSION < 90 ) ) ) >+#define NEED_DESCRIPTION_FUNCTION 1 >+#else >+#define NEED_DESCRIPTION_FUNCTION 0 >+#endif >+ >+#define PLUGIN_DESCRIPTION I18N_NOOP("Fade in or fade out with different fade curves") >+#define PLUGIN_IDENTIFIER "KVolumeFader" >+ >+#if NEED_DESCRIPTION_FUNCTION > static char *kvolumefader_get_identifier(post_class_t *class_gen) > { > Q_UNUSED(class_gen); >- return "KVolumeFader"; >+ return PLUGIN_IDENTIFIER; > } > > static char *kvolumefader_get_description(post_class_t *class_gen) > { > Q_UNUSED(class_gen); > static QByteArray description( >- i18n("Fade in or fade out with different fade curves").toUtf8()); >+ i18n(PLUGIN_DESCRIPTION).toUtf8()); > return description.data(); > } >+#endif > > static void kvolumefader_class_dispose(post_class_t *class_gen) > { >@@ -455,8 +466,14 @@ > } > > _class->post_class.open_plugin = kvolumefader_open_plugin; >+#if NEED_DESCRIPTION_FUNCTION > _class->post_class.get_identifier = kvolumefader_get_identifier; > _class->post_class.get_description = kvolumefader_get_description; >+#else >+ _class->post_class.description = PLUGIN_DESCRIPTION; >+ _class->post_class.text_domain = "phonon-xine"; >+ _class->post_class.identifier = PLUGIN_IDENTIFIER; >+#endif > _class->post_class.dispose = kvolumefader_class_dispose; > > _class->xine = xine; >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/xine.desktop b/kdebase-runtime-4.0.4/phonon/xine/xine.desktop >--- a/kdebase-runtime-4.0.4/phonon/xine/xine.desktop 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/xine.desktop 2008-07-18 21:15:33.000000000 +0200 >@@ -4,20 +4,24 @@ > MimeType=application/x-annodex;video/quicktime;video/x-quicktime;audio/x-m4a;application/x-quicktimeplayer;video/mkv;video/msvideo;video/x-msvideo;video/x-flic;audio/x-aiff;audio/aiff;audio/x-pn-aiff;audio/x-realaudio;audio/basic;audio/x-basic;audio/x-pn-au;audio/x-8svx;audio/8svx;audio/x-16sv;audio/168sv;image/x-ilbm;image/ilbm;video/x-anim;video/anim;image/png;image/x-png;video/mng;video/x-mng;audio/x-ogg;audio/x-speex+ogg;application/ogg;application/ogg;audio/vnd.rn-realaudio;audio/x-pn-realaudio-plugin;audio/x-real-audio;application/vnd.rn-realmedia;video/mpeg;video/x-mpeg;audio/x-wav;audio/wav;audio/x-pn-wav;audio/x-pn-windows-acm;audio/mpeg2;audio/x-mpeg2;audio/mpeg3;audio/x-mpeg3;audio/mpeg;audio/x-mpeg;x-mpegurl;audio/x-mpegurl;audio/mp3;audio/mpeg;video/x-ms-asf;application/x-flash-video; > X-KDE-Library=phonon_xine > X-KDE-PhononBackendInfo-InterfaceVersion=1 >-X-KDE-PhononBackendInfo-Version=0.1 >+X-KDE-PhononBackendInfo-Version=0.2 > X-KDE-PhononBackendInfo-Website=http://www.xinehq.de/ > Icon=phonon-xine > InitialPreference=15 > > Name=Xine > Name[hi]=à¤à¤à¥à¤¸à¤¾à¤à¤¨ >+Name[ml]=à´¸àµà´¨àµâ >+Name[mr]=à¤à¤à¥à¤¸à¤¾à¤à¤¨ > Name[ne]=à¤à¤¾à¤à¤¨ > Name[sr]=ÐÑине >+Name[ta]=à®à¯à®©à¯ > Name[te]=à°à±à°¸à±à°¨à± > Name[x-test]=xxXinexx > > Comment=Phonon Xine backend > Comment[bg]=Ðаден Ñлой Phonon Xine >+Comment[bn_IN]=Phonon Xine বà§à¦¯à¦¾à¦-à¦à¦¨à§à¦¡ > Comment[ca]=Dorsal Xine del Phonon > Comment[csb]=Czérownik Phonon Xine > Comment[da]=Xine-motor til Phonon >@@ -28,9 +32,10 @@ > Comment[et]=Phononi Xine taustaprogramm > Comment[eu]=Phonon Xine interfazea > Comment[fi]=Phonon Xine-taustaosa >-Comment[fr]=Interface Xine pour Phonon >+Comment[fr]=Moteur de traitement Xine pour Phonon > Comment[ga]=Inneall Phonon Xine > Comment[gl]=Infraestrutura Xine para Phonon >+Comment[gu]=ફà«àª¨à«àª¨ àªàª¾àªàª¨ બà«àªàªàª¨à«àª¡ > Comment[he]=××שק Phonon Xine > Comment[hu]=Phonon Xine multimédia rendszer > Comment[is]=Phonon Xine bakendi >@@ -40,6 +45,8 @@ > Comment[km]=Phonon Xine áááááá·áá¸âáá¶áâáááááâ > Comment[ko]=Phonon Xine ë°±ìë > Comment[lv]=Phonon Xine aizmugure >+Comment[ml]=à´«àµà´¨àµà´£àµâ à´¸àµà´¨àµâ ബാà´àµà´àµà´¨àµâഡൠ>+Comment[mr]=फà¥à¤¨à¥à¤¨ Xine बॠà¤à¤à¤¨à¥à¤¡ > Comment[nb]=Phonon Xine-motor > Comment[nds]=Hülpprogramm Xine för Phonon > Comment[ne]=फà¥à¤¨à¥à¤¨ à¤à¤¾à¤à¤¨ बà¥à¤¯à¤¾à¤à¤à¤¨à¥à¤¡ >@@ -56,9 +63,12 @@ > Comment[sr]=ÐÑине као позадина Фонона > Comment[sr@latin]=Xine kao pozadina Phonona > Comment[sv]=Phonon Xine-gränssnitt >+Comment[tg]=ÐÑÑÑибонии Phonon Xine > Comment[th]=à¹à¸à¸£à¹à¸à¸£à¸¡à¹à¸à¸·à¹à¸à¸à¸«à¸¥à¸±à¸ Phonon Xine > Comment[tr]=Phonon Xine arka ucu > Comment[uk]=ÐÑогÑама Phonon Xine >+Comment[uz]=Xine tovush xizmati >+Comment[uz@cyrillic]=Xine ÑовÑÑ Ñ Ð¸Ð·Ð¼Ð°Ñи > Comment[wa]=Bouye di fond di Phonon Xine > Comment[x-test]=xxPhonon Xine backendxx > Comment[zh_CN]=Phonon Xine å端 >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/xinestream.cpp b/kdebase-runtime-4.0.4/phonon/xine/xinestream.cpp >--- a/kdebase-runtime-4.0.4/phonon/xine/xinestream.cpp 2008-04-30 18:59:55.000000000 +0200 >+++ b/kdebase-runtime-4.0.4/phonon/xine/xinestream.cpp 2008-07-24 16:09:38.000000000 +0200 >@@ -1,5 +1,6 @@ > /* This file is part of the KDE project > Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org> >+ Copyright (C) 2008 Ian Monroe <imonroe@kde.org> > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU Library General Public >@@ -19,19 +20,23 @@ > */ > > #include "xinestream.h" >-#include "xineengine.h" >+ > #include <QMutexLocker> > #include <QEvent> > #include <QCoreApplication> > #include <QTimer> >+ > #include <kurl.h> >+#include <klocale.h> >+ > #include "audioport.h" >-#include "videowidget.h" >+#include "backend.h" >+#include "bytestream.h" >+#include "events.h" > #include "mediaobject.h" >+#include "videowidget.h" >+#include "xineengine.h" > #include "xinethread.h" >-#include <klocale.h> >-#include "events.h" >-#include "bytestream.h" > > extern "C" { > #define this _this_xine_ >@@ -65,6 +70,8 @@ > // m_startTime(-1), > m_totalTime(-1), > m_currentTime(-1), >+ m_availableSubtitles(-1), >+ m_availableAudioChannels(-1), > m_availableTitles(-1), > m_availableChapters(-1), > m_availableAngles(-1), >@@ -130,13 +137,13 @@ > // hmm? > abort(); > case XINE_ERROR_NO_INPUT_PLUGIN: >- error(Phonon::NormalError, i18n("cannot find input plugin for MRL [%1]", m_mrl.constData())); >+ error(Phonon::NormalError, i18n("Cannot find input plugin for MRL [%1]", m_mrl.constData())); > break; > case XINE_ERROR_NO_DEMUX_PLUGIN: > if (m_mrl.startsWith("kbytestream:/")) { >- error(Phonon::FatalError, i18n("cannot find demultiplexer plugin for the given media data")); >+ error(Phonon::FatalError, i18n("Cannot find demultiplexer plugin for the given media data")); > } else { >- error(Phonon::FatalError, i18n("cannot find demultiplexer plugin for MRL [%1]", m_mrl.constData())); >+ error(Phonon::FatalError, i18n("Cannot find demultiplexer plugin for MRL [%1]", m_mrl.constData())); > } > break; > default: >@@ -547,6 +554,8 @@ > QString::fromUtf8(xine_get_meta_info(m_stream, XINE_META_INFO_TRACK_NUMBER))); > metaDataMap.insert(QLatin1String("DESCRIPTION"), > QString::fromUtf8(xine_get_meta_info(m_stream, XINE_META_INFO_COMMENT))); >+ metaDataMap.insert(QLatin1String("MUSICBRAINZ_DISCID"), >+ QString::fromUtf8(xine_get_meta_info(m_stream, XINE_META_INFO_CDINDEX_DISCID))); > if(metaDataMap == m_metaDataMap) > return; > m_metaDataMap = metaDataMap; >@@ -708,6 +717,25 @@ > emit availableAnglesChanged(m_availableAngles); > } > >+ { >+ int availableSubtitles = subtitlesSize(); >+ if(availableSubtitles != m_availableSubtitles) >+ { >+ kDebug(610) << "available subtitles changed: " << availableSubtitles; >+ m_availableSubtitles = availableSubtitles; >+ emit availableSubtitlesChanged(); >+ } >+ } >+ { >+ int availableAudioChannels = audioChannelsSize(); >+ if(availableAudioChannels != m_availableAudioChannels) >+ { >+ kDebug(610) << "available audio channels changed: " << availableAudioChannels; >+ m_availableAudioChannels = availableAudioChannels; >+ emit availableAudioChannelsChanged(); >+ } >+ } >+ > int currentTitle = xine_get_stream_info(m_stream, XINE_STREAM_INFO_DVD_TITLE_NUMBER); > int currentChapter = xine_get_stream_info(m_stream, XINE_STREAM_INFO_DVD_CHAPTER_NUMBER); > int currentAngle = xine_get_stream_info(m_stream, XINE_STREAM_INFO_DVD_ANGLE_NUMBER); >@@ -1250,6 +1278,92 @@ > return m_errorType; > } > >+#if KDE_IS_VERSION(4,1,0) >+QList<SubtitleDescription> XineStream::availableSubtitles() const >+{ >+ uint hash = streamHash(); >+ QList<SubtitleDescription> subtitles; >+ if( !m_stream ) >+ return subtitles; >+ const int channels = subtitlesSize(); >+ for( int index = 0; index < channels; index++ ) >+ { >+ subtitles << streamDescription<SubtitleDescription>( index, hash, SubtitleType, xine_get_spu_lang ); >+ } >+ return subtitles; >+} >+ >+ >+QList<AudioChannelDescription> XineStream::availableAudioChannels() const >+{ >+ const uint hash = streamHash(); >+ QList<AudioChannelDescription> audios; >+ if( !m_stream ) >+ return audios; >+ const int channels = audioChannelsSize(); >+ for( int index = 0; index < channels; index++ ) >+ { >+ audios << streamDescription<AudioChannelDescription>( index, hash, AudioChannelType, xine_get_audio_lang ); >+ } >+ return audios; >+} >+#endif >+ >+int XineStream::subtitlesSize() const >+{ >+ return xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL ); >+} >+ >+int XineStream::audioChannelsSize() const >+{ >+ return xine_get_stream_info( m_stream, XINE_STREAM_INFO_MAX_AUDIO_CHANNEL ); >+} >+ >+#if KDE_IS_VERSION(4,1,0) >+void XineStream::setCurrentAudioChannel(const AudioChannelDescription& streamDesc) >+{ >+ xine_set_param( m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL, streamDesc.index() - streamHash() ); >+} >+ >+void XineStream::setCurrentSubtitle(const SubtitleDescription& streamDesc) >+{ >+ kDebug() << "setting the subtitle to: " << streamDesc.index(); >+ xine_set_param( m_stream, XINE_PARAM_SPU_CHANNEL, streamDesc.index() - streamHash() ); >+} >+#endif >+ >+uint XineStream::streamHash() const >+{ >+ return qHash( m_mrl ); >+} >+ >+template<class S> >+S XineStream::streamDescription(int index, uint hash, ObjectDescriptionType type, int(*get_xine_stream_text)(xine_stream_t *stream, int channel, char *lang)) const >+{ >+ QByteArray lang; >+ lang.resize( 150 ); >+ get_xine_stream_text( m_stream, index, lang.data() ); >+ QHash<QByteArray, QVariant> properities; >+ properities.insert( "name", QString( lang ) ); >+ //XineEngine::setObjectDescriptionProperities( type, index + hash, properities ); >+ return S( index + hash, properities ); >+} >+ >+#if KDE_IS_VERSION(4,1,0) >+AudioChannelDescription XineStream::currentAudioChannel() const >+{ >+ const int index = xine_get_param( m_stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL ); >+ return streamDescription<AudioChannelDescription>( index, streamHash(), AudioChannelType, xine_get_audio_lang ); >+} >+ >+SubtitleDescription XineStream::currentSubtitle() const >+{ >+ int index = xine_get_param( m_stream, XINE_PARAM_SPU_CHANNEL ); >+ return streamDescription<SubtitleDescription>( index, streamHash(), SubtitleType, xine_get_spu_lang ); >+} >+#endif >+ >+ > xine_post_out_t *XineStream::audioOutputPort() const > { > if (!m_stream) { >diff -ur a/kdebase-runtime-4.0.4/phonon/xine/xinestream.h b/kdebase-runtime-4.0.4/phonon/xine/xinestream.h >--- a/kdebase-runtime-4.0.4/phonon/xine/xinestream.h 2008-03-27 21:34:21.000000000 +0100 >+++ b/kdebase-runtime-4.0.4/phonon/xine/xinestream.h 2008-07-24 16:09:38.000000000 +0200 >@@ -31,8 +31,10 @@ > #include <QtCore/QTimer> > > #include <Phonon/Global> >+#include <Phonon/ObjectDescription> > > #include <xine.h> >+#include <kdeversion.h> > > #include <sys/time.h> > #include <time.h> >@@ -105,6 +107,20 @@ > int currentAngle() const { return m_currentAngle; } > int currentTitle() const { return m_currentTitle; } > >+#if KDE_IS_VERSION(4,1,0) >+ QList<AudioChannelDescription> availableAudioChannels() const; >+ QList<SubtitleDescription> availableSubtitles() const; >+ >+ AudioChannelDescription currentAudioChannel() const; >+ SubtitleDescription currentSubtitle() const; >+ >+ void setCurrentAudioChannel(const AudioChannelDescription& streamDesc); >+ void setCurrentSubtitle(const SubtitleDescription& streamDesc); >+#endif >+ >+ int subtitlesSize() const; >+ int audioChannelsSize() const; >+ > enum StateForNewMrl { > // no use: Loading, Error, Buffering > StoppedState = Phonon::StoppedState, >@@ -143,6 +159,8 @@ > void hasVideoChanged(bool); > void bufferStatus(int); > >+ void availableSubtitlesChanged(); >+ void availableAudioChannelsChanged(); > void availableChaptersChanged(int); > void chapterChanged(int); > void availableAnglesChanged(int); >@@ -177,6 +195,9 @@ > void internalPause(); > void internalPlay(); > void setMrlInternal(const QByteArray &newMrl); >+ template<class S> >+ S streamDescription(int index, uint hash, ObjectDescriptionType type, int(*get_xine_stream_text)(xine_stream_t *stream, int channel, char *lang)) const; >+ uint streamHash() const; > > xine_stream_t *m_stream; > xine_event_queue_t *m_event_queue; >@@ -209,6 +230,8 @@ > int m_totalTime; > int m_currentTime; > int m_waitForPlayingTimerId; >+ int m_availableSubtitles; >+ int m_availableAudioChannels; > int m_availableTitles; > int m_availableChapters; > int m_availableAngles;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 387406
:
212858
| 229765