From 95a4f173b9ad6aa3b0009d4431bcc31e991a54d1 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 26 Aug 2009 12:03:48 +0100 Subject: Removed over-riding signal declaration from VideoPlayer. This was causing the stateChanged signal not to propagate up to the Phonon client. In the case of the mediaplayer demo, this causes the app not to show() the ancestor of the VideoWidget, resulting in the layout not being updated when the clip has been loaded. This means that the hack to explicitly call show() on this ancestor from the backend has been removed. Now the layout is correctly updated, but the size of VideoOutput::winId()->Rect() is still incorrect, so the hack to hard-code the screen rectangle passed to CVideoPlayerUtility is left in place. --- src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 2 +- src/3rdparty/phonon/mmf/defs.h | 4 ---- src/3rdparty/phonon/mmf/mediaobject.cpp | 12 ++++++------ src/3rdparty/phonon/mmf/videoplayer.cpp | 13 ------------- src/3rdparty/phonon/mmf/videoplayer.h | 2 -- 5 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 114ba13..7849d87 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -425,7 +425,7 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState) and m_playPending ) { - TRACE_0("Play was called while loading; starting playback now"); + TRACE_0("play was called while loading; starting playback now"); m_playPending = false; play(); } diff --git a/src/3rdparty/phonon/mmf/defs.h b/src/3rdparty/phonon/mmf/defs.h index 0a9a683..be8401d 100644 --- a/src/3rdparty/phonon/mmf/defs.h +++ b/src/3rdparty/phonon/mmf/defs.h @@ -34,10 +34,6 @@ along with this library. If not, see . // rect, i.e. QWidget::winId()->Rect() #define PHONON_MMF_HARD_CODE_VIDEO_RECT -// If this is defined, show() is called on the grandparent of the widget -// on which video will be rendered. -#define PHONON_MMF_EXPLICITLY_SHOW_VIDEO_WIDGET - namespace Phonon { namespace MMF diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 396f658..04b7dc7 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -322,12 +322,7 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) } m_player.reset(newPlayer); - - 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(finished()), SIGNAL(finished())); - connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); - + if(oldPlayerHasVideo != hasVideo()) { emit hasVideoChanged(hasVideo()); @@ -338,6 +333,11 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) emit seekableChanged(isSeekable()); } + 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(finished()), SIGNAL(finished())); + connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64))); + TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp index 419c83c..75db551 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer.cpp @@ -231,19 +231,6 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError) // Debugging video visibility videoOutput().dump(); - -#ifdef PHONON_MMF_EXPLICITLY_SHOW_VIDEO_WIDGET - // HACK: why do we need to explicitly show() the grandparent...? - QWidget* grandparent = static_cast(videoOutput().parent()->parent()); - TRACE("Calling grandparent[0x%08x]->show()", grandparent); - grandparent->show(); - TRACE_0("Calling videoOutput().updateGeometry()"); - videoOutput().updateGeometry(); - TRACE_0("Calling videoOutput().update()"); - videoOutput().update(); -#endif - - videoOutput().dump(); videoOutputChanged(); diff --git a/src/3rdparty/phonon/mmf/videoplayer.h b/src/3rdparty/phonon/mmf/videoplayer.h index bacec0b..5d6baa4 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.h +++ b/src/3rdparty/phonon/mmf/videoplayer.h @@ -69,8 +69,6 @@ namespace Phonon Q_SIGNALS: void totalTimeChanged(qint64 length); - void stateChanged(Phonon::State oldState, - Phonon::State newState); void finished(); private: -- cgit v0.12