summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/phonon')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp30
-rw-r--r--src/3rdparty/phonon/mmf/abstractplayer.h6
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.cpp26
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.h13
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp13
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h5
-rw-r--r--src/3rdparty/phonon/mmf/backend.cpp18
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/mmf_medianode.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp271
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.h19
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp144
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h30
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp114
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h10
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp20
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h40
-rw-r--r--src/3rdparty/phonon/mmf/utils.cpp8
-rw-r--r--src/3rdparty/phonon/mmf/utils.h18
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.cpp58
-rw-r--r--src/3rdparty/phonon/mmf/videooutput.h4
-rw-r--r--src/3rdparty/phonon/phonon/objectdescriptionmodel.h23
22 files changed, 489 insertions, 385 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index 2fdb092..af2c31e 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -376,20 +376,20 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState)
setState(newState);
if (
- LoadingState == oldPhononState
- and StoppedState == newPhononState
- ) {
- // Ensure initial volume is set on MMF API before starting playback
- doVolumeChanged();
-
- // Check whether play() was called while clip was being loaded. If so,
- // playback should be started now
- if (m_playPending) {
- TRACE_0("play was called while loading; starting playback now");
- m_playPending = false;
- play();
- }
- }
+ LoadingState == oldPhononState
+ and StoppedState == newPhononState
+ ) {
+ // Ensure initial volume is set on MMF API before starting playback
+ doVolumeChanged();
+
+ // Check whether play() was called while clip was being loaded. If so,
+ // playback should be started now
+ if (m_playPending) {
+ TRACE_0("play was called while loading; starting playback now");
+ m_playPending = false;
+ play();
+ }
+ }
TRACE_EXIT_0();
}
@@ -400,7 +400,7 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState)
void MMF::AbstractMediaPlayer::tick()
{
- // For the MWC compiler, we need to qualify the base class.
+ // For the MWC compiler, we need to qualify the base class.
emit MMF::AbstractPlayer::tick(currentTime());
}
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h
index ec39ab1..08558cf 100644
--- a/src/3rdparty/phonon/mmf/abstractplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractplayer.h
@@ -87,7 +87,7 @@ public:
// VolumeObserver
virtual void volumeChanged(qreal volume);
-
+
void setVideoOutput(VideoOutput* videoOutput);
/**
@@ -146,9 +146,9 @@ private:
protected:
// Not owned
VideoOutput* m_videoOutput;
-
+
qreal m_volume;
-
+
private:
PrivateState m_state;
Phonon::ErrorType m_error;
diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp
index 58e2f5e..5a00f60 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.cpp
+++ b/src/3rdparty/phonon/mmf/audiooutput.cpp
@@ -18,6 +18,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <e32debug.h>
+#include <QCoreApplication>
+
#include "audiooutput.h"
#include "defs.h"
#include "mediaobject.h"
@@ -74,16 +76,13 @@ void MMF::AudioOutput::setVolume(qreal volume)
int MMF::AudioOutput::outputDevice() const
{
- return 0;
-}
-
-bool MMF::AudioOutput::setOutputDevice(int)
-{
- return true;
+ return AudioOutputDeviceID;
}
-bool MMF::AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice &)
+bool MMF::AudioOutput::setOutputDevice(int index)
{
+ Q_ASSERT_X(index == AudioOutputDeviceID, Q_FUNC_INFO,
+ "We only support one output device, with id 0");
return true;
}
@@ -101,4 +100,17 @@ bool MMF::AudioOutput::activateOnMediaObject(MediaObject *mo)
return true;
}
+QHash<QByteArray, QVariant> MMF::AudioOutput::audioOutputDescription(int index)
+{
+ if (index == AudioOutputDeviceID) {
+ QHash<QByteArray, QVariant> retval;
+
+ retval.insert("name", QCoreApplication::translate("Phonon::MMF", "Audio Output"));
+ retval.insert("description", QCoreApplication::translate("Phonon::MMF", "The audio output device"));
+ retval.insert("available", true);
+
+ return retval;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/audiooutput.h b/src/3rdparty/phonon/mmf/audiooutput.h
index 0a962a9..d0ba086 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.h
+++ b/src/3rdparty/phonon/mmf/audiooutput.h
@@ -19,6 +19,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#ifndef PHONON_MMF_AUDIOOUTPUT_H
#define PHONON_MMF_AUDIOOUTPUT_H
+#include <QHash>
+
#include "mmf_medianode.h"
#include <phonon/audiooutputinterface.h>
@@ -65,10 +67,12 @@ public:
*/
virtual bool setOutputDevice(int);
- /**
- * Has no effect.
- */
- virtual bool setOutputDevice(const Phonon::AudioOutputDevice &);
+ static QHash<QByteArray, QVariant> audioOutputDescription(int index);
+
+ enum Constants
+ {
+ AudioOutputDeviceID = 0
+ };
protected:
virtual bool activateOnMediaObject(MediaObject *mo);
@@ -78,6 +82,7 @@ Q_SIGNALS:
void audioDeviceFailed();
private:
+
void setVolumeObserver(VolumeObserver* observer);
qreal m_volume;
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index 6c1fc68..1d259a8 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -34,14 +34,13 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::AudioPlayer::AudioPlayer() : m_player(0)
+MMF::AudioPlayer::AudioPlayer()
{
construct();
}
MMF::AudioPlayer::AudioPlayer(const AbstractPlayer& player)
: AbstractMediaPlayer(player)
- , m_player(0)
{
construct();
}
@@ -51,7 +50,7 @@ void MMF::AudioPlayer::construct()
TRACE_CONTEXT(AudioPlayer::AudioPlayer, EAudioApi);
TRACE_ENTRY_0();
- TRAPD(err, m_player = CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone));
+ TRAPD(err, m_player.reset(CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone)));
if (KErrNone != err) {
changeState(ErrorState);
}
@@ -64,8 +63,6 @@ MMF::AudioPlayer::~AudioPlayer()
TRACE_CONTEXT(AudioPlayer::~AudioPlayer, EAudioApi);
TRACE_ENTRY_0();
- delete m_player;
-
TRACE_EXIT_0();
}
@@ -216,8 +213,8 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError)
}
/*
- if(aError == KErrNone) {
- if(m_nextSource.type() == MediaSource::Empty) {
+ if (aError == KErrNone) {
+ if (m_nextSource.type() == MediaSource::Empty) {
emit finished();
} else {
setSource(m_nextSource);
@@ -237,7 +234,7 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError)
CPlayerType *MMF::AudioPlayer::player() const
{
- return m_player;
+ return m_player.data();
}
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index f16de1d..60ef436 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -86,6 +86,9 @@ public:
virtual void MapcPlayComplete(TInt aError);
#endif
+ /**
+ * This class owns the pointer.
+ */
CPlayerType *player() const;
private:
@@ -96,7 +99,7 @@ private:
* Using CPlayerType typedef in order to be able to easily switch between
* CMdaAudioPlayerUtility and CDrmPlayerUtility
*/
- CPlayerType* m_player;
+ QScopedPointer<CPlayerType> m_player;
};
}
}
diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp
index be43f46..f542ec9 100644
--- a/src/3rdparty/phonon/mmf/backend.cpp
+++ b/src/3rdparty/phonon/mmf/backend.cpp
@@ -107,6 +107,12 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
{
case EffectType:
retval.append(EffectFactory::effectIndexes());
+ break;
+ case AudioOutputDeviceType:
+ // We only have one possible output device, but we need at least
+ // one.
+ retval.append(AudioOutput::AudioOutputDeviceID);
+ break;
default:
;
}
@@ -119,10 +125,14 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
{
TRACE_CONTEXT(Backend::connectNodes, EBackend);
- if (type == EffectType)
- return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
- else
- return QHash<QByteArray, QVariant>();
+ switch (type) {
+ case EffectType:
+ return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
+ case AudioOutputDeviceType:
+ return AudioOutput::audioOutputDescription(index);
+ default:
+ return QHash<QByteArray, QVariant>();
+ }
}
bool Backend::startConnectionChange(QSet<QObject *>)
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index 76db5cb..29ac2df 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -112,7 +112,7 @@ MMF::MediaType MMF::MediaObject::fileMediaType
MediaType result = MediaTypeUnknown;
if (openRecognizer()) {
-
+
const QHBufC fileNameSymbian(QDir::toNativeSeparators(fileName));
m_file.Close();
diff --git a/src/3rdparty/phonon/mmf/mmf_medianode.cpp b/src/3rdparty/phonon/mmf/mmf_medianode.cpp
index b60d6f4..253c5e7 100644
--- a/src/3rdparty/phonon/mmf/mmf_medianode.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_medianode.cpp
@@ -74,7 +74,7 @@ bool MMF::MediaNode::applyNodesOnMediaObject(MediaNode *)
// data(length of the graph) which typically is very small.
// First, we go to the very beginning of the graph.
- MMF::MediaNode *current = this;
+ MMF::MediaNode *current = this;
do {
MediaNode *const candidate = current->source();
if (candidate)
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index c7fa791..a93aca0 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -16,7 +16,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <QApplication> // for QApplication::activeWindow
+#include <QApplication> // for QApplication::activeWindow
#include <QUrl>
#include <QTimer>
#include <QWidget>
@@ -27,7 +27,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "mmf_videoplayer.h"
#include "utils.h"
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#include "objectdump.h"
#endif
@@ -45,8 +45,8 @@ using namespace Phonon::MMF;
//-----------------------------------------------------------------------------
MMF::VideoPlayer::VideoPlayer()
- : m_wsSession(0)
- , m_screenDevice(0)
+ : m_wsSession(CCoeEnv::Static()->WsSession())
+ , m_screenDevice(*CCoeEnv::Static()->ScreenDevice())
, m_window(0)
, m_totalTime(0)
, m_mmfOutputChangePending(false)
@@ -56,8 +56,8 @@ MMF::VideoPlayer::VideoPlayer()
MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player)
: AbstractMediaPlayer(player)
- , m_wsSession(0)
- , m_screenDevice(0)
+ , m_wsSession(CCoeEnv::Static()->WsSession())
+ , m_screenDevice(*CCoeEnv::Static()->ScreenDevice())
, m_window(0)
, m_totalTime(0)
, m_mmfOutputChangePending(false)
@@ -70,37 +70,37 @@ void MMF::VideoPlayer::construct()
TRACE_CONTEXT(VideoPlayer::VideoPlayer, EVideoApi);
TRACE_ENTRY_0();
- if(m_videoOutput)
- m_videoOutput->setObserver(this);
+ if (m_videoOutput)
+ m_videoOutput->setObserver(this);
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
+
+ // 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
- (
- *this,
- priority, preference,
- *m_wsSession, *m_screenDevice,
- *m_window,
- m_windowRect, m_clipRect
- ))
- );
- if (KErrNone != err) {
+ TRAPD(err,
+ m_player.reset(CVideoPlayerUtility::NewL
+ (
+ *this,
+ priority, preference,
+ m_wsSession, m_screenDevice,
+ *m_window,
+ m_rect, m_rect
+ ))
+ );
+
+ if (KErrNone != err)
changeState(ErrorState);
- }
TRACE_EXIT_0();
}
@@ -120,13 +120,13 @@ MMF::VideoPlayer::~VideoPlayer()
void MMF::VideoPlayer::doPlay()
{
TRACE_CONTEXT(VideoPlayer::doPlay, EVideoApi);
-
+
// See comment in updateMmfOutput
- if(m_mmfOutputChangePending) {
+ if (m_mmfOutputChangePending) {
TRACE_0("MMF output change pending - pushing now");
updateMmfOutput();
}
-
+
m_player->Play();
}
@@ -149,20 +149,20 @@ void MMF::VideoPlayer::doStop()
void MMF::VideoPlayer::doSeek(qint64 ms)
{
TRACE_CONTEXT(VideoPlayer::doSeek, EVideoApi);
-
+
bool wasPlaying = false;
- if(state() == PlayingState) {
- // The call to SetPositionL does not have any effect if playback is
- // ongoing, so we pause before seeking.
- doPause();
- wasPlaying = true;
+ if (state() == PlayingState) {
+ // The call to SetPositionL does not have any effect if playback is
+ // ongoing, so we pause before seeking.
+ doPause();
+ wasPlaying = true;
}
TRAPD(err, m_player->SetPositionL(TTimeIntervalMicroSeconds(ms * 1000)));
- if(KErrNone == err) {
- if(wasPlaying)
- doPlay();
+ if (KErrNone == err) {
+ if (wasPlaying)
+ doPlay();
}
else {
TRACE("SetPositionL error %d", err);
@@ -251,15 +251,15 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError)
if (KErrNone == err) {
maxVolumeChanged(m_player->MaxVolume());
- if(m_videoOutput)
- m_videoOutput->setFrameSize(m_frameSize);
+ if (m_videoOutput)
+ m_videoOutput->setFrameSize(m_frameSize);
// See comment in updateMmfOutput
- if(m_mmfOutputChangePending) {
+ if (m_mmfOutputChangePending) {
TRACE_0("MMF output change pending - pushing now");
updateMmfOutput();
- }
-
+ }
+
emit totalTimeChanged(totalTime());
changeState(StoppedState);
} else {
@@ -327,82 +327,91 @@ void MMF::VideoPlayer::videoOutputRegionChanged()
TRACE_CONTEXT(VideoPlayer::videoOutputRegionChanged, EVideoInternal);
TRACE_ENTRY("state %d", state());
- getNativeWindowSystemHandles();
+ const bool changed = getNativeWindowSystemHandles();
// See comment in updateMmfOutput
- if(state() == LoadingState)
- m_mmfOutputChangePending = true;
- else
- updateMmfOutput();
-
+ if (changed) {
+ if (state() == LoadingState)
+ m_mmfOutputChangePending = true;
+ else
+ updateMmfOutput();
+ }
+
TRACE_EXIT_0();
}
-// DEBUGGING *** DO NOT INTEGRATE ***
+
+#ifndef QT_NO_DEBUG
+
+// The following code is for debugging problems related to video visibility. It allows
+// the VideoPlayer instance to query the window server in order to determine the
+// DSA drawing region for the video window.
+
class CDummyAO : public CActive
{
public:
- CDummyAO() : CActive(CActive::EPriorityStandard) { CActiveScheduler::Add(this); }
- void RunL() { }
- void DoCancel() { }
- TRequestStatus& Status() { return iStatus; }
- void SetActive() { CActive::SetActive(); }
+ CDummyAO() : CActive(CActive::EPriorityStandard) { CActiveScheduler::Add(this); }
+ void RunL() { }
+ void DoCancel() { }
+ TRequestStatus& Status() { return iStatus; }
+ void SetActive() { CActive::SetActive(); }
};
-// DEBUGGING *** DO NOT INTEGRATE ***
void getDsaRegion(RWsSession &session, const RWindowBase &window)
{
- RDirectScreenAccess dsa(session);
- TInt err = dsa.Construct();
- CDummyAO ao;
- RRegion* region;
- err = dsa.Request(region, ao.Status(), window);
- ao.SetActive();
- dsa.Close();
- ao.Cancel();
- if(region) {
- qDebug() << "Phonon::MMF::getDsaRegion count" << region->Count();
- for(int i=0; i<region->Count(); ++i) {
- const TRect& rect = region->RectangleList()[i];
- qDebug() << "Phonon::MMF::getDsaRegion rect" << rect.iTl.iX << rect.iTl.iY << rect.iBr.iX << rect.iBr.iY;
- }
- region->Close();
- }
+ RDirectScreenAccess dsa(session);
+ TInt err = dsa.Construct();
+ CDummyAO ao;
+ RRegion* region;
+ err = dsa.Request(region, ao.Status(), window);
+ ao.SetActive();
+ dsa.Close();
+ ao.Cancel();
+ if (region) {
+ qDebug() << "Phonon::MMF::getDsaRegion count" << region->Count();
+ for (int i=0; i<region->Count(); ++i) {
+ const TRect& rect = region->RectangleList()[i];
+ qDebug() << "Phonon::MMF::getDsaRegion rect"
+ << rect.iTl.iX << rect.iTl.iY << rect.iBr.iX << rect.iBr.iY;
+ }
+ region->Close();
+ }
}
+#endif // _DEBUG
+
void MMF::VideoPlayer::updateMmfOutput()
{
TRACE_CONTEXT(VideoPlayer::updateMmfOutput, EVideoInternal);
TRACE_ENTRY_0();
-
- // Calling SetDisplayWindowL is a no-op unless the MMF controller has
+
+ // 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
+ // need to call SetDisplayWindowL, and this is checked in
// MvpuoPrepareComplete, at which point the MMF controller has been
// loaded.
-
- getNativeWindowSystemHandles();
-
-// DEBUGGING *** DO NOT INTEGRATE ***
-getDsaRegion(*m_wsSession, *m_window);
+
+#ifndef QT_NO_DEBUG
+ getDsaRegion(m_wsSession, *m_window);
+#endif
TRAPD(err,
- m_player->SetDisplayWindowL
- (
- *m_wsSession, *m_screenDevice,
- *m_window,
- m_windowRect, m_clipRect
- )
- );
+ m_player->SetDisplayWindowL
+ (
+ m_wsSession, m_screenDevice,
+ *m_window,
+ m_rect, m_rect
+ )
+ );
if (KErrNone != err) {
TRACE("SetDisplayWindowL error %d", err);
setError(NormalError);
}
-
+
m_mmfOutputChangePending = false;
-
+
TRACE_EXIT_0();
}
@@ -416,9 +425,9 @@ void MMF::VideoPlayer::videoOutputChanged()
TRACE_CONTEXT(VideoPlayer::videoOutputChanged, EVideoInternal);
TRACE_ENTRY_0();
- if(m_videoOutput) {
- m_videoOutput->setObserver(this);
- m_videoOutput->setFrameSize(m_frameSize);
+ if (m_videoOutput) {
+ m_videoOutput->setObserver(this);
+ m_videoOutput->setFrameSize(m_frameSize);
}
videoOutputRegionChanged();
@@ -426,58 +435,56 @@ void MMF::VideoPlayer::videoOutputChanged()
TRACE_EXIT_0();
}
-void MMF::VideoPlayer::getNativeWindowSystemHandles()
+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();
+
+ if (m_videoOutput)
+ // Create native window
+ control = m_videoOutput->winId();
else
- // Get top-level window
- control = QApplication::activeWindow()->effectiveWinId();
-
- CCoeEnv* const coeEnv = control->ControlEnv();
- m_wsSession = &(coeEnv->WsSession());
- m_screenDevice = coeEnv->ScreenDevice();
- m_window = control->DrawableWindow();
-
-#ifdef _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);
+ // 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());
+ 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
- m_windowRect = TRect(
- control->DrawableWindow()->AbsPosition(),
- control->DrawableWindow()->Size());
- m_clipRect = m_windowRect;
-
- TRACE("windowRect %d %d - %d %d",
- m_windowRect.iTl.iX, m_windowRect.iTl.iY,
- m_windowRect.iBr.iX, m_windowRect.iBr.iY);
- TRACE("clipRect %d %d - %d %d",
- m_clipRect.iTl.iX, m_clipRect.iTl.iY,
- m_clipRect.iBr.iX, m_clipRect.iBr.iY);
-
- TRACE_EXIT_0();
+ 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);
}
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
index ee3650a..8072404 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
@@ -80,25 +80,26 @@ private:
// AbstractPlayer
virtual void videoOutputChanged();
-
- void getNativeWindowSystemHandles();
+
+ // Returns true if handles have changed
+ bool getNativeWindowSystemHandles();
+
void updateMmfOutput();
-
+
private:
QScopedPointer<CVideoPlayerUtility> m_player;
// Not owned
- RWsSession* m_wsSession;
- CWsScreenDevice* m_screenDevice;
+ RWsSession& m_wsSession;
+ CWsScreenDevice& m_screenDevice;
RWindowBase* m_window;
- TRect m_windowRect;
- TRect m_clipRect;
-
+ TRect m_rect;
+
QSize m_frameSize;
qint64 m_totalTime;
bool m_mmfOutputChangePending;
-
+
};
}
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp
index ef2b81c..9add439 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.cpp
@@ -36,7 +36,7 @@ namespace ObjectDump
QAnnotator::~QAnnotator()
{
-
+
}
@@ -45,53 +45,53 @@ QAnnotator::~QAnnotator()
//-----------------------------------------------------------------------------
QList<QByteArray> QAnnotatorBasic::annotation(const QObject& object)
-{
+{
QList<QByteArray> result;
-
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << '[' << &object << ']';
stream << ' ';
stream << object.metaObject()->className();
-
- if(object.objectName() != "")
+
+ if (object.objectName() != "")
stream << " \"" << object.objectName() << '"';
-
- if(object.isWidgetType())
+
+ if (object.isWidgetType())
stream << " isWidget";
-
+
stream.flush();
result.append(array);
return result;
}
QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object)
-{
+{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
- if(widget) {
-
+ if (widget) {
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "widget: ";
-
- if(widget->isVisible())
+
+ if (widget->isVisible())
stream << "visible ";
else
stream << "invisible ";
-
+
stream << widget->x() << ',' << widget->y() << ' ';
stream << widget->size().width() << 'x'<< widget->size().height() << ' ';
-
+
stream << "hint " << widget->sizeHint().width() << 'x' << widget->sizeHint().height();
-
+
stream.flush();
result.append(array);
}
-
+
return result;
}
@@ -105,12 +105,12 @@ class QDumperBase
public:
QDumperBase();
~QDumperBase();
-
+
void setPrefix(const QString& prefix);
void addAnnotator(QAnnotator* annotator);
-
+
protected:
- QByteArray m_prefix;
+ QByteArray m_prefix;
QList<QAnnotator*> m_annotators;
};
@@ -139,7 +139,7 @@ void QDumperBase::addAnnotator(QAnnotator* annotator)
// Protect against an exception occurring during QList::append
QScopedPointer<QAnnotator> holder(annotator);
m_annotators.append(annotator);
- holder.take();
+ holder.take();
}
@@ -148,13 +148,13 @@ void QDumperBase::addAnnotator(QAnnotator* annotator)
//-----------------------------------------------------------------------------
class QDumperPrivate : public QDumperBase
-{
+{
public:
QDumperPrivate();
~QDumperPrivate();
void dumpObject(const QObject& object);
-
+
};
@@ -206,27 +206,27 @@ void QDumper::addAnnotator(QAnnotator* annotator)
}
void QDumper::dumpObject(const QObject& object)
-{
+{
d_func()->dumpObject(object);
}
-
+
//-----------------------------------------------------------------------------
// QVisitor
//-----------------------------------------------------------------------------
class QVisitorPrivate : public QDumperBase
-{
+{
public:
QVisitorPrivate();
~QVisitorPrivate();
-
+
void setIndent(unsigned indent);
-
+
void visitNode(const QObject& object);
void visitComplete();
-private:
+private:
class Node
{
public:
@@ -235,24 +235,24 @@ private:
QList<QByteArray> m_annotation;
QList<Node*> m_children;
-
+
typedef QList<Node*>::const_iterator child_iterator;
};
-
+
private:
Node* findNode(const QObject* object) const;
QByteArray branchBuffer(const QList<bool>& branches, bool isNodeLine, bool isLastChild) const;
void dumpRecursive(const Node& node, QList<bool> branches, bool isLastChild);
void dumpNode(const Node& node, const QList<bool>& branches, bool isLastChild);
-
+
private:
unsigned m_indent;
-
+
QScopedPointer<Node> m_root;
-
+
// Hash table used to associate internal nodes with QObjects
typedef QHash<const QObject*, Node*> Hash;
- Hash m_hash;
+ Hash m_hash;
};
static const unsigned DefaultIndent = 2;
@@ -274,21 +274,21 @@ void QVisitorPrivate::setIndent(unsigned indent)
}
// Builds up a mirror of the object tree, rooted in m_root, with each node
-// storing annotations generated by
+// storing annotations generated by
void QVisitorPrivate::visitNode(const QObject& object)
-{
+{
QObject* const objectParent = object.parent();
Node* const nodeParent = objectParent ? findNode(objectParent) : 0;
// Create a new node and store in scoped pointer for exception safety
Node* node = new Node;
QScopedPointer<Node> nodePtr(node);
-
+
// Associate node with QObject
m_hash.insert(&object, node);
-
+
// Insert node into internal tree
- if(nodeParent)
+ if (nodeParent)
{
nodeParent->m_children.append(nodePtr.take());
}
@@ -297,7 +297,7 @@ void QVisitorPrivate::visitNode(const QObject& object)
Q_ASSERT(m_root.isNull());
m_root.reset(nodePtr.take());
}
-
+
// Generate and store annotations
QAnnotator* annotator;
foreach(annotator, m_annotators)
@@ -322,71 +322,71 @@ QByteArray QVisitorPrivate::branchBuffer
(const QList<bool>& branches, bool isNodeLine, bool isLastChild) const
{
const int depth = branches.count();
-
+
const QByteArray indent(m_indent, ' ');
const QByteArray horiz(m_indent, '-');
QByteArray buffer;
QTextStream stream(&buffer);
-
+
for (int i=0; i<depth-1; ++i) {
- if(branches[i])
+ if (branches[i])
stream << '|';
else
stream << ' ';
stream << indent;
}
-
- if(depth) {
- if(isNodeLine)
+
+ if (depth) {
+ if (isNodeLine)
stream << '+' << horiz;
else {
- if(!isLastChild)
+ if (!isLastChild)
stream << '|';
else
stream << ' ';
stream << indent;
}
}
-
+
stream.flush();
buffer.push_front(m_prefix);
-
+
return buffer;
}
void QVisitorPrivate::dumpRecursive
(const Node& node, QList<bool> branches, bool isLastChild)
-{
+{
dumpNode(node, branches, isLastChild);
-
+
// Recurse down tree
const Node::child_iterator begin = node.m_children.begin();
const Node::child_iterator end = node.m_children.end();
- for(Node::child_iterator i = begin; end != i; ++i) {
-
+ for (Node::child_iterator i = begin; end != i; ++i) {
+
isLastChild = (end == i + 1);
-
- if(begin == i)
+
+ if (begin == i)
branches.push_back(!isLastChild);
else
branches.back() = !isLastChild;
-
+
static const bool isNodeLine = false;
const QByteArray buffer = branchBuffer(branches, isNodeLine, false);
qDebug() << buffer.constData();
-
+
dumpRecursive(**i, branches, isLastChild);
}
}
void QVisitorPrivate::dumpNode
(const Node& node, const QList<bool>& branches, bool isLastChild)
-{
+{
const QList<QByteArray>::const_iterator
begin = node.m_annotation.begin(), end = node.m_annotation.end();
-
- if(begin == end) {
+
+ if (begin == end) {
// No annotations - just dump the object pointer
const bool isNodeLine = true;
QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild);
@@ -394,7 +394,7 @@ void QVisitorPrivate::dumpNode
}
else {
// Dump annotations
- for(QList<QByteArray>::const_iterator i = begin; end != i; ++i) {
+ for (QList<QByteArray>::const_iterator i = begin; end != i; ++i) {
const bool isNodeLine = (begin == i);
QByteArray buffer = branchBuffer(branches, isNodeLine, isLastChild);
buffer.append(*i);
@@ -408,7 +408,7 @@ void QVisitorPrivate::dumpNode
QVisitorPrivate::Node::Node()
{
-
+
}
QVisitorPrivate::Node::~Node()
@@ -453,7 +453,7 @@ void QVisitor::visitPrepare()
}
void QVisitor::visitNode(const QObject& object)
-{
+{
d_func()->visitNode(object);
}
@@ -474,7 +474,7 @@ void addDefaultAnnotators(QDumper& dumper)
{
dumper.addAnnotator(new QAnnotatorBasic);
dumper.addAnnotator(new QAnnotatorWidget);
-
+
// Add platform-specific annotators
addDefaultAnnotators_sys(dumper);
}
@@ -483,7 +483,7 @@ void addDefaultAnnotators(QVisitor& visitor)
{
visitor.addAnnotator(new QAnnotatorBasic);
visitor.addAnnotator(new QAnnotatorWidget);
-
+
// Add platform-specific annotators
addDefaultAnnotators_sys(visitor);
}
@@ -492,7 +492,7 @@ void dumpTreeFromRoot(const QObject& root, QVisitor& visitor)
{
// Set up iteration range
ObjectTree::DepthFirstConstIterator begin(root), end;
-
+
// Invoke generic visitor algorithm
ObjectTree::visit(begin, end, visitor);
}
@@ -505,7 +505,7 @@ void dumpTreeFromLeaf(const QObject& leaf, QVisitor& visitor)
{
root = root->parent();
}
-
+
dumpTreeFromRoot(*root, visitor);
}
@@ -513,7 +513,7 @@ void dumpAncestors(const QObject& leaf, QVisitor& visitor)
{
// Set up iteration range
ObjectTree::AncestorConstIterator begin(leaf), end;
-
+
// Invoke generic visitor algorithm
ObjectTree::visit(begin, end, visitor);
}
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h
index cbd9bea..e94b3ac 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump.h
@@ -32,7 +32,7 @@ namespace ObjectDump
{
/**
- * Abstract base for annotator classes invoked by QVisitor.
+ * Abstract base for annotator classes invoked by QVisitor.
*/
class OBJECTDUMP_EXPORT QAnnotator : public QObject
{
@@ -72,29 +72,29 @@ class OBJECTDUMP_EXPORT QDumper : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDumper)
-
+
public:
QDumper();
~QDumper();
-
+
/**
* Specify a prefix, to be printed on each line of output.
*/
void setPrefix(const QString& prefix);
-
+
/**
* Takes ownership of annotator.
*/
void addAnnotator(QAnnotator* annotator);
-
+
/**
* Invoke each annotator on the object and write to debug output.
*/
void dumpObject(const QObject& object);
-
+
private:
QScopedPointer<QDumperPrivate> d_ptr;
-
+
};
@@ -107,36 +107,36 @@ class OBJECTDUMP_EXPORT QVisitor : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QVisitor)
-
+
public:
QVisitor();
~QVisitor();
-
+
/**
* Specify a prefix, to be printed on each line of output.
*/
void setPrefix(const QString& prefix);
-
+
/**
* Set number of spaces by which each level of the tree is indented.
*/
void setIndent(unsigned indent);
-
+
/**
* Called by the visitor algorithm before starting the visit.
*/
void visitPrepare();
-
+
/**
* Called by the visitor algorithm as each node is visited.
*/
void visitNode(const QObject& object);
-
+
/**
* Called by the visitor algorithm when the visit is complete.
*/
void visitComplete();
-
+
/**
* Takes ownership of annotator.
*/
@@ -144,7 +144,7 @@ public:
private:
QScopedPointer<QVisitorPrivate> d_ptr;
-
+
};
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
index 5ae10f9..03220a7 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
@@ -21,6 +21,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <coecntrl.h>
#include "objectdump_symbian.h"
+#include <QtGui/private/qwidget_p.h> // to access QWExtra
+
QT_BEGIN_NAMESPACE
namespace ObjectDump
@@ -28,92 +30,118 @@ namespace ObjectDump
namespace Symbian
{
+QList<QByteArray> QAnnotatorWidget::annotation(const QObject& object)
+{
+ QList<QByteArray> result;
+
+ const QWidget* widget = qobject_cast<const QWidget*>(&object);
+ if (widget) {
+
+ const QWExtra* extra = qt_widget_private(const_cast<QWidget *>(widget))->extraData();
+
+ if (extra) {
+
+ QByteArray array;
+ QTextStream stream(&array);
+
+ stream << "widget (Symbian): ";
+ stream << "activated " << extra->activated << ' ';
+ stream << "disableBlit " << extra->disableBlit << ' ';
+
+ stream.flush();
+ result.append(array);
+ }
+ }
+
+ return result;
+}
+
QList<QByteArray> QAnnotatorControl::annotation(const QObject& object)
{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
- if(widget) {
-
+ if (widget) {
+
const CCoeControl* control = widget->effectiveWinId();
- if(control) {
-
+ if (control) {
+
QByteArray array;
QTextStream stream(&array);
-
+
stream << "control: " << control << ' ';
stream << "parent " << control->Parent() << ' ';
-
- if(control->IsVisible())
+
+ if (control->IsVisible())
stream << "visible ";
else
stream << "invisible ";
-
+
stream << control->Position().iX << ',' << control->Position().iY << ' ';
stream << control->Size().iWidth << 'x' << control->Size().iHeight;
-
- if(control->OwnsWindow())
+
+ if (control->OwnsWindow())
stream << " ownsWindow ";
-
+
stream.flush();
result.append(array);
}
}
-
+
return result;
}
QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
{
QList<QByteArray> result;
-
+
const QWidget* widget = qobject_cast<const QWidget*>(&object);
- if(widget) {
-
+ if (widget) {
+
const CCoeControl* control = widget->effectiveWinId();
- if(control) {
-
- RDrawableWindow& window = *(control->DrawableWindow());
-
+ RDrawableWindow *window = 0;
+
+ if (control && (window = control->DrawableWindow())) {
+
QByteArray array;
QTextStream stream(&array);
-
+
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
- // Cast to a void pointer so that log output is in hexadecimal format.
- stream << "cli " << reinterpret_cast<const void*>(window.ClientHandle()) << ' ';
+ // Client-side window handle
+ // 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 << "group " << window.WindowGroupId() << ' ';
-
+ stream << "srv " << reinterpret_cast<const void*>(window->WsHandle()) << ' ';
+
+ 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()) << ' ';
-
- 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();
+ // 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 << ' ';
+
+ const TDisplayMode displayMode = window->DisplayMode();
stream << "mode " << displayMode << ' ';
-
- stream << "ord " << window.OrdinalPosition();
-
+
+ stream << "ord " << window->OrdinalPosition();
+
stream.flush();
result.append(array);
- }
+ }
}
-
+
return result;
}
@@ -121,12 +149,14 @@ QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
void addDefaultAnnotators_sys(QDumper& dumper)
{
+ dumper.addAnnotator(new Symbian::QAnnotatorWidget);
dumper.addAnnotator(new Symbian::QAnnotatorControl);
dumper.addAnnotator(new Symbian::QAnnotatorWindow);
}
void addDefaultAnnotators_sys(QVisitor& visitor)
{
+ visitor.addAnnotator(new Symbian::QAnnotatorWidget);
visitor.addAnnotator(new Symbian::QAnnotatorControl);
visitor.addAnnotator(new Symbian::QAnnotatorWindow);
}
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h
index 26ab308..563c862 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.h
@@ -29,6 +29,16 @@ namespace Symbian
{
/**
+ * Annotator which returns Symbian-specific widget information
+ */
+class QAnnotatorWidget : public QAnnotator
+{
+ Q_OBJECT
+public:
+ QList<QByteArray> annotation(const QObject& object);
+};
+
+/**
* Annotator which returns control information
*/
class QAnnotatorControl : public QAnnotator
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp
index 5053b2d..bc61435 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.cpp
@@ -28,38 +28,38 @@ namespace ObjectTree
DepthFirstConstIterator::DepthFirstConstIterator()
: m_pointee(0)
{
-
+
}
DepthFirstConstIterator::DepthFirstConstIterator
(const QObject& root)
: m_pointee(&root)
{
-
+
}
-
+
DepthFirstConstIterator&
DepthFirstConstIterator::operator++()
{
const QObjectList& children = m_pointee->children();
-
+
if (children.count() == 0) {
backtrack();
}
else {
m_history.push(0);
- m_pointee = children.first();
+ m_pointee = children.first();
}
-
+
return *this;
}
void DepthFirstConstIterator::backtrack()
-{
+{
if (m_history.count()) {
const int index = m_history.top();
m_history.pop();
-
+
const QObjectList& siblings = m_pointee->parent()->children();
if (siblings.count() > index + 1) {
m_history.push(index + 1);
@@ -70,7 +70,7 @@ void DepthFirstConstIterator::backtrack()
backtrack();
}
}
- else {
+ else {
// Reached end of search
m_pointee = 0;
}
@@ -80,7 +80,7 @@ void DepthFirstConstIterator::backtrack()
AncestorConstIterator::AncestorConstIterator()
{
-
+
}
AncestorConstIterator::AncestorConstIterator(const QObject& leaf)
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h
index f2729fa..98bdf14 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objecttree.h
@@ -34,24 +34,24 @@ namespace ObjectTree
*/
class OBJECTDUMP_EXPORT DepthFirstConstIterator
{
-public:
+public:
DepthFirstConstIterator();
DepthFirstConstIterator(const QObject& root);
-
+
DepthFirstConstIterator& operator++();
-
+
inline bool operator==(const DepthFirstConstIterator& other) const
{ return other.m_pointee == m_pointee; }
-
+
inline bool operator!=(const DepthFirstConstIterator& other) const
{ return other.m_pointee != m_pointee; }
-
+
inline const QObject* operator->() const { return m_pointee; }
inline const QObject& operator*() const { return *m_pointee; }
-
+
private:
void backtrack();
-
+
private:
const QObject* m_pointee;
QStack<int> m_history;
@@ -62,40 +62,40 @@ private:
*/
class OBJECTDUMP_EXPORT AncestorConstIterator
{
-public:
+public:
AncestorConstIterator();
AncestorConstIterator(const QObject& root);
-
+
inline AncestorConstIterator& operator++()
{ m_ancestors.pop(); return *this; }
-
+
inline bool operator==(const AncestorConstIterator& other) const
{ return other.m_ancestors == m_ancestors; }
-
+
inline bool operator!=(const AncestorConstIterator& other) const
{ return other.m_ancestors != m_ancestors; }
-
+
inline const QObject* operator->() const { return m_ancestors.top(); }
inline const QObject& operator*() const { return *m_ancestors.top(); }
-
+
private:
QStack<const QObject*> m_ancestors;
-
+
};
/**
* Generic algorithm for visiting nodes in an object tree. Nodes in the
* tree are visited in a const context, therefore they are not modified
* by this algorithm.
- *
+ *
* Visitor must provide functions with the following signatures:
- *
+ *
* Called before visit begins
* void visitPrepare()
- *
+ *
* Called on each node visited
* void visitNode(const QObject& object)
- *
+ *
* Called when visit is complete
* void visitComplete()
*/
@@ -103,8 +103,8 @@ template <class Iterator, class Visitor>
void visit(Iterator begin, Iterator end, Visitor& visitor)
{
visitor.visitPrepare();
-
- for( ; begin != end; ++begin)
+
+ for ( ; begin != end; ++begin)
visitor.visitNode(*begin);
visitor.visitComplete();
diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp
index 2f5b68f..58d1ece 100644
--- a/src/3rdparty/phonon/mmf/utils.cpp
+++ b/src/3rdparty/phonon/mmf/utils.cpp
@@ -62,7 +62,7 @@ MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType)
}
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#include <hal.h>
#include <hal_data.h>
@@ -111,7 +111,7 @@ QColor MMF::Utils::getScreenPixel(const QPoint& pos)
TScreenInfo info;
TRAPD(err, getScreenInfoL(info));
QColor pixel;
- if(err == KErrNone and pos.x() < info.width and pos.y() < info.height)
+ if (err == KErrNone and pos.x() < info.width and pos.y() < info.height)
{
const int bytesPerPixel = info.bpp / 8;
Q_ASSERT(bytesPerPixel >= 3);
@@ -129,7 +129,7 @@ QColor MMF::Utils::getScreenPixel(const QPoint& pos)
pixel.setGreen(*ptr++);
pixel.setRed(*ptr++);
- if(bytesPerPixel == 4)
+ if (bytesPerPixel == 4)
pixel.setAlpha(*ptr++);
}
return pixel;
@@ -138,7 +138,7 @@ QColor MMF::Utils::getScreenPixel(const QPoint& pos)
// Debugging: for debugging video visibility
void MMF::Utils::dumpScreenPixelSample()
{
- for(int i=0; i<20; ++i) {
+ for (int i=0; i<20; ++i) {
const QPoint pos(i*10, i*10);
const QColor pixel = Utils::getScreenPixel(pos);
RDebug::Printf(
diff --git a/src/3rdparty/phonon/mmf/utils.h b/src/3rdparty/phonon/mmf/utils.h
index 38964d0..7e363e8 100644
--- a/src/3rdparty/phonon/mmf/utils.h
+++ b/src/3rdparty/phonon/mmf/utils.h
@@ -54,7 +54,7 @@ void panic(PanicCode code);
*/
MediaType mimeTypeToMediaType(const TDesC& mimeType);
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
/**
* Retrieve color of specified pixel from the screen.
*/
@@ -138,16 +138,16 @@ public:
#define _TRACE_MODULE Phonon::MMF
// Macros available for use by implementation code
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#define TRACE_CONTEXT(_fn, _cat) const ::Phonon::MMF::TTraceContext _tc((TText*)L ## #_fn, (TUint)this, _cat);
-#define TRACE_ENTRY_0() { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
-#define TRACE_ENTRY(string, args...) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
-#define TRACE_EXIT_0() { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
-#define TRACE_EXIT(string, args...) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
-#define TRACE_RETURN(string, result) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "r Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, result); } return result;
+#define TRACE_ENTRY_0() { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
+#define TRACE_ENTRY(string, args...) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "+ Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
+#define TRACE_EXIT_0() { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x]"), _tc.iFunction, _tc.iAddr); }
+#define TRACE_EXIT(string, args...) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "- Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
+#define TRACE_RETURN(string, result) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## "r Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, result); } return result;
#define TRACE_PANIC(code) { _TRACE_PRINT(_TRACE_TEXT(L ## "! Phonon::MMF::%s [0x%08x] panic %d"), _tc.iFunction, _tc.iAddr, code); } Utils::panic(code);
-#define TRACE_0(string) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr); }
-#define TRACE(string, args...) { if(_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
+#define TRACE_0(string) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr); }
+#define TRACE(string, args...) { if (_tc.Enabled()) _TRACE_PRINT(_TRACE_TEXT(L ## " Phonon::MMF::%s [0x%08x] " L ## string), _tc.iFunction, _tc.iAddr, args); }
#else
#define TRACE_CONTEXT(_fn, _cat)
#define TRACE_ENTRY_0()
diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp
index 041b0a8..f0393a7 100644
--- a/src/3rdparty/phonon/mmf/videooutput.cpp
+++ b/src/3rdparty/phonon/mmf/videooutput.cpp
@@ -20,7 +20,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include "videooutput.h"
#include "videooutputobserver.h"
-#ifdef _DEBUG
+#ifndef QT_NO_DEBUG
#include "objectdump.h"
#endif
@@ -52,19 +52,19 @@ MMF::VideoOutput::VideoOutput(QWidget* parent)
TRACE_ENTRY("parent 0x%08x", parent);
setPalette(QPalette(Qt::black));
- setAttribute(Qt::WA_OpaquePaintEvent, true);
- setAttribute(Qt::WA_NoSystemBackground, true);
- setAutoFillBackground(false);
+ setAttribute(Qt::WA_OpaquePaintEvent, true);
+ setAttribute(Qt::WA_NoSystemBackground, true);
+ setAutoFillBackground(false);
- // Causes QSymbianControl::Draw not to BitBlt this widget's region of the
- // backing store. Since the backing store is (by default) a 16MU bitmap,
- // blitting it results in this widget's screen region in the final
- // framebuffer having opaque alpha values. This in turn causes the video
- // to be invisible when running on the target device.
- qt_widget_private(this)->extraData()->disableBlit = true;
+ // Causes QSymbianControl::Draw not to BitBlt this widget's region of the
+ // backing store. Since the backing store is (by default) a 16MU bitmap,
+ // blitting it results in this widget's screen region in the final
+ // framebuffer having opaque alpha values. This in turn causes the video
+ // to be invisible when running on the target device.
+ qt_widget_private(this)->extraData()->disableBlit = true;
dump();
-
+
TRACE_EXIT_0();
}
@@ -123,9 +123,7 @@ void MMF::VideoOutput::paintEvent(QPaintEvent* event)
TRACE("regions %d", event->region().numRects());
TRACE("type %d", event->type());
- dump();
-
- // Do not paint anything
+ // Do nothing
}
void MMF::VideoOutput::resizeEvent(QResizeEvent* event)
@@ -135,10 +133,7 @@ void MMF::VideoOutput::resizeEvent(QResizeEvent* event)
event->oldSize().width(), event->oldSize().height(),
event->size().width(), event->size().height());
- QWidget::resizeEvent(event);
-
- if (m_observer)
- m_observer->videoOutputRegionChanged();
+ videoOutputRegionChanged();
}
void MMF::VideoOutput::moveEvent(QMoveEvent* event)
@@ -148,10 +143,20 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event)
event->oldPos().x(), event->oldPos().y(),
event->pos().x(), event->pos().y());
- QWidget::moveEvent(event);
+ videoOutputRegionChanged();
+}
- if (m_observer)
- m_observer->videoOutputRegionChanged();
+bool MMF::VideoOutput::event(QEvent* event)
+{
+ TRACE_CONTEXT(VideoOutput::event, EVideoInternal);
+
+ if (event->type() == QEvent::WinIdChange) {
+ TRACE_0("WinIdChange");
+ videoOutputRegionChanged();
+ return true;
+ }
+ else
+ return QWidget::event(event);
}
@@ -159,9 +164,16 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event)
// Private functions
//-----------------------------------------------------------------------------
-void VideoOutput::dump() const
+void MMF::VideoOutput::videoOutputRegionChanged()
+{
+ dump();
+ if (m_observer)
+ m_observer->videoOutputRegionChanged();
+}
+
+void MMF::VideoOutput::dump() const
{
-#ifdef _DEBUG
+#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
diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h
index 639a5ed..7bc0b52 100644
--- a/src/3rdparty/phonon/mmf/videooutput.h
+++ b/src/3rdparty/phonon/mmf/videooutput.h
@@ -49,10 +49,12 @@ protected:
void paintEvent(QPaintEvent* event);
void resizeEvent(QResizeEvent* event);
void moveEvent(QMoveEvent* event);
+ bool event(QEvent* event);
private:
void dump() const;
-
+ void videoOutputRegionChanged();
+
private:
QSize m_frameSize;
diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
index ba3cb42..a3c72b2 100644
--- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
+++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
@@ -139,6 +139,21 @@ namespace Phonon
ObjectDescriptionModelDataPrivate *const d;
};
+/* Required to ensure template class vtables are exported on both symbian
+and existing builds. */
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+// RVCT compiler (2.2.686) requires the export declaration to be on the class to export vtables
+// MWC compiler works both ways
+// GCCE compiler is unknown (it can't compile QtCore yet)
+#define PHONON_TEMPLATE_CLASS_EXPORT PHONON_EXPORT
+#define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT
+#else
+// Windows builds (at least) do not support export declaration on templated class
+// But if you export a member function, the vtable is implicitly exported
+#define PHONON_TEMPLATE_CLASS_EXPORT
+#define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT PHONON_EXPORT
+#endif
+
/** \class ObjectDescriptionModel objectdescriptionmodel.h Phonon/ObjectDescriptionModel
* \short The ObjectDescriptionModel class provides a model from
* a list of ObjectDescription objects.
@@ -175,7 +190,7 @@ namespace Phonon
* \author Matthias Kretz <kretz@kde.org>
*/
template<ObjectDescriptionType type>
- class ObjectDescriptionModel : public QAbstractListModel
+ class PHONON_TEMPLATE_CLASS_EXPORT ObjectDescriptionModel : public QAbstractListModel
{
public:
Q_OBJECT_CHECK
@@ -188,11 +203,11 @@ namespace Phonon
*/
#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4
/** \internal */
- static PHONON_EXPORT const QMetaObject staticMetaObject;
+ static PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject staticMetaObject;
/** \internal */
- PHONON_EXPORT const QMetaObject *metaObject() const;
+ PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject *metaObject() const;
/** \internal */
- PHONON_EXPORT void *qt_metacast(const char *_clname);
+ PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname);
//int qt_metacall(QMetaObject::Call _c, int _id, void **_a);
#endif