summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativepositioners
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qdeclarativepositioners')
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
index dbe2cbee..2c5b473 100644
--- a/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
+++ b/tests/auto/declarative/qdeclarativepositioners/qdeclarativepositioners.pro
@@ -4,7 +4,14 @@ SOURCES += tst_qdeclarativepositioners.cpp
macx:CONFIG -= app_bundle
# Define SRCDIR equal to test's source directory
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+symbian: {
+ DEFINES += SRCDIR=\".\"
+ importFiles.sources = data
+ importFiles.path =
+ DEPLOYMENT = importFiles
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
CONFIG += parallel_test
68
-rw-r--r--src/3rdparty/phonon/ds9/backend.cpp343
-rw-r--r--src/3rdparty/phonon/ds9/backend.h83
-rw-r--r--src/3rdparty/phonon/ds9/backendnode.cpp115
-rw-r--r--src/3rdparty/phonon/ds9/backendnode.h73
-rw-r--r--src/3rdparty/phonon/ds9/compointer.h114
-rw-r--r--src/3rdparty/phonon/ds9/ds9.desktop51
-rw-r--r--src/3rdparty/phonon/ds9/effect.cpp153
-rw-r--r--src/3rdparty/phonon/ds9/effect.h59
-rw-r--r--src/3rdparty/phonon/ds9/fakesource.cpp166
-rw-r--r--src/3rdparty/phonon/ds9/fakesource.h54
-rw-r--r--src/3rdparty/phonon/ds9/iodevicereader.cpp228
-rw-r--r--src/3rdparty/phonon/ds9/iodevicereader.h57
-rw-r--r--src/3rdparty/phonon/ds9/lgpl-2.1.txt504
-rw-r--r--src/3rdparty/phonon/ds9/lgpl-3.txt165
-rw-r--r--src/3rdparty/phonon/ds9/mediagraph.cpp1099
-rw-r--r--src/3rdparty/phonon/ds9/mediagraph.h148
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.cpp1208
-rw-r--r--src/3rdparty/phonon/ds9/mediaobject.h313
-rw-r--r--src/3rdparty/phonon/ds9/phononds9_namespace.h33
-rw-r--r--src/3rdparty/phonon/ds9/qasyncreader.cpp198
-rw-r--r--src/3rdparty/phonon/ds9/qasyncreader.h77
-rw-r--r--src/3rdparty/phonon/ds9/qaudiocdreader.cpp332
-rw-r--r--src/3rdparty/phonon/ds9/qaudiocdreader.h58
-rw-r--r--src/3rdparty/phonon/ds9/qbasefilter.cpp831
-rw-r--r--src/3rdparty/phonon/ds9/qbasefilter.h136
-rw-r--r--src/3rdparty/phonon/ds9/qmeminputpin.cpp357
-rw-r--r--src/3rdparty/phonon/ds9/qmeminputpin.h82
-rw-r--r--src/3rdparty/phonon/ds9/qpin.cpp653
-rw-r--r--src/3rdparty/phonon/ds9/qpin.h121
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_soft.cpp1011
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_soft.h68
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp333
-rw-r--r--src/3rdparty/phonon/ds9/videorenderer_vmr9.h56
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.cpp397
-rw-r--r--src/3rdparty/phonon/ds9/videowidget.h96
-rw-r--r--src/3rdparty/phonon/ds9/volumeeffect.cpp296
-rw-r--r--src/3rdparty/phonon/ds9/volumeeffect.h71
43 files changed, 10606 insertions, 0 deletions
diff --git a/src/3rdparty/phonon/ds9/CMakeLists.txt b/src/3rdparty/phonon/ds9/CMakeLists.txt
new file mode 100644
index 0000000..1bb6f6f
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/CMakeLists.txt
@@ -0,0 +1,53 @@
+# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#
+# This library is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 2 or 3 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+project(phonon-ds9)
+include(ConfigureChecks.cmake)
+
+if (BUILD_PHONON_DS9)
+ find_package(OPENGL REQUIRED)
+
+ include_directories($ENV{DXDSDK_DIR}/include $ENV{DXSDK_DIR})
+ set(phonon_ds9_SRCS
+ abstractvideorenderer.cpp
+ audiooutput.cpp
+ backend.cpp
+ backendnode.cpp
+ effect.cpp
+ fakesource.cpp
+ iodevicereader.cpp
+ mediagraph.cpp
+ mediaobject.cpp
+ videowidget.cpp
+ videorenderer_vmr9.cpp
+ videorenderer_soft.cpp
+ volumeeffect.cpp
+ qbasefilter.cpp
+ qpin.cpp
+ qasyncreader.cpp
+ qaudiocdreader.cpp
+ qmeminputpin.cpp
+ )
+
+ add_definitions(-DPHONON_MAKE_QT_ONLY_BACKEND -DUNICODE)
+ automoc4_add_library(phonon_ds9 SHARED ${phonon_ds9_SRCS})
+ set_target_properties(phonon_ds9 PROPERTIES PREFIX "")
+ target_link_libraries(phonon_ds9
+ ${PHONON_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY}
+ dxguid strmiids dmoguids msdmo ole32 oleaut32 uuid gdi32)
+ install(TARGETS phonon_ds9
+ RUNTIME DESTINATION ${BIN_INSTALL_DIR}/phonon_backend
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
+ install(FILES ds9.desktop DESTINATION ${SERVICES_INSTALL_DIR}/phononbackends)
+endif (BUILD_PHONON_DS9)
diff --git a/src/3rdparty/phonon/ds9/ConfigureChecks.cmake b/src/3rdparty/phonon/ds9/ConfigureChecks.cmake
new file mode 100644
index 0000000..c13056f
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/ConfigureChecks.cmake
@@ -0,0 +1,44 @@
+# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#
+# This library is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 2 or 3 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library. If not, see <http://www.gnu.org/licenses/>.
+
+# We must find:
+# $DXSDK_DIR/include/d3d9.h
+# $DXDSK_DIR/$LIB/dxguid.lib
+# vmr9.h
+# dshow.h
+# strmiids.lib
+# dmoguids.lib
+# msdmo.lib
+include(CheckCXXSourceCompiles)
+
+macro_push_required_vars()
+
+set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CMAKE_INCLUDE_PATH} $ENV{DXSDK_DIR} $ENV{DXSDK_DIR}/include)
+set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} dxguid strmiids dmoguids msdmo)
+
+CHECK_CXX_SOURCE_COMPILES(
+"#include <d3d9.h>
+#include <dshow.h>
+#include <strmif.h>
+#include <vmr9.h>
+
+int main() { }" BUILD_PHONON_DS9)
+
+macro_pop_required_vars()
+
+if (BUILD_PHONON_DS9)
+ message(STATUS "Found DirectShow 9 support: $ENV{DXSDK_DIR}")
+else (BUILD_PHONON_DS9)
+ message(STATUS "DirectShow 9 support NOT found")
+endif (BUILD_PHONON_DS9)
diff --git a/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp b/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp
new file mode 100644
index 0000000..e932e70
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/abstractvideorenderer.cpp
@@ -0,0 +1,118 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "abstractvideorenderer.h"
+
+#include <QtGui/QApplication>
+#include <QtGui/QDesktopWidget>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_PHONON_VIDEO
+
+namespace Phonon
+{
+ namespace DS9
+ {
+
+ AbstractVideoRenderer::AbstractVideoRenderer() :
+ m_dstX(0), m_dstY(0), m_dstWidth(0), m_dstHeight(0),
+ m_active(false)
+ {
+ }
+
+ AbstractVideoRenderer::~AbstractVideoRenderer()
+ {
+ }
+
+ Filter AbstractVideoRenderer::getFilter() const
+ {
+ return m_filter;
+ }
+
+ QSize AbstractVideoRenderer::sizeHint() const
+ {
+ QSize s = videoSize();
+ if (s.isNull()) {
+ s = QSize(640, 480).boundedTo( QApplication::desktop()->availableGeometry().size() );
+ }
+ return s;
+ }
+
+ void AbstractVideoRenderer::setActive(bool b)
+ {
+ m_active = b;
+ }
+
+ bool AbstractVideoRenderer::isActive() const
+ {
+ return m_active;
+ }
+
+ void AbstractVideoRenderer::internalNotifyResize(const QSize &size, const QSize &videoSize,
+ Phonon::VideoWidget::AspectRatio aspectRatio, Phonon::VideoWidget::ScaleMode scaleMode)
+ {
+ //update the video rects
+ qreal ratio = -1.;
+ const int videoWidth = videoSize.width(),
+ videoHeight = videoSize.height();
+
+ switch(aspectRatio)
+ {
+ case Phonon::VideoWidget::AspectRatioAuto:
+ {
+ //preserve the aspect ratio of the video
+ ratio = qreal(videoWidth) / qreal(videoHeight);
+ }
+ break;
+ case Phonon::VideoWidget::AspectRatio4_3:
+ ratio = qreal(4. / 3.);
+ break;
+ case Phonon::VideoWidget::AspectRatio16_9:
+ ratio = qreal(16. / 9.);
+ break;
+ case Phonon::VideoWidget::AspectRatioWidget:
+ default:
+ break;
+ }
+
+ const qreal realWidth = size.width(),
+ realHeight = size.height();
+
+ //reinitialization
+ m_dstWidth = size.width();
+ m_dstHeight = size.height();
+ m_dstX = m_dstY = 0;
+
+ if (ratio > 0) {
+ if (realWidth / realHeight > ratio && scaleMode == Phonon::VideoWidget::FitInView
+ || realWidth / realHeight < ratio && scaleMode == Phonon::VideoWidget::ScaleAndCrop) {
+ //the height is correct, let's change the width
+ m_dstWidth = qRound(realHeight * ratio);
+ m_dstX = qRound((realWidth - realHeight * ratio) / 2.);
+ } else {
+ m_dstHeight = qRound(realWidth / ratio);
+ m_dstY = qRound((realHeight - realWidth / ratio) / 2.);
+ }
+ }
+ }
+ }
+}
+
+#endif //QT_NO_PHONON_EFFECT
+
+QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/ds9/abstractvideorenderer.h b/src/3rdparty/phonon/ds9/abstractvideorenderer.h
new file mode 100644
index 0000000..25c660f
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/abstractvideorenderer.h
@@ -0,0 +1,73 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef PHONON_ABSTRACTVIDEORENDERER_H
+#define PHONON_ABSTRACTVIDEORENDERER_H
+
+#include "backendnode.h"
+
+#include <phonon/videowidget.h>
+
+QT_BEGIN_NAMESPACE
+
+class QImage;
+
+#ifndef QT_NO_PHONON_VIDEO
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ //this is the interface used by the videorenderer from the VideoWidget class
+ class AbstractVideoRenderer
+ {
+ public:
+ virtual ~AbstractVideoRenderer();
+
+ virtual void repaintCurrentFrame(QWidget *target, const QRect &rect) = 0;
+ virtual void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode) = 0;
+ virtual void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation) = 0;
+
+ void setActive(bool);
+ bool isActive() const;
+
+ virtual bool isNative() const = 0;
+ virtual QImage snapshot() const = 0;
+
+ Filter getFilter() const;
+ QSize sizeHint() const;
+
+ protected:
+ virtual QSize videoSize() const = 0;
+
+ AbstractVideoRenderer();
+ void internalNotifyResize(const QSize &size, const QSize &videoSize,
+ Phonon::VideoWidget::AspectRatio aspectRatio, Phonon::VideoWidget::ScaleMode scaleMode);
+
+
+ Filter m_filter;
+ int m_dstX, m_dstY, m_dstWidth, m_dstHeight;
+ bool m_active;
+ };
+ }
+}
+
+#endif //QT_NO_PHONON_VIDEO
+
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/3rdparty/phonon/ds9/audiooutput.cpp b/src/3rdparty/phonon/ds9/audiooutput.cpp
new file mode 100644
index 0000000..fcc062c
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/audiooutput.cpp
@@ -0,0 +1,111 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "audiooutput.h"
+#include "mediaobject.h"
+
+#include <QtCore/qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ AudioOutput::AudioOutput(Backend *back, QObject *parent)
+ : BackendNode(parent), m_currentIndex(0), m_crossfadeProgress(1.),
+ m_device(-1), m_backend(back), m_volume(0.)
+ {
+ }
+
+ AudioOutput::~AudioOutput()
+ {
+ }
+
+ int AudioOutput::outputDevice() const
+ {
+ return m_device;
+ }
+
+ static const qreal log10over20 = qreal(0.1151292546497022842); // ln(10) / 20
+
+ void AudioOutput::setVolume(qreal newVolume)
+ {
+ for(int i = 0; i < FILTER_COUNT; ++i) {
+ ComPointer<IBasicAudio> audio(m_filters[i], IID_IBasicAudio);
+ if (audio) {
+ const qreal currentVolume = newVolume * (m_currentIndex == i ? m_crossfadeProgress : 1-m_crossfadeProgress);
+ const qreal newDbVolume = (qMax(0., 1.-::log(::pow(currentVolume, -log10over20)))-1.) * 10000;
+ audio->put_Volume(qRound(newDbVolume));
+ }
+ }
+
+ if (m_volume != newVolume) {
+ m_volume = newVolume;
+ emit volumeChanged(newVolume);
+ }
+ }
+
+ void AudioOutput::setCrossFadingProgress(short currentIndex, qreal progress)
+ {
+ m_crossfadeProgress = progress;
+ m_currentIndex = currentIndex;
+ setVolume(m_volume);
+ }
+
+ bool AudioOutput::setOutputDevice(const AudioOutputDevice & newDevice)
+ {
+ //stub implementation
+ return setOutputDevice(newDevice.index());
+ }
+
+ qreal AudioOutput::volume() const
+ {
+ return m_volume;
+ }
+
+ bool AudioOutput::setOutputDevice(int newDevice)
+ {
+ if (newDevice == m_device) {
+ return true;
+ }
+
+ //free the previous one if it was already set
+ for(int i = 0; i < FILTER_COUNT; ++i) {
+ const Filter &oldFilter = m_filters[i];
+
+ Filter newFilter = m_backend->getAudioOutputFilter(newDevice);
+
+ if (m_mediaObject && oldFilter && newFilter) {
+ m_mediaObject->switchFilters(i, oldFilter, newFilter);
+ }
+
+ m_filters[i] = newFilter;
+
+
+ }
+
+ m_device = newDevice;
+ setVolume(m_volume);
+ return true;
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "moc_audiooutput.cpp"
diff --git a/src/3rdparty/phonon/ds9/audiooutput.h b/src/3rdparty/phonon/ds9/audiooutput.h
new file mode 100644
index 0000000..c3bfc8b
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/audiooutput.h
@@ -0,0 +1,68 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_AUDIOOUTPUT_H
+#define PHONON_AUDIOOUTPUT_H
+
+#include "backendnode.h"
+#include <phonon/audiooutputinterface.h>
+
+#include "backend.h"
+
+struct IBaseFilter;
+struct IBasicAudio;
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ class AudioOutput : public BackendNode, public Phonon::AudioOutputInterface
+ {
+ Q_OBJECT
+ Q_INTERFACES(Phonon::AudioOutputInterface)
+ public:
+ AudioOutput(Backend *back, QObject *parent);
+ ~AudioOutput();
+
+ // Attributes Getters:
+ qreal volume() const;
+ int outputDevice() const;
+ void setVolume(qreal newVolume);
+ bool setOutputDevice(int newDevice);
+ bool setOutputDevice(const AudioOutputDevice & newDevice);
+ void setCrossFadingProgress(short currentIndex, qreal progress);
+
+ Q_SIGNALS:
+ void volumeChanged(qreal newVolume);
+ void audioDeviceFailed();
+
+ private:
+ short m_currentIndex;
+ qreal m_crossfadeProgress;
+
+ int m_device;
+ Backend *m_backend;
+ qreal m_volume;
+ };
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // PHONON_AUDIOOUTPUT_H
diff --git a/src/3rdparty/phonon/ds9/backend.cpp b/src/3rdparty/phonon/ds9/backend.cpp
new file mode 100644
index 0000000..245749a
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/backend.cpp
@@ -0,0 +1,343 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "backend.h"
+#include "backendnode.h"
+
+#include "audiooutput.h"
+#include "effect.h"
+#include "mediaobject.h"
+#include "videowidget.h"
+#include "volumeeffect.h"
+
+//windows specific (DirectX Media Object)
+#include <dmo.h>
+
+#include <QtCore/QSettings>
+#include <QtCore/QSet>
+#include <QtCore/QVariant>
+
+#include <QtCore/QtPlugin>
+
+QT_BEGIN_NAMESPACE
+
+Q_EXPORT_PLUGIN2(phonon_ds9, Phonon::DS9::Backend);
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ bool Backend::AudioMoniker::operator==(const AudioMoniker &other)
+ {
+ return other->IsEqual(*this) == S_OK;
+ }
+
+
+ Backend::Backend(QObject *parent, const QVariantList &)
+ : QObject(parent)
+ {
+ ::CoInitialize(0);
+
+ //registering meta types
+ qRegisterMetaType<HRESULT>("HRESULT");
+ qRegisterMetaType<Graph>("Graph");
+ }
+
+ Backend::~Backend()
+ {
+ m_audioOutputs.clear();
+ m_audioEffects.clear();
+ ::CoUninitialize();
+ }
+
+ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args)
+ {
+ switch (c)
+ {
+ case MediaObjectClass:
+ return new MediaObject(parent);
+ case AudioOutputClass:
+ return new AudioOutput(this, parent);
+#ifndef QT_NO_PHONON_EFFECT
+ case EffectClass:
+ return new Effect(m_audioEffects[ args[0].toInt() ], parent);
+#endif //QT_NO_PHONON_EFFECT
+#ifndef QT_NO_PHONON_VIDEO
+ case VideoWidgetClass:
+ return new VideoWidget(qobject_cast<QWidget *>(parent));
+#endif //QT_NO_PHONON_VIDEO
+#ifndef QT_NO_PHONON_VOLUMEFADEREFFECT
+ case VolumeFaderEffectClass:
+ return new VolumeEffect(parent);
+#endif //QT_NO_PHONON_VOLUMEFADEREFFECT
+ default:
+ return 0;
+ }
+ }
+
+ bool Backend::supportsVideo() const
+ {
+#ifndef QT_NO_PHONON_VIDEO
+ return true;
+#else
+ return false;
+#endif //QT_NO_PHONON_VIDEO
+ }
+
+ QStringList Backend::availableMimeTypes() const
+ {
+ QStringList ret;
+ {
+ QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Multimedia\\mplayer2\\mime types"), QSettings::NativeFormat);
+ ret += settings.childGroups();
+ }
+ {
+ QSettings settings(QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Multimedia\\wmplayer\\mime types"), QSettings::NativeFormat);
+ ret += settings.childGroups();
+ }
+
+ ret.removeDuplicates();
+ ret.replaceInStrings("\\", "/");
+ qSort(ret);
+ return ret;
+ }
+
+ Filter Backend::getAudioOutputFilter(int index) const
+ {
+ Filter ret;
+ if (index >= 0 && index < m_audioOutputs.count()) {
+ m_audioOutputs.at(index)->BindToObject(0, 0, IID_IBaseFilter, reinterpret_cast<void**>(&ret));
+ } else {
+ //just return the default audio renderer (not directsound)
+ ret = Filter(CLSID_AudioRender, IID_IBaseFilter);
+ }
+ return ret;
+ }
+
+
+ QList<int> Backend::objectDescriptionIndexes(Phonon::ObjectDescriptionType type) const
+ {
+ QList<int> ret;
+
+ switch(type)
+ {
+ case Phonon::AudioOutputDeviceType:
+ {
+#ifdef Q_OS_WINCE
+ ret << 0; // only one audio device with index 0
+#else
+ ComPointer<ICreateDevEnum> devEnum(CLSID_SystemDeviceEnum, IID_ICreateDevEnum);
+ if (!devEnum) {
+ return ret; //it is impossible to enumerate the devices
+ }
+ ComPointer<IEnumMoniker> enumMon;
+ HRESULT hr = devEnum->CreateClassEnumerator(CLSID_AudioRendererCategory, enumMon.pparam(), 0);
+ if (FAILED(hr)) {
+ break;
+ }
+ AudioMoniker mon;
+
+ //let's reorder the devices so that directshound appears first
+ int nbds = 0; //number of directsound devices
+
+ while (S_OK == enumMon->Next(1, mon.pparam(), 0)) {
+ LPOLESTR str = 0;
+ mon->GetDisplayName(0,0,&str);
+ const QString name = QString::fromUtf16((unsigned short*)str);
+ ComPointer<IMalloc> alloc;
+ ::CoGetMalloc(1, alloc.pparam());
+ alloc->Free(str);
+
+ int insert_pos = 0;
+ if (!m_audioOutputs.contains(mon)) {
+ insert_pos = m_audioOutputs.count();
+ m_audioOutputs.append(mon);
+ } else {
+ insert_pos = m_audioOutputs.indexOf(mon);
+ }
+
+ if (name.contains(QLatin1String("DirectSound"))) {
+ ret.insert(nbds++, insert_pos);
+ } else {
+ ret.append(insert_pos);
+ }
+ }
+#endif
+ break;
+ }
+#ifndef QT_NO_PHONON_EFFECT
+ case Phonon::EffectType:
+ {
+ m_audioEffects.clear();
+ ComPointer<IEnumDMO> enumDMO;
+ HRESULT hr = ::DMOEnum(DMOCATEGORY_AUDIO_EFFECT, DMO_ENUMF_INCLUDE_KEYED, 0, 0, 0, 0, enumDMO.pparam());
+ if (SUCCEEDED(hr)) {
+ CLSID clsid;
+ while (S_OK == enumDMO->Next(1, &clsid, 0, 0)) {
+ ret += m_audioEffects.count();
+ m_audioEffects.append(clsid);
+ }
+ }
+ break;
+ }
+ break;
+#endif //QT_NO_PHONON_EFFECT
+ default:
+ break;
+ }
+ return ret;
+ }
+
+ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(Phonon::ObjectDescriptionType type, int index) const
+ {
+ QHash<QByteArray, QVariant> ret;
+ switch (type)
+ {
+ case Phonon::AudioOutputDeviceType:
+ {
+#ifdef Q_OS_WINCE
+ ret["name"] = QLatin1String("default audio device");
+#else
+ const AudioMoniker &mon = m_audioOutputs[index];
+ LPOLESTR str = 0;
+ HRESULT hr = mon->GetDisplayName(0,0, &str);
+ if (SUCCEEDED(hr)) {
+ QString name = QString::fromUtf16((unsigned short*)str);
+ ComPointer<IMalloc> alloc;
+ ::CoGetMalloc(1, alloc.pparam());
+ alloc->Free(str);
+ ret["name"] = name.mid(name.indexOf('\\') + 1);
+ }
+#endif
+ }
+ break;
+#ifndef QT_NO_PHONON_EFFECT
+ case Phonon::EffectType:
+ {
+ WCHAR name[80]; // 80 is clearly stated in the MSDN doc
+ HRESULT hr = ::DMOGetName(m_audioEffects[index], name);
+ if (SUCCEEDED(hr)) {
+ ret["name"] = QString::fromUtf16((unsigned short*)name);
+ }
+ }
+ break;
+#endif //QT_NO_PHONON_EFFECT
+ default:
+ break;
+ }
+ return ret;
+ }
+
+ bool Backend::endConnectionChange(QSet<QObject *> objects)
+ {
+ //end of a transaction
+ for(QSet<QObject *>::const_iterator it = objects.begin(); it != objects.end(); ++it) {
+ if (BackendNode *node = qobject_cast<BackendNode*>(*it)) {
+ MediaObject *mo = node->mediaObject();
+ if (mo) {
+ switch(mo->transactionState)
+ {
+ case Phonon::ErrorState:
+ case Phonon::StoppedState:
+ case Phonon::LoadingState:
+ //nothing to do
+ break;
+ case Phonon::PausedState:
+ mo->transactionState = Phonon::StoppedState;
+ mo->pause();
+ break;
+ default:
+ mo->transactionState = Phonon::StoppedState;
+ mo->play();
+ break;
+ }
+
+ if (mo->state() == Phonon::ErrorState)
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+
+ bool Backend::startConnectionChange(QSet<QObject *> objects)
+ {
+ //let's save the state of the graph (before we stop it)
+ for(QSet<QObject *>::const_iterator it = objects.begin(); it != objects.end(); ++it) {
+ if (BackendNode *node = qobject_cast<BackendNode*>(*it)) {
+ if (MediaObject *mo = node->mediaObject()) {
+ if (mo->state() != Phonon::StoppedState) {
+ mo->transactionState = mo->state();
+ mo->ensureStopped(); //we have to stop the graph..
+ if (mo->state() == Phonon::ErrorState)
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ bool Backend::connectNodes(QObject *_source, QObject *_sink)
+ {
+ BackendNode *source = qobject_cast<BackendNode*>(_source);
+ if (!source) {
+ return false;
+ }
+ BackendNode *sink = qobject_cast<BackendNode*>(_sink);
+ if (!sink) {
+ return false;
+ }
+
+ //setting the graph if needed
+ if (source->mediaObject() == 0 && sink->mediaObject() == 0) {
+ //error: no graph selected
+ return false;
+ } else if (source->mediaObject() && source->mediaObject() != sink->mediaObject()) {
+ //this' graph becomes the common one
+ source->mediaObject()->grabNode(sink);
+ } else if (source->mediaObject() == 0) {
+ //sink's graph becomes the common one
+ sink->mediaObject()->grabNode(source);
+ }
+
+ return source->mediaObject()->connectNodes(source, sink);
+ }
+
+ bool Backend::disconnectNodes(QObject *_source, QObject *_sink)
+ {
+ BackendNode *source = qobject_cast<BackendNode*>(_source);
+ if (!source) {
+ return false;
+ }
+ BackendNode *sink = qobject_cast<BackendNode*>(_sink);
+ if (!sink) {
+ return false;
+ }
+
+ return source->mediaObject() == 0 ||
+ source->mediaObject()->disconnectNodes(source, sink);
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "moc_backend.cpp"
diff --git a/src/3rdparty/phonon/ds9/backend.h b/src/3rdparty/phonon/ds9/backend.h
new file mode 100644
index 0000000..ad638f2
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/backend.h
@@ -0,0 +1,83 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_BACKEND_H
+#define PHONON_BACKEND_H
+
+#include "phononds9_namespace.h"
+#include <phonon/backendinterface.h>
+#include <phonon/phononnamespace.h>
+
+#include <QtCore/QList>
+
+#include "compointer.h"
+#include "backendnode.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ class AudioOutput;
+ class MediaObject;
+
+ typedef Phonon::ObjectDescriptionType ObjectDescriptionType;
+
+ class Backend : public QObject, public Phonon::BackendInterface
+ {
+ Q_OBJECT
+ Q_INTERFACES(Phonon::BackendInterface)
+ public:
+ Backend(QObject *parent = 0, const QVariantList & = QVariantList());
+ virtual ~Backend();
+
+ QObject *createObject(Phonon::BackendInterface::Class, QObject *parent, const QList<QVariant> &args);
+
+ bool supportsVideo() const;
+ QStringList availableMimeTypes() const;
+
+ QList<int> objectDescriptionIndexes(Phonon::ObjectDescriptionType type) const;
+ QHash<QByteArray, QVariant> objectDescriptionProperties(Phonon::ObjectDescriptionType type, int index) const;
+
+ bool connectNodes(QObject *, QObject *);
+ bool disconnectNodes(QObject *, QObject *);
+
+ //transaction management
+ bool startConnectionChange(QSet<QObject *>);
+ bool endConnectionChange(QSet<QObject *>);
+
+ Filter getAudioOutputFilter(int index) const;
+
+ Q_SIGNALS:
+ void objectDescriptionChanged(ObjectDescriptionType);
+
+ private:
+ class AudioMoniker : public ComPointer<IMoniker>
+ {
+ public:
+ bool operator==(const AudioMoniker &other);
+ };
+ mutable QVector<AudioMoniker> m_audioOutputs;
+ mutable QVector<CLSID> m_audioEffects;
+ };
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // PHONON_BACKEND_H
diff --git a/src/3rdparty/phonon/ds9/backendnode.cpp b/src/3rdparty/phonon/ds9/backendnode.cpp
new file mode 100644
index 0000000..7e0b3cd
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/backendnode.cpp
@@ -0,0 +1,115 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "backendnode.h"
+#include "mediaobject.h"
+
+#include <ocidl.h> // ISpecifyPropertyPages
+#include <olectl.h> // OleCreatePropertyFrame
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ // Displays a property dialog for a filter (experimental but should be put into main
+ /*static void showPropertyDialog(const Filter &filter)
+ {
+ ComPointer<ISpecifyPropertyPages> prop(filter, IID_ISpecifyPropertyPages);
+ if (prop != 0) {
+ IUnknown *iunk[] = {filter};
+ // Show the page.
+ CAUUID caGUID;
+ prop->GetPages(&caGUID);
+ OleCreatePropertyFrame(
+ 0, // Parent window
+ 0, 0, // (Reserved)
+ 0, // Caption for the dialog box
+ 1, // Number of objects (just the filter)
+ iunk, // Array of object pointers.
+ caGUID.cElems, // Number of property pages
+ caGUID.pElems, // Array of property page CLSIDs
+ 0, // Locale identifier
+ 0, 0 // Reserved
+ );
+ }
+ }*/
+
+ //for now we have 2 graphs that do the same
+ BackendNode::BackendNode(QObject *parent) : QObject(parent), m_mediaObject(0)
+ {
+ }
+
+ BackendNode::~BackendNode()
+ {
+ }
+
+ void BackendNode::setMediaObject(MediaObject *mo)
+ {
+ if (m_mediaObject) {
+ disconnect(m_mediaObject, SIGNAL(destroyed()), this, SLOT(mediaObjectDestroyed()));
+ }
+ m_mediaObject = mo;
+ connect(mo, SIGNAL(destroyed()), SLOT(mediaObjectDestroyed()));
+ }
+
+ void BackendNode::mediaObjectDestroyed()
+ {
+ //remove the filter from its graph
+ FILTER_INFO info;
+ for(int i = 0; i < FILTER_COUNT; ++i) {
+ const Filter &filter = m_filters[i];
+ if (!filter)
+ continue;
+ filter->QueryFilterInfo(&info);
+ if (info.pGraph) {
+ HRESULT hr = info.pGraph->RemoveFilter(filter);
+ Q_ASSERT(SUCCEEDED(hr));
+ Q_UNUSED(hr);
+ info.pGraph->Release();
+ }
+ }
+ m_mediaObject = 0;
+ }
+
+ QList<InputPin> BackendNode::pins(const Filter &filter, PIN_DIRECTION wantedDirection)
+ {
+ QList<InputPin> ret;
+ if (filter) {
+ ComPointer<IEnumPins> enumPin;
+ HRESULT hr = filter->EnumPins(enumPin.pparam());
+ Q_UNUSED(hr);
+ Q_ASSERT( SUCCEEDED(hr));
+ InputPin pin;
+ while (enumPin->Next(1, pin.pparam(), 0) == S_OK) {
+ PIN_DIRECTION dir;
+ hr = pin->QueryDirection(&dir);
+ Q_ASSERT( SUCCEEDED(hr));
+ if (dir == wantedDirection) {
+ ret.append(pin);
+ }
+ }
+ }
+ return ret;
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
+#include "moc_backendnode.cpp"
diff --git a/src/3rdparty/phonon/ds9/backendnode.h b/src/3rdparty/phonon/ds9/backendnode.h
new file mode 100644
index 0000000..17bd3fb
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/backendnode.h
@@ -0,0 +1,73 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_BACKENDNODE_H
+#define PHONON_BACKENDNODE_H
+
+#include "phononds9_namespace.h"
+
+#include <QtCore/QObject>
+#include <QtCore/QVector>
+
+#include "compointer.h"
+
+QT_BEGIN_NAMESPACE
+
+
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ class MediaObject;
+ typedef ComPointer<IPin> InputPin;
+ typedef ComPointer<IPin> OutputPin;
+ typedef ComPointer<IBaseFilter> Filter;
+ typedef ComPointer<IGraphBuilder> Graph;
+
+ class BackendNode : public QObject
+ {
+ Q_OBJECT
+
+ public:
+ BackendNode(QObject *parent);
+ virtual ~BackendNode();
+
+ MediaObject *mediaObject() const {return m_mediaObject;}
+
+ static QList<InputPin> pins(const Filter &, PIN_DIRECTION);
+
+ Filter filter(int index) const { return m_filters[index]; }
+ //add a pointer to the base Media Object (giving access to the graph and error management)
+ void setMediaObject(MediaObject *mo);
+
+ //called by the connections to tell the node that it's been connection to anothe one through its 'inpin' input port
+ virtual void connected(BackendNode *, const InputPin& inpin) {}
+
+ private Q_SLOTS:
+ void mediaObjectDestroyed();
+
+ protected:
+ Filter m_filters[FILTER_COUNT];
+ MediaObject *m_mediaObject;
+ };
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/3rdparty/phonon/ds9/compointer.h b/src/3rdparty/phonon/ds9/compointer.h
new file mode 100644
index 0000000..180febf
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/compointer.h
@@ -0,0 +1,114 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_COMPOINTER_H
+#define PHONON_COMPOINTER_H
+
+#include <windows.h>
+#include <dshow.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ template<class T> class ComPointer
+ {
+ public:
+ explicit ComPointer(T *t = 0) : m_t(t)
+ {
+ }
+
+ explicit ComPointer( const IID &clsid, const IID &iid) : m_t(0)
+ {
+ ::CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, iid,
+ reinterpret_cast<void**>(&m_t));
+ }
+
+ explicit ComPointer(IUnknown *_unk, const GUID &guid) : m_t(0)
+ {
+ if (_unk) {
+ _unk->QueryInterface(guid, reinterpret_cast<void**>(&m_t));
+ }
+ }
+
+ ComPointer(const ComPointer<T> &other) : m_t(other.m_t)
+ {
+ if (m_t) {
+ m_t->AddRef();
+ }
+ }
+
+ ComPointer<T> &operator=(const ComPointer<T> &other)
+ {
+ if (other.m_t) {
+ other.m_t->AddRef();
+ }
+ if (m_t) {
+ m_t->Release();
+ }
+ m_t = other.m_t;
+ return *this;
+ }
+
+ T *operator->() const
+ {
+ return m_t;
+ }
+
+ operator T*() const
+ {
+ return m_t;
+ }
+
+ //the following method first reinitialize their value to avoid mem leaks
+ T ** pparam()
+ {
+ if (m_t) {
+ m_t->Release();
+ m_t = 0;
+ }
+ return &m_t;
+ }
+
+ bool operator==(const ComPointer<T> &other) const
+ {
+ return m_t == other.m_t;
+ }
+
+ bool operator!=(const ComPointer<T> &other) const
+ {
+ return m_t != other.m_t;
+ }
+
+ ~ComPointer()
+ {
+ if (m_t) {
+ m_t->Release();
+ }
+ }
+
+ private:
+ T *m_t;
+ };
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/3rdparty/phonon/ds9/ds9.desktop b/src/3rdparty/phonon/ds9/ds9.desktop
new file mode 100644
index 0000000..370011e
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/ds9.desktop
@@ -0,0 +1,51 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=PhononBackend
+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;
+X-KDE-Library=phonon_ds9
+X-KDE-PhononBackendInfo-InterfaceVersion=1
+X-KDE-PhononBackendInfo-Version=0.1
+X-KDE-PhononBackendInfo-Website=http://www.trolltech.com/
+InitialPreference=15
+
+Name=DirectShow9
+Name[pa]=ਡਾਇਰੈਕਸ਼ੋ9
+Name[sk]=DirectShow 9
+Name[sl]=DirectShow 9
+Name[sr]=Директшоу‑9
+Name[sr@latin]=DirectShow‑9
+Name[sv]=Directshow 9
+Name[x-test]=xxDirectShow9xx
+
+Comment=Phonon DirectShow9 backend
+Comment[bg]=Phonon DirectShow9
+Comment[ca]=Dorsal DirectShow9 del Phonon
+Comment[da]=DirectShow9-backend til Phonon
+Comment[de]=Phonon-Treiber für DirectShow9
+Comment[el]=Σύστημα υποστήριξης DirectShow9 του Phonon
+Comment[es]=Motor DirectShow9 para Phonon
+Comment[et]=Phononi DirectShow9 taustaprogramm
+Comment[fr]=Système de gestion DirectShow9 pour Phonon
+Comment[ga]=Inneall DirectShow9 le haghaidh Phonon
+Comment[gl]=Infraestrutura de DirectShow9 para Phonon
+Comment[it]=Motore DirectShow9 di Phonon
+Comment[ja]=Phonon DirectShow9 バックエンド
+Comment[ko]=Phonon DirectShow9 백엔드
+Comment[lv]=Phonon DirectShow9 aizmugure
+Comment[nds]=Phonon-Hülpprogrmm DirectShow9
+Comment[nl]=DirectShow9-backend (Phonon)
+Comment[nn]=Phonon-motor for DirectShow9
+Comment[pa]=ਫੋਨੋਨ ਡਾਇਰੈਕਟਸ਼ੋ9 ਬੈਕਐਂਡ
+Comment[pl]=Obsługa DirectShow9 przez Phonon
+Comment[pt]=Infra-estrutura do DirectShow9 para o Phonon
+Comment[pt_BR]=Infraestrutura Phonon DirectShow9
+Comment[sk]=Phonon DirectShow 9 podsystém
+Comment[sl]=Phononova Hrbtenica DirectShow 9
+Comment[sr]=Директшоу‑9 као позадина Фонона
+Comment[sr@latin]=DirectShow‑9 kao pozadina Phonona
+Comment[sv]=Phonon Directshow 9-gränssnitt
+Comment[tr]=Phonon DirectShow9 arka ucu
+Comment[uk]=Сервер DirectShow9 для Phonon
+Comment[x-test]=xxPhonon DirectShow9 backendxx
+Comment[zh_CN]=Phonon DirectShow9 后端
+Comment[zh_TW]=Phonon DirectShow9 後端介面
diff --git a/src/3rdparty/phonon/ds9/effect.cpp b/src/3rdparty/phonon/ds9/effect.cpp
new file mode 100644
index 0000000..dc4ac3d
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/effect.cpp
@@ -0,0 +1,153 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "effect.h"
+#include <phonon/effectparameter.h>
+
+#include <medparam.h>
+#include <dmo.h>
+#include <dmodshow.h>
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_PHONON_EFFECT
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ Effect::Effect(CLSID effectClass, QObject *parent)
+ : BackendNode(parent)
+ {
+ //creation of the filter
+ for(int i = 0; i < FILTER_COUNT; ++i) {
+ Filter &filter = m_filters[i];
+ filter = Filter(CLSID_DMOWrapperFilter, IID_IBaseFilter);
+ Q_ASSERT(filter);
+ ComPointer<IDMOWrapperFilter> wrapper(filter, IID_IDMOWrapperFilter);
+ Q_ASSERT(wrapper);
+ wrapper->Init(effectClass, DMOCATEGORY_AUDIO_EFFECT);
+ }
+ }
+
+ Effect::Effect(QObject *parent) : BackendNode(parent)
+ {
+ //at this point the QVector of Filter should be filled
+ }
+
+ Effect::~Effect()
+ {
+ }
+
+ QList<Phonon::EffectParameter> Effect::parameters() const
+ {
+ QList<Phonon::EffectParameter> ret;
+ ComPointer<IMediaParamInfo> paramInfo(m_filters[0], IID_IMediaParamInfo);
+ if (!paramInfo) {
+ return ret;
+ }
+ DWORD paramCount = 0;
+ paramInfo->GetParamCount( &paramCount);
+
+ for(quint32 i = 0; i < paramCount; i++) {
+ MP_PARAMINFO info;
+ HRESULT hr = paramInfo->GetParamInfo(i, &info);
+ Q_ASSERT(SUCCEEDED(hr));
+ WCHAR *name = 0;
+ hr = paramInfo->GetParamText(i, &name);
+ Q_ASSERT(SUCCEEDED(hr));
+ QVariant def, min, max;
+
+ QVariantList values;
+
+ switch(info.mpType)
+ {
+ case MPT_ENUM:
+ {
+ WCHAR *current = name;
+ current += wcslen(current) + 1; //skip the name
+ current += wcslen(current) + 1; //skip the unit
+ for(; *current; current += wcslen(current) + 1) {
+ values.append( QString::fromUtf16((unsigned short*)current) );
+ }
+ }
+ //FALLTHROUGH
+ case MPT_INT:
+ def = int(info.mpdNeutralValue);
+ min = int(info.mpdMinValue);
+ max = int(info.mpdMaxValue);
+ break;
+ case MPT_FLOAT:
+ def = info.mpdNeutralValue;
+ min = info.mpdMinValue;
+ max = info.mpdMaxValue;
+ break;
+ case MPT_BOOL:
+ def = bool(info.mpdNeutralValue);
+ break;
+ case MPT_MAX:
+ //Reserved ms-help://MS.PSDKSVR2003R2.1033/directshow/htm/mp_typeenumeration.htm
+ break;
+ }
+
+ Phonon::EffectParameter::Hints hint = info.mopCaps == MP_CAPS_CURVE_INVSQUARE ?
+ Phonon::EffectParameter::LogarithmicHint : Phonon::EffectParameter::Hints(0);
+
+ const QString n = QString::fromUtf16((unsigned short*)name);
+ ret.append(Phonon::EffectParameter(i, n, hint, def, min, max, values));
+ ::CoTaskMemFree(name); //let's free the memory
+ }
+ return ret;
+ }
+
+ QVariant Effect::parameterValue(const Phonon::EffectParameter &p) const
+ {
+ QVariant ret;
+ ComPointer<IMediaParams> params(m_filters[0], IID_IMediaParams);
+ Q_ASSERT(params);
+ MP_DATA data;
+ HRESULT hr = params->GetParam(p.id(), &data);
+ if(SUCCEEDED(hr))
+ return data;
+ else
+ return QVariant();
+ }
+
+ void Effect::setParameterValue(const Phonon::EffectParameter &p, const QVariant &v)
+ {
+ if (v.isNull()) {
+ return;
+ }
+
+ for(int i=0; i < FILTER_COUNT ; ++i) {
+ const Filter &filter = m_filters[i];
+ ComPointer<IMediaParams> params(filter, IID_IMediaParams);
+ Q_ASSERT(params);
+
+ MP_DATA data = float(v.toDouble());
+ params->SetParam(p.id(), data);
+ }
+ }
+
+ }
+}
+
+#endif //QT_NO_PHONON_EFFECT
+
+QT_END_NAMESPACE
+
+#include "moc_effect.cpp"
diff --git a/src/3rdparty/phonon/ds9/effect.h b/src/3rdparty/phonon/ds9/effect.h
new file mode 100644
index 0000000..50f3ea2
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/effect.h
@@ -0,0 +1,59 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef PHONON_AUDIOEFFECT_H
+#define PHONON_AUDIOEFFECT_H
+
+#include <QtCore/QObject>
+#include <phonon/effectinterface.h>
+#include "backendnode.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_NO_PHONON_EFFECT
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ class EffectInterface;
+
+ class Effect : public BackendNode, public Phonon::EffectInterface
+ {
+ Q_OBJECT
+ Q_INTERFACES(Phonon::EffectInterface)
+ public:
+ Effect(CLSID effectClass, QObject *parent);
+ ~Effect();
+
+ QList<Phonon::EffectParameter> parameters() const;
+ QVariant parameterValue(const Phonon::EffectParameter &) const;
+ void setParameterValue(const Phonon::EffectParameter &, const QVariant &);
+
+
+ protected:
+ //this is the constructor called by the explicit subclasses of effect
+ Effect(QObject *parent);
+ };
+ }
+}
+
+#endif //QT_NO_PHONON_EFFECT
+
+QT_END_NAMESPACE
+
+#endif // PHONON_AUDIOEFFECT_H
diff --git a/src/3rdparty/phonon/ds9/fakesource.cpp b/src/3rdparty/phonon/ds9/fakesource.cpp
new file mode 100644
index 0000000..9a61a2e
--- /dev/null
+++ b/src/3rdparty/phonon/ds9/fakesource.cpp
@@ -0,0 +1,166 @@
+/* This file is part of the KDE project.
+
+Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 2.1 or 3 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "fakesource.h"
+#include "qpin.h"
+
+#include <dshow.h>
+#include <initguid.h>
+#include <dvdmedia.h> // VIDEOINFOHEADER2
+
+QT_BEGIN_NAMESPACE
+
+namespace Phonon
+{
+ namespace DS9
+ {
+ static WAVEFORMATEX g_defaultWaveFormat = {WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0};
+ static BITMAPINFOHEADER g_defautBitmapHeader = { sizeof(BITMAPINFOHEADER), 1, 1, 1, 0, 0, 0, 0, 0, 0, 0};
+ static VIDEOINFOHEADER2 g_defaultVideoInfo = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ class FakePin : public QPin
+ {
+ public:
+ FakePin(FakeSource *source, const AM_MEDIA_TYPE &mt) :
+ QPin(source, PINDIR_OUTPUT, QVector<AM_MEDIA_TYPE>() << mt), m_source(source)
+ {
+ setAvailable(true);
+ }
+
+ ~FakePin()
+ {
+ }
+
+
+ STDMETHODIMP Disconnect()
+ {
+ HRESULT hr = QPin::Disconnect();
+ if (SUCCEEDED(hr)) {
+ setAvailable(true);
+ }
+ return hr;
+ }
+
+
+ STDMETHODIMP Connect(IPin *pin, const AM_MEDIA_TYPE *type)
+ {
+ HRESULT hr = QPin::Connect(pin, type);
+ if (SUCCEEDED(hr)) {
+ setAvailable(false);
+ }
+ return hr;
+ }
+
+ private:
+ void setAvailable(bool avail)
+ {
+ if (mediaTypes().first().majortype == MEDIATYPE_Audio) {
+ if (avail) {
+ m_source->addAvailableAudioPin(this);
+ } else {
+ m_source->removeAvailableAudioPin(this);
+ }
+ } else {
+ if (avail) {
+ m_source->addAvailableVideoPin(this);
+ } else {
+ m_source->removeAvailableVideoPin(this);
+ }
+ }
+ }
+
+ FakeSource *m_source;
+
+
+ };
+
+ FakeSource::FakeSource() : QBaseFilter(CLSID_NULL)
+ {
+ createFakeAudioPin();
+ createFakeVideoPin();
+ }
+
+ FakeSource::~FakeSource()
+ {
+ }
+
+ void FakeSource::addAvailableAudioPin(FakePin *pin)
+ {
+ availableAudioPins += pin;
+ }
+
+ void FakeSource::addAvailableVideoPin(FakePin *pin)
+ {
+ availableVideoPins += pin;
+ }
+
+ void FakeSource::removeAvailableAudioPin(FakePin *pin)
+ {
+ availableAudioPins -= pin;
+
+ if (availableAudioPins.isEmpty()) {
+ createFakeAudioPin();
+ }
+ }
+
+ void FakeSource::removeAvailableVideoPin(FakePin *pin)
+ {
+ availableVideoPins -= pin;
+
+ if (availableVideoPins.isEmpty()) {
+ createFakeVideoPin();
+ }
+ }
+
+ void FakeSource::createFakeAudioPin()
+ {
+ AM_MEDIA_TYPE mt;
+ qMemSet(&mt, 0, sizeof(AM_MEDIA_TYPE));
+ mt.majortype = MEDIATYPE_Audio;
+ mt.subtype = MEDIASUBTYPE_PCM;
+ mt.formattype = FORMAT_WaveFormatEx;
+ mt.lSampleSize = 2;
+
+ //fake the format (stereo 44.1 khz stereo 16 bits)
+ mt.cbFormat = sizeof(WAVEFORMATEX);
+ mt.pbFormat = reinterpret_cast<BYTE*>(&g_defaultWaveFormat);
+
+ new FakePin(this, mt);
+ }
+
+ void FakeSource::createFakeVideoPin()
+ {
+ AM_MEDIA_TYPE mt;
+ qMemSet(&mt, 0, sizeof(AM_MEDIA_TYPE));
+ mt.majortype = MEDIATYPE_Video;
+ mt.subtype = MEDIASUBTYPE_RGB32;
+ mt.formattype = FORMAT_VideoInfo2;
+ mt.bFixedSizeSamples = 1;
+
+ g_defaultVideoInfo.bmiHeader = g_defautBitmapHeader;
+
+ //fake the format
+ mt.cbFormat = sizeof(VIDEOINFOHEADER2);
+ mt.pbFormat = reinterpret_cast<BYTE*>(&g_defaultVideoInfo);
+
+ new FakePin(this, mt);
+ }
+
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/ds9/fakesource.h b/src/3rdparty/phonon/ds9/fakesource.h
new file mode 100644