diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-25 18:20:45 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-25 18:20:45 (GMT) |
commit | e58b7f0cc139c5fda3d472c38161be8fb718db7d (patch) | |
tree | 3c20cccfe050d125a5f4736ba11b6383e8734be4 /src/3rdparty/phonon | |
parent | c2a4a1b1e06f8b0d02e7b56c9eb0c19fd2fae80a (diff) | |
parent | 4c3539dfbc65d5decdd842d4181f9aa3d38d213c (diff) | |
download | Qt-e58b7f0cc139c5fda3d472c38161be8fb718db7d.zip Qt-e58b7f0cc139c5fda3d472c38161be8fb718db7d.tar.gz Qt-e58b7f0cc139c5fda3d472c38161be8fb718db7d.tar.bz2 |
Merge branch '4.6'
Conflicts:
doc/src/modules.qdoc
examples/assistant/simpletextviewer/findfiledialog.cpp
examples/webkit/fancybrowser/mainwindow.cpp
src/gui/widgets/qtabbar.cpp
src/gui/widgets/qtabbar_p.h
tests/auto/qpixmap/tst_qpixmap.cpp
tools/assistant/compat/helpdialog.cpp
tools/assistant/compat/tabbedbrowser.cpp
translations/translations.pri
Diffstat (limited to 'src/3rdparty/phonon')
40 files changed, 501 insertions, 499 deletions
diff --git a/src/3rdparty/phonon/ds9/backend.cpp b/src/3rdparty/phonon/ds9/backend.cpp index 6ed0145..fbc4bdc 100644 --- a/src/3rdparty/phonon/ds9/backend.cpp +++ b/src/3rdparty/phonon/ds9/backend.cpp @@ -41,6 +41,8 @@ namespace Phonon { namespace DS9 { + QMutex *Backend::directShowMutex = 0; + bool Backend::AudioMoniker::operator==(const AudioMoniker &other) { return other->IsEqual(*this) == S_OK; @@ -50,6 +52,8 @@ namespace Phonon Backend::Backend(QObject *parent, const QVariantList &) : QObject(parent) { + directShowMutex = &m_directShowMutex; + ::CoInitialize(0); //registering meta types @@ -62,11 +66,8 @@ namespace Phonon m_audioOutputs.clear(); m_audioEffects.clear(); ::CoUninitialize(); - } - QMutex *Backend::directShowMutex() - { - return &qobject_cast<Backend*>(qt_plugin_instance())->m_directShowMutex; + directShowMutex = 0; } QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args) diff --git a/src/3rdparty/phonon/ds9/backend.h b/src/3rdparty/phonon/ds9/backend.h index 8b020c2..7c3c109 100644 --- a/src/3rdparty/phonon/ds9/backend.h +++ b/src/3rdparty/phonon/ds9/backend.h @@ -64,7 +64,7 @@ namespace Phonon Filter getAudioOutputFilter(int index) const; - static QMutex *directShowMutex(); + static QMutex *directShowMutex; Q_SIGNALS: void objectDescriptionChanged(ObjectDescriptionType); diff --git a/src/3rdparty/phonon/ds9/backendnode.cpp b/src/3rdparty/phonon/ds9/backendnode.cpp index 855357a..3afcafa 100644 --- a/src/3rdparty/phonon/ds9/backendnode.cpp +++ b/src/3rdparty/phonon/ds9/backendnode.cpp @@ -58,7 +58,24 @@ namespace Phonon BackendNode::~BackendNode() { //this will remove the filter from the graph - mediaObjectDestroyed(); + 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); + + if (hr == VFW_E_NOT_STOPPED && m_mediaObject) { + m_mediaObject->ensureStopped(); + + hr = info.pGraph->RemoveFilter(filter); + } + Q_ASSERT(SUCCEEDED(hr)); + info.pGraph->Release(); + } + } } void BackendNode::setMediaObject(MediaObject *mo) diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index 250b94a..34f92c2 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -177,7 +177,7 @@ namespace Phonon void WorkerThread::handleTask() { - QMutexLocker locker(Backend::directShowMutex()); + QMutexLocker locker(Backend::directShowMutex); { QMutexLocker locker(&m_mutex); if (m_finished || m_queue.isEmpty()) { @@ -361,17 +361,17 @@ namespace Phonon m_graphs[i] = new MediaGraph(this, i); } - connect(&m_thread, SIGNAL(stateReady(Graph, Phonon::State)), - SLOT(slotStateReady(Graph, Phonon::State))); + connect(&m_thread, SIGNAL(stateReady(Graph,Phonon::State)), + SLOT(slotStateReady(Graph,Phonon::State))); - connect(&m_thread, SIGNAL(eventReady(Graph, long, long)), - SLOT(handleEvents(Graph, long, long))); + connect(&m_thread, SIGNAL(eventReady(Graph,long,long)), + SLOT(handleEvents(Graph,long,long))); - connect(&m_thread, SIGNAL(asyncRenderFinished(quint16, HRESULT, Graph)), - SLOT(finishLoading(quint16, HRESULT, Graph))); + connect(&m_thread, SIGNAL(asyncRenderFinished(quint16,HRESULT,Graph)), + SLOT(finishLoading(quint16,HRESULT,Graph))); - connect(&m_thread, SIGNAL(asyncSeekingFinished(quint16, qint64)), - SLOT(finishSeeking(quint16, qint64))); + connect(&m_thread, SIGNAL(asyncSeekingFinished(quint16,qint64)), + SLOT(finishSeeking(quint16,qint64))); //really special case m_mediaObject = this; m_thread.start(); diff --git a/src/3rdparty/phonon/gstreamer/mediaobject.cpp b/src/3rdparty/phonon/gstreamer/mediaobject.cpp index eafaeec..b6d23ec 100644 --- a/src/3rdparty/phonon/gstreamer/mediaobject.cpp +++ b/src/3rdparty/phonon/gstreamer/mediaobject.cpp @@ -95,8 +95,8 @@ MediaObject::MediaObject(Backend *backend, QObject *parent) m_backend->addBusWatcher(this); connect(m_tickTimer, SIGNAL(timeout()), SLOT(emitTick())); } - connect(this, SIGNAL(stateChanged(Phonon::State, Phonon::State)), - this, SLOT(notifyStateChange(Phonon::State, Phonon::State))); + connect(this, SIGNAL(stateChanged(Phonon::State,Phonon::State)), + this, SLOT(notifyStateChange(Phonon::State,Phonon::State))); } diff --git a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp index a793390..a559249 100644 --- a/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp +++ b/src/3rdparty/phonon/mmf/abstractaudioeffect.cpp @@ -29,6 +29,10 @@ using namespace Phonon::MMF; \internal */ +/*! \namespace Phonon::MMF + \internal +*/ + AbstractAudioEffect::AbstractAudioEffect(QObject *parent, const QList<EffectParameter> ¶ms) : MediaNode::MediaNode(parent) , m_params(params) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index f2efaa0..99e96cd 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -109,12 +109,12 @@ void MMF::AbstractMediaPlayer::pause() case GroundState: case LoadingState: case PausedState: - case ErrorState: // Do nothing break; case StoppedState: case PlayingState: + case ErrorState: case BufferingState: doPause(); stopTickTimer(); @@ -289,10 +289,6 @@ void MMF::AbstractMediaPlayer::setNextSource(const MediaSource &source) } -//----------------------------------------------------------------------------- -// VolumeObserver -//----------------------------------------------------------------------------- - void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) { TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index cff7bab..cb6e437 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -56,8 +56,6 @@ public: virtual MediaSource source() const; virtual void setFileSource(const Phonon::MediaSource&, RFile&); virtual void setNextSource(const MediaSource &source); - - // VolumeObserver virtual void volumeChanged(qreal volume); protected: diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index de2722d..caf4092 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -92,11 +92,6 @@ void MMF::AbstractPlayer::setTransitionTime(qint32 time) m_transitionTime = time; } - -//----------------------------------------------------------------------------- -// VolumeObserver -//----------------------------------------------------------------------------- - void MMF::AbstractPlayer::volumeChanged(qreal volume) { m_volume = volume; @@ -134,7 +129,7 @@ void MMF::AbstractPlayer::setError(Phonon::ErrorType error, Phonon::ErrorType MMF::AbstractPlayer::errorType() const { const Phonon::ErrorType result = (ErrorState == m_state) - ? errorType() : NoError; + ? m_error : NoError; return result; } diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 66496cc..2e9cfa0 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -24,8 +24,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include <QObject> -#include "volumeobserver.h" - #include "videooutput.h" class RFile; @@ -49,7 +47,6 @@ class VideoOutput; * - Video, in which case the implementation is VideoPlayer */ class AbstractPlayer : public QObject - , public VolumeObserver { // Required although this class has no signals or slots // Without this, qobject_cast will fail @@ -85,7 +82,6 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&) = 0; virtual void setNextSource(const Phonon::MediaSource &) = 0; - // VolumeObserver virtual void volumeChanged(qreal volume); void setVideoOutput(VideoOutput* videoOutput); diff --git a/src/3rdparty/phonon/mmf/ancestormovemonitor.cpp b/src/3rdparty/phonon/mmf/ancestormovemonitor.cpp index 0447d57..18ced94 100644 --- a/src/3rdparty/phonon/mmf/ancestormovemonitor.cpp +++ b/src/3rdparty/phonon/mmf/ancestormovemonitor.cpp @@ -26,7 +26,7 @@ QT_BEGIN_NAMESPACE using namespace Phonon::MMF; -/*! \class MMF::AncestorMoveMonitor +/*! \class Phonon::MMF::AncestorMoveMonitor \internal \brief Class which installs a global event filter, and listens for move events which may affect the absolute position of widgets registered with @@ -34,6 +34,11 @@ using namespace Phonon::MMF; See QTBUG-4956 */ + +/*! \class Phonon::MMF::VideoOutputObserver + \internal +*/ + //----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp index 82af9f1..d6e0c13 100644 --- a/src/3rdparty/phonon/mmf/audiooutput.cpp +++ b/src/3rdparty/phonon/mmf/audiooutput.cpp @@ -24,7 +24,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "defs.h" #include "mediaobject.h" #include "utils.h" -#include "volumeobserver.h" QT_BEGIN_NAMESPACE @@ -41,7 +40,6 @@ using namespace Phonon::MMF; MMF::AudioOutput::AudioOutput(Backend *, QObject *parent) : MediaNode(parent) , m_volume(InitialVolume) - , m_observer(0) { } @@ -59,12 +57,9 @@ qreal MMF::AudioOutput::volume() const void MMF::AudioOutput::setVolume(qreal volume) { TRACE_CONTEXT(AudioOutput::setVolume, EAudioApi); - TRACE_ENTRY("observer 0x%08x volume %f", m_observer, volume); + TRACE_ENTRY("volume %f", volume); if (volume != m_volume) { - if (m_observer) { - m_observer->volumeChanged(volume); - } m_volume = volume; TRACE("emit volumeChanged(%f)", volume) @@ -86,17 +81,12 @@ bool MMF::AudioOutput::setOutputDevice(int index) return true; } -void MMF::AudioOutput::setVolumeObserver(VolumeObserver* observer) -{ - m_observer = observer; - if (m_observer) { - m_observer->volumeChanged(m_volume); - } -} - bool MMF::AudioOutput::activateOnMediaObject(MediaObject *mo) { - setVolumeObserver(mo); + // Ensure that the MediaObject has the correct initial volume + mo->volumeChanged(m_volume); + // Connect MediaObject to receive future volume changes + connect(this, SIGNAL(volumeChanged(qreal)), mo, SLOT(volumeChanged(qreal))); return true; } diff --git a/src/3rdparty/phonon/mmf/audiooutput.h b/src/3rdparty/phonon/mmf/audiooutput.h index d0ba086..1e1e134 100644 --- a/src/3rdparty/phonon/mmf/audiooutput.h +++ b/src/3rdparty/phonon/mmf/audiooutput.h @@ -31,12 +31,11 @@ namespace Phonon namespace MMF { class Backend; -class VolumeObserver; /** * @short AudioOutputInterface implementation for MMF. * - * Forwards volume commands to the VolumeObserver instance, + * Forwards volume commands to the MediaObject instance, * which is provided by the backend when MediaNode objects are * connected. * @@ -82,13 +81,8 @@ Q_SIGNALS: void audioDeviceFailed(); private: - - void setVolumeObserver(VolumeObserver* observer); - qreal m_volume; - // Not owned - VolumeObserver* m_observer; }; } } diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp index cac27e3..7e3a67f 100644 --- a/src/3rdparty/phonon/mmf/backend.cpp +++ b/src/3rdparty/phonon/mmf/backend.cpp @@ -38,10 +38,6 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; -/*! \class MMF::VolumeObserver - \internal -*/ - /*! \class MMF::Backend \internal */ diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index f004fd7..21dcfe1 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -319,10 +319,10 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) } connect(m_player.data(), SIGNAL(totalTimeChanged(qint64)), SIGNAL(totalTimeChanged(qint64))); - connect(m_player.data(), SIGNAL(stateChanged(Phonon::State, Phonon::State)), SIGNAL(stateChanged(Phonon::State, Phonon::State))); + connect(m_player.data(), SIGNAL(stateChanged(Phonon::State,Phonon::State)), SIGNAL(stateChanged(Phonon::State,Phonon::State))); connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished())); connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); - connect(m_player.data(), SIGNAL(metaDataChanged(const QMultiMap<QString, QString>&)), SIGNAL(metaDataChanged(const QMultiMap<QString, QString>&))); + connect(m_player.data(), SIGNAL(metaDataChanged(QMultiMap<QString,QString>)), SIGNAL(metaDataChanged(QMultiMap<QString,QString>))); // We need to call setError() after doing the connects, otherwise the // error won't be received. @@ -359,11 +359,6 @@ void MMF::MediaObject::setTransitionTime(qint32 time) m_player->setTransitionTime(time); } - -//----------------------------------------------------------------------------- -// VolumeObserver -//----------------------------------------------------------------------------- - void MMF::MediaObject::volumeChanged(qreal volume) { m_player->volumeChanged(volume); diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 409918d..ee94ea2 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -30,7 +30,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "abstractplayer.h" #include "mmf_medianode.h" #include "defs.h" -#include "volumeobserver.h" QT_BEGIN_NAMESPACE @@ -46,7 +45,6 @@ class VideoOutput; */ class MediaObject : public MediaNode , public MediaObjectInterface - , public VolumeObserver { Q_OBJECT Q_INTERFACES(Phonon::MediaObjectInterface) @@ -77,9 +75,6 @@ public: virtual qint32 transitionTime() const; virtual void setTransitionTime(qint32); - // VolumeObserver - void volumeChanged(qreal volume); - /** * This class owns the AbstractPlayer, and will delete it upon * destruction. @@ -90,6 +85,9 @@ public: virtual bool activateOnMediaObject(MediaObject *); +public Q_SLOTS: + void volumeChanged(qreal volume); + Q_SIGNALS: void totalTimeChanged(qint64 length); void hasVideoChanged(bool hasVideo); diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp index ba7d005..2059fbe 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp @@ -49,7 +49,7 @@ MMF::VideoPlayer::VideoPlayer() , m_screenDevice(*CCoeEnv::Static()->ScreenDevice()) , m_window(0) , m_totalTime(0) - , m_mmfOutputChangePending(false) + , m_pendingChanges(false) { construct(); } @@ -60,7 +60,7 @@ MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player) , m_screenDevice(*CCoeEnv::Static()->ScreenDevice()) , m_window(0) , m_totalTime(0) - , m_mmfOutputChangePending(false) + , m_pendingChanges(false) { construct(); } @@ -70,24 +70,11 @@ void MMF::VideoPlayer::construct() TRACE_CONTEXT(VideoPlayer::VideoPlayer, EVideoApi); TRACE_ENTRY_0(); - if (m_videoOutput) - m_videoOutput->setObserver(this); + getVideoWindow(); const TInt priority = 0; const TMdaPriorityPreference preference = EMdaPriorityPreferenceNone; - // Ignore return value - first call must always return true - getNativeWindowSystemHandles(); - - // TODO: is this the correct way to handle errors which occur when - // creating a Symbian object in the constructor of a Qt object? - - // TODO: check whether videoOutput is visible? If not, then the - // corresponding window will not be active, meaning that the - // clipping region will be set to empty and the video will not be - // visible. If this is the case, we should set m_mmfOutputChangePending - // and respond to future showEvents from the videoOutput widget. - TRAPD(err, m_player.reset(CVideoPlayerUtility::NewL ( @@ -95,7 +82,7 @@ void MMF::VideoPlayer::construct() priority, preference, m_wsSession, m_screenDevice, *m_window, - m_rect, m_rect + m_videoRect, m_videoRect )) ); @@ -110,8 +97,8 @@ MMF::VideoPlayer::~VideoPlayer() TRACE_CONTEXT(VideoPlayer::~VideoPlayer, EVideoApi); TRACE_ENTRY_0(); - if (m_videoOutput) - m_videoOutput->setObserver(0); + // QObject destructor removes all signal-slot connections involving this + // object, so we do not need to disconnect from m_videoOutput here. TRACE_EXIT_0(); } @@ -124,11 +111,7 @@ void MMF::VideoPlayer::doPlay() { TRACE_CONTEXT(VideoPlayer::doPlay, EVideoApi); - // See comment in updateMmfOutput - if (m_mmfOutputChangePending) { - TRACE_0("MMF output change pending - pushing now"); - updateMmfOutput(); - } + applyPendingChanges(); m_player->Play(); } @@ -255,13 +238,10 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError) maxVolumeChanged(m_player->MaxVolume()); if (m_videoOutput) - m_videoOutput->setFrameSize(m_frameSize); + m_videoOutput->setVideoSize(m_videoFrameSize); - // See comment in updateMmfOutput - if (m_mmfOutputChangePending) { - TRACE_0("MMF output change pending - pushing now"); - updateMmfOutput(); - } + updateVideoRect(); + applyPendingChanges(); emit totalTimeChanged(totalTime()); changeState(StoppedState); @@ -279,7 +259,7 @@ void MMF::VideoPlayer::doPrepareCompleteL(TInt aError) // Get frame size TSize size; m_player->VideoFrameSizeL(size); - m_frameSize = QSize(size.iWidth, size.iHeight); + m_videoFrameSize = QSize(size.iWidth, size.iHeight); // Get duration m_totalTime = toMilliSeconds(m_player->DurationL()); @@ -322,27 +302,178 @@ void MMF::VideoPlayer::MvpuoEvent(const TMMFEvent &aEvent) //----------------------------------------------------------------------------- -// VideoOutputObserver +// Video window updates //----------------------------------------------------------------------------- -void MMF::VideoPlayer::videoOutputRegionChanged() +void MMF::VideoPlayer::getVideoWindow() +{ + TRACE_CONTEXT(VideoPlayer::getVideoWindow, EVideoInternal); + TRACE_ENTRY_0(); + + if(m_videoOutput) { + // Dump information to log, only in debug builds + m_videoOutput->dump(); + + initVideoOutput(); + m_window = m_videoOutput->videoWindow(); + updateVideoRect(); + } else + // Top-level window + m_window = QApplication::activeWindow()->effectiveWinId()->DrawableWindow(); + + TRACE_EXIT_0(); +} + +void MMF::VideoPlayer::videoOutputChanged() +{ + TRACE_CONTEXT(VideoPlayer::videoOutputChanged, EVideoInternal); + TRACE_ENTRY_0(); + + if (m_videoOutput) { + initVideoOutput(); + videoWindowChanged(); + } + + TRACE_EXIT_0(); +} + +void MMF::VideoPlayer::initVideoOutput() +{ + m_videoOutput->winId(); + m_videoOutput->setVideoSize(m_videoFrameSize); + + bool connected = connect( + m_videoOutput, SIGNAL(videoWindowChanged()), + this, SLOT(videoWindowChanged()) + ); + Q_ASSERT(connected); + + connected = connect( + m_videoOutput, SIGNAL(aspectRatioChanged()), + this, SLOT(aspectRatioChanged()) + ); + Q_ASSERT(connected); + + connected = connect( + m_videoOutput, SIGNAL(scaleModeChanged()), + this, SLOT(scaleModeChanged()) + ); + Q_ASSERT(connected); + + // Suppress warnings in release builds + Q_UNUSED(connected); +} + +void MMF::VideoPlayer::videoWindowChanged() { TRACE_CONTEXT(VideoPlayer::videoOutputRegionChanged, EVideoInternal); TRACE_ENTRY("state %d", state()); - const bool changed = getNativeWindowSystemHandles(); + m_window = m_videoOutput->videoWindow(); - // See comment in updateMmfOutput - if (changed) { - if (state() == LoadingState) - m_mmfOutputChangePending = true; - else - updateMmfOutput(); + updateVideoRect(); + + TRACE_EXIT_0(); +} + +// Helper function for aspect ratio / scale mode handling +QSize scaleToAspect(const QSize& srcRect, int aspectWidth, int aspectHeight) +{ + const qreal aspectRatio = qreal(aspectWidth) / aspectHeight; + + int width = srcRect.width(); + int height = srcRect.width() / aspectRatio; + if (height > srcRect.height()){ + height = srcRect.height(); + width = srcRect.height() * aspectRatio; } + return QSize(width, height); +} + +void MMF::VideoPlayer::updateVideoRect() +{ + QRect videoRect; + const QRect windowRect = m_videoOutput->videoWindowRect(); + const QSize windowSize = windowRect.size(); + + // Calculate size of smallest rect which contains video frame size + // and conforms to aspect ratio + switch (m_videoOutput->aspectRatio()) { + case Phonon::VideoWidget::AspectRatioAuto: + videoRect.setSize(m_videoFrameSize); + break; + + case Phonon::VideoWidget::AspectRatioWidget: + videoRect.setSize(windowSize); + break; + + case Phonon::VideoWidget::AspectRatio4_3: + videoRect.setSize(scaleToAspect(m_videoFrameSize, 4, 3)); + break; + + case Phonon::VideoWidget::AspectRatio16_9: + videoRect.setSize(scaleToAspect(m_videoFrameSize, 16, 9)); + break; + } + + // Scale to fill the window width + const int windowWidth = windowSize.width(); + const int windowHeight = windowSize.height(); + const qreal windowScaleFactor = qreal(windowWidth) / videoRect.width(); + int videoWidth = windowWidth; + int videoHeight = videoRect.height() * windowScaleFactor; + + const qreal windowToVideoHeightRatio = qreal(windowHeight) / videoHeight; + + switch(m_videoOutput->scaleMode()) { + case Phonon::VideoWidget::ScaleAndCrop: + if(videoHeight < windowHeight) { + videoWidth *= windowToVideoHeightRatio; + videoHeight = windowHeight; + } + break; + case Phonon::VideoWidget::FitInView: + default: + if(videoHeight > windowHeight) { + videoWidth *= windowToVideoHeightRatio; + videoHeight = windowHeight; + } + break; + } + + // Calculate scale factors + m_scaleWidth = 100.0f * videoWidth / m_videoFrameSize.width(); + m_scaleHeight = 100.0f * videoHeight / m_videoFrameSize.height(); + + m_videoRect = qt_QRect2TRect(windowRect); + + if (state() == LoadingState) + m_pendingChanges = true; + else { + applyVideoWindowChange(); + m_pendingChanges = false; + } +} + +void MMF::VideoPlayer::aspectRatioChanged() +{ + TRACE_CONTEXT(VideoPlayer::aspectRatioChanged, EVideoInternal); + TRACE_ENTRY("state %d aspectRatio %d", state()); + + updateVideoRect(); TRACE_EXIT_0(); } +void MMF::VideoPlayer::scaleModeChanged() +{ + TRACE_CONTEXT(VideoPlayer::scaleModeChanged, EVideoInternal); + TRACE_ENTRY("state %d", state()); + + updateVideoRect(); + + TRACE_EXIT_0(); +} #ifndef QT_NO_DEBUG @@ -383,113 +514,61 @@ void getDsaRegion(RWsSession &session, const RWindowBase &window) #endif // _DEBUG -void MMF::VideoPlayer::updateMmfOutput() +void MMF::VideoPlayer::applyPendingChanges() { - TRACE_CONTEXT(VideoPlayer::updateMmfOutput, EVideoInternal); - TRACE_ENTRY_0(); + if(m_pendingChanges) + applyVideoWindowChange(); - // Calling SetDisplayWindowL is a no-op unless the MMF controller has - // been loaded, so we shouldn't do it. Instead, the - // m_mmfOutputChangePending flag is used to record the fact that we - // need to call SetDisplayWindowL, and this is checked in - // MvpuoPrepareComplete, at which point the MMF controller has been - // loaded. + m_pendingChanges = false; +} + +void MMF::VideoPlayer::applyVideoWindowChange() +{ + TRACE_CONTEXT(VideoPlayer::applyVideoWindowChange, EVideoInternal); + TRACE_ENTRY_0(); #ifndef QT_NO_DEBUG getDsaRegion(m_wsSession, *m_window); #endif - TRAPD(err, - m_player->SetDisplayWindowL - ( - m_wsSession, m_screenDevice, - *m_window, - m_rect, m_rect - ) - ); + static const TBool antialias = ETrue; - if (KErrNone != err) { - TRACE("SetDisplayWindowL error %d", err); + TRAPD(err, m_player->SetScaleFactorL(m_scaleWidth, m_scaleHeight, antialias)); + if(KErrNone != err) { + TRACE("SetScaleFactorL (1) err %d", err); setError(NormalError); } - m_mmfOutputChangePending = false; + if(KErrNone == err) { + TRAP(err, + m_player->SetDisplayWindowL + ( + m_wsSession, m_screenDevice, + *m_window, + m_videoRect, m_videoRect + ) + ); + + if (KErrNone != err) { + TRACE("SetDisplayWindowL err %d", err); + setError(NormalError); + } else { + TRAP(err, m_player->SetScaleFactorL(m_scaleWidth, m_scaleHeight, antialias)); + if(KErrNone != err) { + TRACE("SetScaleFactorL (2) err %d", err); + setError(NormalError); + } + } + } TRACE_EXIT_0(); } //----------------------------------------------------------------------------- -// Private functions +// Metadata //----------------------------------------------------------------------------- -void MMF::VideoPlayer::videoOutputChanged() -{ - TRACE_CONTEXT(VideoPlayer::videoOutputChanged, EVideoInternal); - TRACE_ENTRY_0(); - - if (m_videoOutput) { - m_videoOutput->setObserver(this); - m_videoOutput->setFrameSize(m_frameSize); - } - - videoOutputRegionChanged(); - - TRACE_EXIT_0(); -} - -bool MMF::VideoPlayer::getNativeWindowSystemHandles() -{ - TRACE_CONTEXT(VideoPlayer::getNativeWindowSystemHandles, EVideoInternal); - TRACE_ENTRY_0(); - - CCoeControl *control = 0; - - if (m_videoOutput) - // Create native window - control = m_videoOutput->winId(); - else - // Get top-level window - control = QApplication::activeWindow()->effectiveWinId(); - -#ifndef QT_NO_DEBUG - if (m_videoOutput) { - QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper); - dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs - ObjectDump::addDefaultAnnotators(*dumper); - TRACE_0("Dumping VideoOutput:"); - dumper->dumpObject(*m_videoOutput); - } - else { - TRACE_0("m_videoOutput is null - dumping top-level control info:"); - TRACE("control %08x", control); - TRACE("control.parent %08x", control->Parent()); - TRACE("control.isVisible %d", control->IsVisible()); - TRACE("control.rect %d,%d %dx%d", - control->Position().iX, control->Position().iY, - control->Size().iWidth, control->Size().iHeight); - TRACE("control.ownsWindow %d", control->OwnsWindow()); - } -#endif - - RWindowBase *const window = control->DrawableWindow(); - const TRect rect(window->AbsPosition(), window->Size()); - - TRACE("rect %d %d - %d %d", - rect.iTl.iX, rect.iTl.iY, - rect.iBr.iX, rect.iBr.iY); - - bool changed = false; - - if (window != m_window || rect != m_rect) { - m_window = window; - m_rect = rect; - changed = true; - } - - TRACE_RETURN("changed %d", changed); -} - int MMF::VideoPlayer::numberOfMetaDataEntries() const { int numberOfEntries = 0; diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h index fa4e59b..599bb88 100644 --- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h +++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h @@ -23,7 +23,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "abstractmediaplayer.h" #include "videooutput.h" -#include "videooutputobserver.h" QT_BEGIN_NAMESPACE @@ -40,7 +39,6 @@ namespace MMF */ class VideoPlayer : public AbstractMediaPlayer , public MVideoPlayerUtilityObserver - , public VideoOutputObserver { Q_OBJECT @@ -70,8 +68,10 @@ public: virtual void MvpuoPlayComplete(TInt aError); virtual void MvpuoEvent(const TMMFEvent &aEvent); - // VideoOutputObserver - virtual void videoOutputRegionChanged(); +public Q_SLOTS: + void videoWindowChanged(); + void aspectRatioChanged(); + void scaleModeChanged(); private: void construct(); @@ -81,10 +81,13 @@ private: // AbstractPlayer virtual void videoOutputChanged(); - // Returns true if handles have changed - bool getNativeWindowSystemHandles(); + void getVideoWindow(); + void initVideoOutput(); - void updateMmfOutput(); + void updateVideoRect(); + + void applyPendingChanges(); + void applyVideoWindowChange(); // AbstractMediaPlayer virtual int numberOfMetaDataEntries() const; @@ -97,12 +100,17 @@ private: RWsSession& m_wsSession; CWsScreenDevice& m_screenDevice; RWindowBase* m_window; - TRect m_rect; - QSize m_frameSize; + /* Extent of the video display - will be clipped to m_windowRect */ + TRect m_videoRect; + + TReal32 m_scaleWidth; + TReal32 m_scaleHeight; + + QSize m_videoFrameSize; qint64 m_totalTime; - bool m_mmfOutputChangePending; + bool m_pendingChanges; }; diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h deleted file mode 100644 index b8987e0..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_global.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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 OBJECTDUMP_GLOBAL_H -#define OBJECTDUMP_GLOBAL_H - -#include <QtCore/QtGlobal> - -#if defined(OBJECTDUMP_LIBRARY) -# define OBJECTDUMP_EXPORT -#else -# define OBJECTDUMP_EXPORT -#endif - -#endif diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp deleted file mode 100644 index 6207dac..0000000 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_stub.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* 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 "objectdump.h" - -QT_BEGIN_NAMESPACE - -namespace ObjectDump -{ - -void addDefaultAnnotators_sys(QDumper& /*dumper*/) -{ - -} - -void addDefaultAnnotators_sys(QVisitor& /*visitor*/) -{ - -} - -} // namespace ObjectDump - -QT_END_NAMESPACE - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp b/src/3rdparty/phonon/mmf/objectdump.cpp index 9add439..3d10be4 100644 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp +++ b/src/3rdparty/phonon/mmf/objectdump.cpp @@ -523,5 +523,3 @@ void dumpAncestors(const QObject& leaf, QVisitor& visitor) QT_END_NAMESPACE - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h b/src/3rdparty/phonon/mmf/objectdump.h index e94b3ac..86aeaba 100644 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h +++ b/src/3rdparty/phonon/mmf/objectdump.h @@ -19,8 +19,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #ifndef OBJECTDUMP_H #define OBJECTDUMP_H -#include "objectdump_global.h" - #include <QObject> #include <QList> #include <QByteArray> @@ -34,7 +32,7 @@ namespace ObjectDump /** * Abstract base for annotator classes invoked by QVisitor. */ -class OBJECTDUMP_EXPORT QAnnotator : public QObject +class QAnnotator : public QObject { Q_OBJECT public: @@ -45,7 +43,7 @@ public: /** * Annotator which replicates QObject::dumpObjectTree functionality. */ -class OBJECTDUMP_EXPORT QAnnotatorBasic : public QAnnotator +class QAnnotatorBasic : public QAnnotator { Q_OBJECT public: @@ -55,7 +53,7 @@ public: /** * Annotator which returns widget information. */ -class OBJECTDUMP_EXPORT QAnnotatorWidget : public QAnnotator +class QAnnotatorWidget : public QAnnotator { Q_OBJECT public: @@ -68,7 +66,7 @@ class QDumperPrivate; /** * Class used to dump information about individual QObjects. */ -class OBJECTDUMP_EXPORT QDumper : public QObject +class QDumper : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QDumper) @@ -103,7 +101,7 @@ class QVisitorPrivate; /** * Visitor class which dumps information about nodes in the object tree. */ -class OBJECTDUMP_EXPORT QVisitor : public QObject +class QVisitor : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QVisitor) @@ -152,12 +150,12 @@ private: // Utility functions //----------------------------------------------------------------------------- -void OBJECTDUMP_EXPORT addDefaultAnnotators(QDumper& dumper); -void OBJECTDUMP_EXPORT addDefaultAnnotators(QVisitor& visitor); +void addDefaultAnnotators(QDumper& dumper); +void addDefaultAnnotators(QVisitor& visitor); -void OBJECTDUMP_EXPORT dumpTreeFromRoot(const QObject& root, QVisitor& visitor); -void OBJECTDUMP_EXPORT dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor); -void OBJECTDUMP_EXPORT dumpAncestors(const QObject& leaf, QVisitor& visitor); +void dumpTreeFromRoot(const QObject& root, QVisitor& visitor); +void dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor); +void dumpAncestors(const QObject& leaf, QVisitor& visitor); } // namespace ObjectDump diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/objectdump_symbian.cpp index 03220a7..2efebdb 100644 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp +++ b/src/3rdparty/phonon/mmf/objectdump_symbian.cpp @@ -99,46 +99,39 @@ QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object) if (widget) { const CCoeControl* control = widget->effectiveWinId(); - RDrawableWindow *window = 0; - if (control && (window = control->DrawableWindow())) { - - QByteArray array; - QTextStream stream(&array); + if (control) { + RDrawableWindow *const window = control->DrawableWindow(); + if(window) { + QByteArray array; + QTextStream stream(&array); - stream << "window: "; + stream << "window: "; - // ClientHandle() is available first in 5.0. -#if !defined(__SERIES60_31__) && !defined(__S60_32__) - if (QSysInfo::s60Version() > QSysInfo::SV_S60_3_2) - // Client-side window handle + // Server-side address of CWsWindow object + // This is useful for correlation with the window tree dumped by the window + // server (see RWsSession::LogCommand). // Cast to a void pointer so that log output is in hexadecimal format. - stream << "cli " << reinterpret_cast<const void*>(window->ClientHandle()) << ' '; -#endif - - // Server-side address of CWsWindow object - // This is useful for correlation with the window tree dumped by the window - // server (see RWsSession::LogCommand). - // Cast to a void pointer so that log output is in hexadecimal format. - stream << "srv " << reinterpret_cast<const void*>(window->WsHandle()) << ' '; + stream << "srv " << reinterpret_cast<const void*>(window->WsHandle()) << ' '; - stream << "group " << window->WindowGroupId() << ' '; + stream << "group " << window->WindowGroupId() << ' '; - // Client-side handle to the parent window. - // Cast to a void pointer so that log output is in hexadecimal format. - stream << "parent " << reinterpret_cast<const void*>(window->Parent()) << ' '; + // Client-side handle to the parent window. + // Cast to a void pointer so that log output is in hexadecimal format. + stream << "parent " << reinterpret_cast<const void*>(window->Parent()) << ' '; - stream << window->Position().iX << ',' << window->Position().iY << ' '; - stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") "; - stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' '; + stream << window->Position().iX << ',' << window->Position().iY << ' '; + stream << '(' << window->AbsPosition().iX << ',' << window->AbsPosition().iY << ") "; + stream << window->Size().iWidth << 'x' << window->Size().iHeight << ' '; - const TDisplayMode displayMode = window->DisplayMode(); - stream << "mode " << displayMode << ' '; + const TDisplayMode displayMode = window->DisplayMode(); + stream << "mode " << displayMode << ' '; - stream << "ord " << window->OrdinalPosition(); + stream << "ord " << window->OrdinalPosition(); - stream.flush(); - result.append(array); + stream.flush(); + result.append(array); + } } } @@ -165,4 +158,3 @@ void addDefaultAnnotators_sys(QVisitor& visitor) QT_END_NAMESPACE - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h b/src/3rdparty/phonon/mmf/objectdump_symbian.h index 563c862..563c862 100644 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h +++ b/src/3rdparty/phonon/mmf/objectdump_symbian.h diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp b/src/3rdparty/phonon/mmf/objecttree.cpp index bc61435..06b0ced 100644 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp +++ b/src/3rdparty/phonon/mmf/objecttree.cpp @@ -98,5 +98,3 @@ AncestorConstIterator::AncestorConstIterator(const QObject& leaf) QT_END_NAMESPACE - - diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h b/src/3rdparty/phonon/mmf/objecttree.h index 98bdf14..96adb6f 100644 --- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h +++ b/src/3rdparty/phonon/mmf/objecttree.h @@ -19,8 +19,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #ifndef OBJECTTREE_H #define OBJECTTREE_H -#include "objectdump_global.h" - #include <QObject> #include <QStack> @@ -32,7 +30,7 @@ namespace ObjectTree /** * Depth-first iterator for QObject tree */ -class OBJECTDUMP_EXPORT DepthFirstConstIterator +class DepthFirstConstIterator { public: DepthFirstConstIterator(); @@ -60,7 +58,7 @@ private: /** * Ancestor iterator for QObject tree */ -class OBJECTDUMP_EXPORT AncestorConstIterator +class AncestorConstIterator { public: AncestorConstIterator(); diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index 58d1ece..d728fcf 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -24,16 +24,24 @@ QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; -/*! \namespace MMF::Utils +/*! \namespace Phonon::MMF::Utils \internal */ -/*! \class MMF::TTraceContext +/*! \class Phonon::MMF::TTraceContext \internal */ -/*! \class MMF::Utils - \internal +/*! \enum Phonon::MMF::PanicCode + \internal +*/ + +/*! \enum Phonon::MMF::TTraceCategory + \internal +*/ + +/*! \enum Phonon::MMF::MediaType + \internal */ _LIT(PanicCategory, "Phonon::MMF"); diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index 1b338a2..ddf30de 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -19,7 +19,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "ancestormovemonitor.h" #include "utils.h" #include "videooutput.h" -#include "videooutputobserver.h" #ifndef QT_NO_DEBUG #include "objectdump.h" @@ -30,8 +29,11 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include <QMoveEvent> #include <QResizeEvent> +#include <QtCore/private/qcore_symbian_p.h> // for qt_TRect2QRect #include <QtGui/private/qwidget_p.h> // to access QWExtra +#include <coecntrl.h> + QT_BEGIN_NAMESPACE using namespace Phonon; @@ -42,6 +44,16 @@ using namespace Phonon::MMF; */ //----------------------------------------------------------------------------- +// Constants +//----------------------------------------------------------------------------- + +static const Phonon::VideoWidget::AspectRatio DefaultAspectRatio = + Phonon::VideoWidget::AspectRatioAuto; +static const Phonon::VideoWidget::ScaleMode DefaultScaleMode = + Phonon::VideoWidget::FitInView; + + +//----------------------------------------------------------------------------- // Constructor / destructor //----------------------------------------------------------------------------- @@ -49,7 +61,8 @@ MMF::VideoOutput::VideoOutput (AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent) : QWidget(parent) , m_ancestorMoveMonitor(ancestorMoveMonitor) - , m_observer(0) + , m_aspectRatio(DefaultAspectRatio) + , m_scaleMode(DefaultScaleMode) { TRACE_CONTEXT(VideoOutput::VideoOutput, EVideoInternal); TRACE_ENTRY("parent 0x%08x", parent); @@ -66,6 +79,7 @@ MMF::VideoOutput::VideoOutput // to be invisible when running on the target device. qt_widget_private(this)->extraData()->disableBlit = true; + getVideoWindowRect(); registerForAncestorMoved(); dump(); @@ -83,33 +97,35 @@ MMF::VideoOutput::~VideoOutput() TRACE_EXIT_0(); } -void MMF::VideoOutput::setFrameSize(const QSize& frameSize) +void MMF::VideoOutput::setVideoSize(const QSize& frameSize) { - TRACE_CONTEXT(VideoOutput::setFrameSize, EVideoInternal); + TRACE_CONTEXT(VideoOutput::setVideoSize, EVideoInternal); TRACE("oldSize %d %d newSize %d %d", - m_frameSize.width(), m_frameSize.height(), + m_videoFrameSize.width(), m_videoFrameSize.height(), frameSize.width(), frameSize.height()); - if (frameSize != m_frameSize) { - m_frameSize = frameSize; + if (frameSize != m_videoFrameSize) { + m_videoFrameSize = frameSize; updateGeometry(); } } -void MMF::VideoOutput::setObserver(VideoOutputObserver* observer) -{ - TRACE_CONTEXT(VideoOutput::setObserver, EVideoInternal); - TRACE("observer 0x%08x", observer); - - m_observer = observer; -} - void MMF::VideoOutput::ancestorMoved() { TRACE_CONTEXT(VideoOutput::ancestorMoved, EVideoInternal); TRACE_ENTRY_0(); - videoOutputRegionChanged(); + RWindowBase *const window = videoWindow(); + + if(window) { + const TPoint newWindowPosSymbian = window->AbsPosition(); + const QPoint newWindowPos(newWindowPosSymbian.iX, newWindowPosSymbian.iY); + + if(newWindowPos != m_videoWindowRect.topLeft()) { + m_videoWindowRect.moveTo(newWindowPos); + emit videoWindowChanged(); + } + } TRACE_EXIT_0(); } @@ -123,9 +139,8 @@ QSize MMF::VideoOutput::sizeHint() const // TODO: replace this with a more sensible default QSize result(320, 240); - if (!m_frameSize.isNull()) { - result = m_frameSize; - } + if (!m_videoFrameSize.isNull()) + result = m_videoFrameSize; return result; } @@ -149,7 +164,10 @@ void MMF::VideoOutput::resizeEvent(QResizeEvent* event) event->oldSize().width(), event->oldSize().height(), event->size().width(), event->size().height()); - videoOutputRegionChanged(); + if(event->size() != event->oldSize()) { + m_videoWindowRect.setSize(event->size()); + emit videoWindowChanged(); + } } void MMF::VideoOutput::moveEvent(QMoveEvent* event) @@ -159,7 +177,10 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event) event->oldPos().x(), event->oldPos().y(), event->pos().x(), event->pos().y()); - videoOutputRegionChanged(); + if(event->pos() != event->oldPos()) { + m_videoWindowRect.moveTo(event->pos()); + emit videoWindowChanged(); + } } bool MMF::VideoOutput::event(QEvent* event) @@ -168,7 +189,8 @@ bool MMF::VideoOutput::event(QEvent* event) if (event->type() == QEvent::WinIdChange) { TRACE_0("WinIdChange"); - videoOutputRegionChanged(); + getVideoWindowRect(); + emit videoWindowChanged(); return true; } else if (event->type() == QEvent::ParentChange) { // Tell ancestor move monitor to update ancestor list for this widget @@ -180,14 +202,66 @@ bool MMF::VideoOutput::event(QEvent* event) //----------------------------------------------------------------------------- +// Public functions +//----------------------------------------------------------------------------- + +RWindowBase* MMF::VideoOutput::videoWindow() +{ + CCoeControl *control = internalWinId(); + if(!control) + control = effectiveWinId(); + + RWindowBase *window = 0; + if(control) + window = control->DrawableWindow(); + + return window; +} + +const QRect& MMF::VideoOutput::videoWindowRect() const +{ + return m_videoWindowRect; +} + +Phonon::VideoWidget::AspectRatio MMF::VideoOutput::aspectRatio() const +{ + return m_aspectRatio; +} + +void MMF::VideoOutput::setAspectRatio + (Phonon::VideoWidget::AspectRatio aspectRatio) +{ + if(m_aspectRatio != aspectRatio) { + m_aspectRatio = aspectRatio; + emit aspectRatioChanged(); + } +} + +Phonon::VideoWidget::ScaleMode MMF::VideoOutput::scaleMode() const +{ + return m_scaleMode; +} + +void MMF::VideoOutput::setScaleMode + (Phonon::VideoWidget::ScaleMode scaleMode) +{ + if(m_scaleMode != scaleMode) { + m_scaleMode = scaleMode; + emit scaleModeChanged(); + } +} + + +//----------------------------------------------------------------------------- // Private functions //----------------------------------------------------------------------------- -void MMF::VideoOutput::videoOutputRegionChanged() +void MMF::VideoOutput::getVideoWindowRect() { - dump(); - if (m_observer) - m_observer->videoOutputRegionChanged(); + RWindowBase *const window = videoWindow(); + if(window) + m_videoWindowRect = + qt_TRect2QRect(TRect(window->AbsPosition(), window->Size())); } void MMF::VideoOutput::registerForAncestorMoved() @@ -199,15 +273,20 @@ void MMF::VideoOutput::dump() const { #ifndef QT_NO_DEBUG TRACE_CONTEXT(VideoOutput::dump, EVideoInternal); + QScopedPointer<ObjectDump::QVisitor> visitor(new ObjectDump::QVisitor); visitor->setPrefix("Phonon::MMF"); // to aid searchability of logs ObjectDump::addDefaultAnnotators(*visitor); TRACE("Dumping tree from leaf 0x%08x:", this); - //ObjectDump::dumpAncestors(*this, *visitor); ObjectDump::dumpTreeFromLeaf(*this, *visitor); + + QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper); + dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs + ObjectDump::addDefaultAnnotators(*dumper); + TRACE_0("Dumping VideoOutput:"); + dumper->dumpObject(*this); #endif } - QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h index db4d127..6dfe69d 100644 --- a/src/3rdparty/phonon/mmf/videooutput.h +++ b/src/3rdparty/phonon/mmf/videooutput.h @@ -24,6 +24,11 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include <QRect> #include "defs.h" +#include <Phonon/VideoWidget> + +#include <e32std.h> +class RWindowBase; + QT_BEGIN_NAMESPACE namespace Phonon @@ -31,7 +36,6 @@ namespace Phonon namespace MMF { class AncestorMoveMonitor; -class VideoOutputObserver; class VideoOutput : public QWidget { @@ -41,11 +45,29 @@ public: VideoOutput(AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent); ~VideoOutput(); - void setFrameSize(const QSize& size); - void setObserver(VideoOutputObserver* observer); + // Set size of video frame. Called by VideoPlayer. + void setVideoSize(const QSize& size); + + RWindowBase* videoWindow(); + const QRect& videoWindowRect() const; + Phonon::VideoWidget::AspectRatio aspectRatio() const; + void setAspectRatio(Phonon::VideoWidget::AspectRatio aspectRatio); + + Phonon::VideoWidget::ScaleMode scaleMode() const; + void setScaleMode(Phonon::VideoWidget::ScaleMode scaleMode); + + // Called by AncestorMoveMonitor void ancestorMoved(); + // Debugging output + void dump() const; + +Q_SIGNALS: + void videoWindowChanged(); + void aspectRatioChanged(); + void scaleModeChanged(); + protected: // Override QWidget functions QSize sizeHint() const; @@ -55,19 +77,18 @@ protected: bool event(QEvent* event); private: - void dump() const; - void videoOutputRegionChanged(); - + void getVideoWindowRect(); void registerForAncestorMoved(); private: // Not owned AncestorMoveMonitor* m_ancestorMoveMonitor; - // Not owned - VideoOutputObserver* m_observer; + QSize m_videoFrameSize; + QRect m_videoWindowRect; - QSize m_frameSize; + Phonon::VideoWidget::AspectRatio m_aspectRatio; + Phonon::VideoWidget::ScaleMode m_scaleMode; }; } diff --git a/src/3rdparty/phonon/mmf/videooutputobserver.h b/src/3rdparty/phonon/mmf/videooutputobserver.h deleted file mode 100644 index e3ba305..0000000 --- a/src/3rdparty/phonon/mmf/videooutputobserver.h +++ /dev/null @@ -1,44 +0,0 @@ -/* 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_MMF_VIDEOOUTPUTOBSERVER_H -#define PHONON_MMF_VIDEOOUTPUTOBSERVER_H - -#include <QtGlobal> - -QT_BEGIN_NAMESPACE - -namespace Phonon -{ -namespace MMF -{ -/** - * Interface via which VideoOutput notifies VideoPlayer of changes to the - * video output screen region. - */ -class VideoOutputObserver -{ -public: - virtual void videoOutputRegionChanged() = 0; -}; -} -} - -QT_END_NAMESPACE - -#endif diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index 7d7abf1..bd22307 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -35,11 +35,7 @@ using namespace Phonon::MMF; // Constants //----------------------------------------------------------------------------- -static const Phonon::VideoWidget::AspectRatio DefaultAspectRatio = - Phonon::VideoWidget::AspectRatioAuto; static const qreal DefaultBrightness = 1.0; -static const Phonon::VideoWidget::ScaleMode DefaultScaleMode = - Phonon::VideoWidget::FitInView; static const qreal DefaultContrast = 1.0; static const qreal DefaultHue = 1.0; static const qreal DefaultSaturation = 1.0; @@ -52,10 +48,8 @@ static const qreal DefaultSaturation = 1.0; MMF::VideoWidget::VideoWidget (AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent) : MediaNode(parent) - , m_widget(new VideoOutput(ancestorMoveMonitor, parent)) - , m_aspectRatio(DefaultAspectRatio) + , m_videoOutput(new VideoOutput(ancestorMoveMonitor, parent)) , m_brightness(DefaultBrightness) - , m_scaleMode(DefaultScaleMode) , m_contrast(DefaultContrast) , m_hue(DefaultHue) , m_saturation(DefaultSaturation) @@ -81,7 +75,7 @@ MMF::VideoWidget::~VideoWidget() Phonon::VideoWidget::AspectRatio MMF::VideoWidget::aspectRatio() const { - return m_aspectRatio; + return m_videoOutput->aspectRatio(); } void MMF::VideoWidget::setAspectRatio @@ -90,7 +84,7 @@ void MMF::VideoWidget::setAspectRatio TRACE_CONTEXT(VideoWidget::setAspectRatio, EVideoApi); TRACE("aspectRatio %d", aspectRatio); - m_aspectRatio = aspectRatio; + m_videoOutput->setAspectRatio(aspectRatio); } qreal MMF::VideoWidget::brightness() const @@ -108,7 +102,7 @@ void MMF::VideoWidget::setBrightness(qreal brightness) Phonon::VideoWidget::ScaleMode MMF::VideoWidget::scaleMode() const { - return m_scaleMode; + return m_videoOutput->scaleMode(); } void MMF::VideoWidget::setScaleMode(Phonon::VideoWidget::ScaleMode scaleMode) @@ -116,7 +110,7 @@ void MMF::VideoWidget::setScaleMode(Phonon::VideoWidget::ScaleMode scaleMode) TRACE_CONTEXT(VideoWidget::setScaleMode, EVideoApi); TRACE("setScaleMode %d", setScaleMode); - m_scaleMode = scaleMode; + m_videoOutput->setScaleMode(scaleMode); } qreal MMF::VideoWidget::contrast() const @@ -160,17 +154,12 @@ void MMF::VideoWidget::setSaturation(qreal saturation) QWidget* MMF::VideoWidget::widget() { - return m_widget.data(); -} - -VideoOutput& MMF::VideoWidget::videoOutput() -{ - return *static_cast<VideoOutput*>(widget()); + return m_videoOutput.data(); } bool MMF::VideoWidget::activateOnMediaObject(MediaObject *mo) { - mo->setVideoOutput(&videoOutput()); + mo->setVideoOutput(m_videoOutput.data()); return true; } diff --git a/src/3rdparty/phonon/mmf/videowidget.h b/src/3rdparty/phonon/mmf/videowidget.h index 318dfae..2f0978b 100644 --- a/src/3rdparty/phonon/mmf/videowidget.h +++ b/src/3rdparty/phonon/mmf/videowidget.h @@ -20,6 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #define PHONON_MMF_VIDEOWIDGET_H #include "mmf_medianode.h" +#include "videooutput.h" #include <QtGui/QWidget> #include <Phonon/VideoWidget> @@ -59,17 +60,13 @@ public: virtual void setSaturation(qreal saturation); virtual QWidget *widget(); - VideoOutput& videoOutput(); - protected: virtual bool activateOnMediaObject(MediaObject *mo); private: - QScopedPointer<QWidget> m_widget; + QScopedPointer<VideoOutput> m_videoOutput; - Phonon::VideoWidget::AspectRatio m_aspectRatio; qreal m_brightness; - Phonon::VideoWidget::ScaleMode m_scaleMode; qreal m_contrast; qreal m_hue; qreal m_saturation; diff --git a/src/3rdparty/phonon/mmf/volumeobserver.h b/src/3rdparty/phonon/mmf/volumeobserver.h deleted file mode 100644 index bedd3de..0000000 --- a/src/3rdparty/phonon/mmf/volumeobserver.h +++ /dev/null @@ -1,44 +0,0 @@ -/* 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_MMF_VOLUMEOBSERVER_H -#define PHONON_MMF_VOLUMEOBSERVER_H - -#include <QtGlobal> - -QT_BEGIN_NAMESPACE - -namespace Phonon -{ -namespace MMF -{ -/** - * Interface used by AudioOutput to pass volume control commands - * back along the audio path to the MediaObject. - */ -class VolumeObserver -{ -public: - virtual void volumeChanged(qreal volume) = 0; -}; -} -} - -QT_END_NAMESPACE - -#endif diff --git a/src/3rdparty/phonon/phonon/audiooutput.cpp b/src/3rdparty/phonon/phonon/audiooutput.cpp index 3d03dc4..0f6a49b 100644 --- a/src/3rdparty/phonon/phonon/audiooutput.cpp +++ b/src/3rdparty/phonon/phonon/audiooutput.cpp @@ -259,6 +259,7 @@ void AudioOutputPrivate::setupBackendObject() // set up attributes pINTERFACE_CALL(setVolume(pow(volume, VOLTAGE_TO_LOUDNESS_EXPONENT))); +#ifndef QT_NO_PHONON_SETTINGSGROUP // if the output device is not available and the device was not explicitly set if (!callSetOutputDevice(this, device) && !outputDeviceOverridden) { // fall back in the preference list of output devices @@ -278,6 +279,7 @@ void AudioOutputPrivate::setupBackendObject() callSetOutputDevice(this, none); handleAutomaticDeviceChange(none, FallbackChange); } +#endif //QT_NO_PHONON_SETTINGSGROUP } void AudioOutputPrivate::_k_volumeChanged(qreal newVolume) @@ -307,6 +309,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed() pDebug() << Q_FUNC_INFO; // outputDeviceIndex identifies a failing device // fall back in the preference list of output devices +#ifndef QT_NO_PHONON_SETTINGSGROUP const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings | GlobalConfig::HideUnavailableDevices); for (int i = 0; i < deviceList.count(); ++i) { const int devIndex = deviceList.at(i); @@ -319,6 +322,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed() } } } +#endif //QT_NO_PHONON_SETTINGSGROUP // if we get here there is no working output device. Tell the backend. const AudioOutputDevice none; callSetOutputDevice(this, none); @@ -328,6 +332,7 @@ void AudioOutputPrivate::_k_audioDeviceFailed() void AudioOutputPrivate::_k_deviceListChanged() { pDebug() << Q_FUNC_INFO; +#ifndef QT_NO_PHONON_SETTINGSGROUP // let's see if there's a usable device higher in the preference list const QList<int> deviceList = GlobalConfig().audioOutputDeviceListFor(category, GlobalConfig::AdvancedDevicesFromSettings); DeviceChangeType changeType = HigherPreferenceChange; @@ -353,6 +358,7 @@ void AudioOutputPrivate::_k_deviceListChanged() break; // found one with higher preference that works } } +#endif //QT_NO_PHONON_SETTINGSGROUP } static struct diff --git a/src/3rdparty/phonon/phonon/backendcapabilities.cpp b/src/3rdparty/phonon/phonon/backendcapabilities.cpp index 0bcc76c..fbeb020 100644 --- a/src/3rdparty/phonon/phonon/backendcapabilities.cpp +++ b/src/3rdparty/phonon/phonon/backendcapabilities.cpp @@ -75,10 +75,12 @@ bool BackendCapabilities::isMimeTypeAvailable(const QString &mimeType) QList<AudioOutputDevice> BackendCapabilities::availableAudioOutputDevices() { QList<AudioOutputDevice> ret; +#ifndef QT_NO_PHONON_SETTINGSGROUP const QList<int> deviceIndexes = GlobalConfig().audioOutputDeviceListFor(Phonon::NoCategory); for (int i = 0; i < deviceIndexes.count(); ++i) { ret.append(AudioOutputDevice::fromIndex(deviceIndexes.at(i))); } +#endif //QT_NO_PHONON_SETTINGSGROUP return ret; } diff --git a/src/3rdparty/phonon/phonon/factory.cpp b/src/3rdparty/phonon/phonon/factory.cpp index ab1f44f..9967c971 100644 --- a/src/3rdparty/phonon/phonon/factory.cpp +++ b/src/3rdparty/phonon/phonon/factory.cpp @@ -469,7 +469,7 @@ GET_STRING_PROPERTY(backendWebsite) QObject *Factory::registerQObject(QObject *o) { if (o) { - QObject::connect(o, SIGNAL(destroyed(QObject *)), globalFactory, SLOT(objectDestroyed(QObject *)), Qt::DirectConnection); + QObject::connect(o, SIGNAL(destroyed(QObject*)), globalFactory, SLOT(objectDestroyed(QObject*)), Qt::DirectConnection); globalFactory->objects.append(o); } return o; diff --git a/src/3rdparty/phonon/phonon/globalconfig.cpp b/src/3rdparty/phonon/phonon/globalconfig.cpp index 6e6263a..3b77a18 100644 --- a/src/3rdparty/phonon/phonon/globalconfig.cpp +++ b/src/3rdparty/phonon/phonon/globalconfig.cpp @@ -178,13 +178,15 @@ QList<int> GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int return listSortedByConfig(backendConfig, category, defaultList); } -#endif //QT_NO_SETTINGSGROUPS +#endif //QT_NO_PHONON_SETTINGSGROUP int GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override) const { +#ifndef QT_NO_PHONON_SETTINGSGROUP QList<int> ret = audioOutputDeviceListFor(category, override); - if (ret.isEmpty()) - return -1; - return ret.first(); + if (!ret.isEmpty()) + return ret.first(); +#endif //QT_NO_PHONON_SETTINGSGROUP + return -1; } #ifndef QT_NO_PHONON_AUDIOCAPTURE diff --git a/src/3rdparty/phonon/phonon/mediaobject.cpp b/src/3rdparty/phonon/phonon/mediaobject.cpp index 13d303c..41e8dc2 100644 --- a/src/3rdparty/phonon/phonon/mediaobject.cpp +++ b/src/3rdparty/phonon/phonon/mediaobject.cpp @@ -453,9 +453,9 @@ void MediaObjectPrivate::setupBackendObject() //pDebug() << Q_FUNC_INFO; #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM - QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SLOT(_k_stateChanged(Phonon::State, Phonon::State))); + QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), q, SLOT(_k_stateChanged(Phonon::State,Phonon::State))); #else - QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), q, SIGNAL(stateChanged(Phonon::State, Phonon::State))); + QObject::connect(m_backendObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), q, SIGNAL(stateChanged(Phonon::State,Phonon::State))); #endif // QT_NO_PHONON_ABSTRACTMEDIASTREAM QObject::connect(m_backendObject, SIGNAL(tick(qint64)), q, SIGNAL(tick(qint64))); QObject::connect(m_backendObject, SIGNAL(seekableChanged(bool)), q, SIGNAL(seekableChanged(bool))); @@ -467,10 +467,10 @@ void MediaObjectPrivate::setupBackendObject() QObject::connect(m_backendObject, SIGNAL(aboutToFinish()), q, SLOT(_k_aboutToFinish())); QObject::connect(m_backendObject, SIGNAL(prefinishMarkReached(qint32)), q, SIGNAL(prefinishMarkReached(qint32))); QObject::connect(m_backendObject, SIGNAL(totalTimeChanged(qint64)), q, SIGNAL(totalTimeChanged(qint64))); - QObject::connect(m_backendObject, SIGNAL(metaDataChanged(const QMultiMap<QString, QString> &)), - q, SLOT(_k_metaDataChanged(const QMultiMap<QString, QString> &))); - QObject::connect(m_backendObject, SIGNAL(currentSourceChanged(const MediaSource&)), - q, SLOT(_k_currentSourceChanged(const MediaSource&))); + QObject::connect(m_backendObject, SIGNAL(metaDataChanged(QMultiMap<QString,QString>)), + q, SLOT(_k_metaDataChanged(QMultiMap<QString,QString>))); + QObject::connect(m_backendObject, SIGNAL(currentSourceChanged(MediaSource)), + q, SLOT(_k_currentSourceChanged(MediaSource))); // set up attributes pINTERFACE_CALL(setTickInterval(tickInterval)); diff --git a/src/3rdparty/phonon/phonon/seekslider.cpp b/src/3rdparty/phonon/phonon/seekslider.cpp index b5b25f0..41baf2d 100644 --- a/src/3rdparty/phonon/phonon/seekslider.cpp +++ b/src/3rdparty/phonon/phonon/seekslider.cpp @@ -72,12 +72,12 @@ void SeekSlider::setMediaObject(MediaObject *media) d->media = media; if (media) { - connect(media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), + connect(media, SIGNAL(stateChanged(Phonon::State,Phonon::State)), SLOT(_k_stateChanged(Phonon::State))); connect(media, SIGNAL(totalTimeChanged(qint64)), SLOT(_k_length(qint64))); connect(media, SIGNAL(tick(qint64)), SLOT(_k_tick(qint64))); connect(media, SIGNAL(seekableChanged(bool)), SLOT(_k_seekableChanged(bool))); - connect(media, SIGNAL(currentSourceChanged(const Phonon::MediaSource&)), SLOT(_k_currentSourceChanged())); + connect(media, SIGNAL(currentSourceChanged(Phonon::MediaSource)), SLOT(_k_currentSourceChanged())); d->_k_stateChanged(media->state()); d->_k_seekableChanged(media->isSeekable()); d->_k_length(media->totalTime()); diff --git a/src/3rdparty/phonon/waveout/mediaobject.cpp b/src/3rdparty/phonon/waveout/mediaobject.cpp index 35d9e0b..db71942 100644 --- a/src/3rdparty/phonon/waveout/mediaobject.cpp +++ b/src/3rdparty/phonon/waveout/mediaobject.cpp @@ -247,7 +247,7 @@ namespace Phonon m_stopped(0) { m_thread = new WorkerThread(); - connect(this, SIGNAL(outOfData(QIODevice*, QByteArray*, bool*)), m_thread, SLOT(stream(QIODevice*, QByteArray*, bool*))); + connect(this, SIGNAL(outOfData(QIODevice*,QByteArray*,bool*)), m_thread, SLOT(stream(QIODevice*,QByteArray*,bool*))); m_thread->start(); m_soundBuffer1.waveHeader = new WAVEHDR; m_soundBuffer2.waveHeader = new WAVEHDR; @@ -258,7 +258,7 @@ namespace Phonon MediaObject::~MediaObject() { stop(); - disconnect(this, SIGNAL(outOfData(QIODevice*, QByteArray*, bool*)), m_thread, SLOT(stream(QIODevice*, QByteArray*, bool*))); + disconnect(this, SIGNAL(outOfData(QIODevice*,QByteArray*,bool*)), m_thread, SLOT(stream(QIODevice*,QByteArray*,bool*))); do { //The event loop of m_thread might not be started, yet m_thread->quit(); //If the event loop is not started yet quit() does nothing m_thread->wait(100); |