diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-21 08:09:45 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-21 08:09:45 (GMT) |
commit | 932c48658656fa328507b16e39c3a6cc820ef15e (patch) | |
tree | e9c5b731715c1b2bfac754655bb35cd30b2cac79 | |
parent | 2150242ddbe66c5d4c440599f1282580be013e61 (diff) | |
download | Qt-932c48658656fa328507b16e39c3a6cc820ef15e.zip Qt-932c48658656fa328507b16e39c3a6cc820ef15e.tar.gz Qt-932c48658656fa328507b16e39c3a6cc820ef15e.tar.bz2 |
Tidied up trace statements
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 27 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/audioplayer.cpp | 18 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/backend.cpp | 40 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/mediaobject.cpp | 17 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/utils.cpp | 4 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/utils.h | 14 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/videoplayer.cpp | 26 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/videowidget.cpp | 30 |
8 files changed, 125 insertions, 51 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index dbb4d2d..be34fef 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -188,10 +188,6 @@ Phonon::ErrorType MMF::AbstractMediaPlayer::errorType() const QString MMF::AbstractMediaPlayer::errorString() const { - TRACE_CONTEXT(AbstractMediaPlayer::errorString, EAudioApi); - TRACE_ENTRY("state %d", m_state); - - TRACE_EXIT_0(); // TODO: put in proper error strings QString result; return result; @@ -199,12 +195,7 @@ QString MMF::AbstractMediaPlayer::errorString() const Phonon::State MMF::AbstractMediaPlayer::state() const { - TRACE_CONTEXT(AbstractMediaPlayer::state, EAudioApi); - TRACE_ENTRY("state %d", m_state); - - const Phonon::State result = phononState(m_state); - - TRACE_RETURN("%d", result); + return phononState(m_state); } MediaSource MMF::AbstractMediaPlayer::source() const @@ -214,7 +205,7 @@ MediaSource MMF::AbstractMediaPlayer::source() const void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& file) { - TRACE_CONTEXT(AudioPlayer::setSource, EAudioApi); + TRACE_CONTEXT(AbstractMediaPlayer::setFileSource, EAudioApi); TRACE_ENTRY("state %d source.type %d", m_state, source.type()); close(); @@ -247,6 +238,7 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f case MediaSource::Url: { + TRACE_0("Source type not supported"); // TODO: support opening URLs symbianErr = KErrNotSupported; break; @@ -255,10 +247,12 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f case MediaSource::Invalid: case MediaSource::Disc: case MediaSource::Stream: + TRACE_0("Source type not supported"); symbianErr = KErrNotSupported; break; case MediaSource::Empty: + TRACE_0("Empty source - doing nothing"); TRACE_EXIT_0(); return; @@ -273,6 +267,8 @@ void MMF::AbstractMediaPlayer::setFileSource(const MediaSource &source, RFile& f } else { + TRACE("error %d", symbianErr) + // TODO: do something with the value of symbianErr? m_error = NormalError; changeState(ErrorState); @@ -336,7 +332,7 @@ bool MMF::AbstractMediaPlayer::doSetVolume(qreal volume) TRACE_PANIC(InvalidStatePanic); } - return result; + TRACE_RETURN("%d", result); } @@ -400,7 +396,7 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState) and m_playPending ) { - TRACE("Play was called while loading; starting playback now"); + TRACE_0("Play was called while loading; starting playback now"); m_playPending = false; play(); } @@ -431,12 +427,7 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds void MMF::AbstractMediaPlayer::tick() { - TRACE_CONTEXT(AbstractMediaPlayer::tick, EAudioInternal); - TRACE_ENTRY("state %d", m_state); - emit tick(currentTime()); - - TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 8d8eb53..e812af5 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -130,7 +130,6 @@ bool MMF::AudioPlayer::hasVideo() const qint64 MMF::AudioPlayer::currentTime() const { TRACE_CONTEXT(AudioPlayer::currentTime, EAudioApi); - TRACE_ENTRY("state %d", state()); TTimeIntervalMicroSeconds us; const TInt err = m_player->GetPosition(us); @@ -141,18 +140,21 @@ qint64 MMF::AudioPlayer::currentTime() const { result = toMilliSeconds(us); } + else + { + TRACE("GetPosition err %d", err); + + // If we don't cast away constness here, we simply have to ignore + // the error. + const_cast<AudioPlayer*>(this)->setError(NormalError); + } - TRACE_RETURN("%Ld", result); + return result; } qint64 MMF::AudioPlayer::totalTime() const { - TRACE_CONTEXT(AudioPlayer::totalTime, EAudioApi); - TRACE_ENTRY("state %d", state()); - - const qint64 result = toMilliSeconds(m_player->Duration()); - - TRACE_RETURN("%Ld", result); + return toMilliSeconds(m_player->Duration()); } diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp index 9494c65..f610b60 100644 --- a/src/3rdparty/phonon/mmf/backend.cpp +++ b/src/3rdparty/phonon/mmf/backend.cpp @@ -22,6 +22,7 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "backend.h" #include "audiooutput.h" #include "mediaobject.h" +#include "utils.h" #include "videowidget.h" using namespace Phonon; @@ -29,19 +30,22 @@ using namespace Phonon::MMF; Backend::Backend(QObject *parent) : QObject(parent) { - // TODO: replace this with logging macros as per rest of the module - qDebug() << Q_FUNC_INFO; + TRACE_CONTEXT(Backend::Backend, EBackend); + TRACE_ENTRY_0(); setProperty("identifier", QLatin1String("phonon_mmf")); setProperty("backendName", QLatin1String("MMF")); setProperty("backendComment", QLatin1String("Backend using Symbian Multimedia Framework (MMF)")); setProperty("backendVersion", QLatin1String("0.1")); setProperty("backendWebsite", QLatin1String("http://www.qtsoftware.com/")); + + TRACE_EXIT_0(); } QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &) { - // TODO: add trace + TRACE_CONTEXT(Backend::createObject, EBackend); + TRACE_ENTRY("class %d", c); QObject* result = NULL; @@ -66,10 +70,10 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const break; default: - Q_ASSERT_X(false, Q_FUNC_INFO, "This line should never be reached."); + TRACE_PANIC(InvalidBackendInterfaceClass); } - return result; + TRACE_RETURN("0x%08x", result); } QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType) const @@ -89,26 +93,36 @@ bool Backend::startConnectionChange(QSet<QObject *>) bool Backend::connectNodes(QObject *source, QObject *target) { - // TODO: add trace + TRACE_CONTEXT(Backend::connectNodes, EBackend); + TRACE_ENTRY("source 0x%08x target 0x%08x", source, target); MediaObject *const mediaObject = qobject_cast<MediaObject *>(source); AudioOutput *const audioOutput = qobject_cast<AudioOutput *>(target); + bool result = false; + if(mediaObject and audioOutput) { + TRACE("mediaObject 0x%08x -> audioOutput 0x%08x", mediaObject, audioOutput); + audioOutput->setVolumeControl(mediaObject); - return true; + result = true; } - // Node types not recognised - return false; + TRACE_RETURN("%d", result); } -bool Backend::disconnectNodes(QObject *, QObject *) +bool Backend::disconnectNodes(QObject *source, QObject *target) { - // TODO: add trace - - return true; + TRACE_CONTEXT(Backend::disconnectNodes, EBackend); + TRACE_ENTRY("source 0x%08x target 0x%08x", source, target); + + Q_UNUSED(source); // silence warnings in release builds + Q_UNUSED(target); // silence warnings in release builds + + bool result = true; + + TRACE_RETURN("%d", result); } bool Backend::endConnectionChange(QSet<QObject *>) diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 8ac9441..4b5c4f0 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -62,17 +62,21 @@ MMF::MediaObject::~MediaObject() bool MMF::MediaObject::openRecognizer() { + TRACE_CONTEXT(MediaObject::openRecognizer, EAudioInternal); + if(!m_recognizerOpened) { TInt err = m_recognizer.Connect(); if(KErrNone != err) { + TRACE("RApaLsSession::Connect error %d", err); return false; } err = m_fileServer.Connect(); if(KErrNone != err) { + TRACE("RFs::Connect error %d", err); return false; } @@ -81,6 +85,7 @@ bool MMF::MediaObject::openRecognizer() err = m_fileServer.ShareProtected(); if(KErrNone != err) { + TRACE("RFs::ShareProtected error %d", err); return false; } @@ -114,6 +119,8 @@ MMF::MediaObject::MediaType MMF::MediaObject::mimeTypeToMediaType(const TDesC& m MMF::MediaObject::MediaType MMF::MediaObject::fileMediaType (const QString& fileName) { + TRACE_CONTEXT(MediaObject::fileMediaType, EAudioInternal); + MediaType result = MediaTypeUnknown; if(openRecognizer()) @@ -132,6 +139,14 @@ MMF::MediaObject::MediaType MMF::MediaObject::fileMediaType const TPtrC mimeType = recognizerResult.iDataType.Des(); result = mimeTypeToMediaType(mimeType); } + else + { + TRACE("RApaLsSession::RecognizeData filename %S error %d", fileNameSymbian.data(), err); + } + } + else + { + TRACE("RFile::Open filename %S error %d", fileNameSymbian.data(), err); } } @@ -322,6 +337,8 @@ void MMF::MediaObject::createPlayer(const MediaSource &source) 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(); } void MMF::MediaObject::setNextSource(const MediaSource &source) diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index aa87310..ada4800 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -25,9 +25,9 @@ using namespace Phonon::MMF; _LIT(PanicCategory, "Phonon::MMF"); void MMF::Utils::panic(PanicCode code) - { +{ User::Panic(PanicCategory, code); - } +} QHBufC MMF::Utils::symbianFilename(const QString& qtFilename) { diff --git a/src/3rdparty/phonon/mmf/utils.h b/src/3rdparty/phonon/mmf/utils.h index e3e7317..ff9eedd 100644 --- a/src/3rdparty/phonon/mmf/utils.h +++ b/src/3rdparty/phonon/mmf/utils.h @@ -31,8 +31,9 @@ namespace Phonon */ enum PanicCode { - InvalidStatePanic, - InvalidMediaTypePanic + InvalidStatePanic = 1, + InvalidMediaTypePanic = 2, + InvalidBackendInterfaceClass = 3 }; namespace Utils @@ -58,14 +59,19 @@ namespace Phonon enum TTraceCategory { /** + * Backend + */ + EBackend = 0x00000001, + + /** * Functions which map directly to the public Phonon audio API */ - EAudioApi = 0x00000001, + EAudioApi = 0x00000010, /** * Internal functions in the audio implementation */ - EAudioInternal = 0x00000002, + EAudioInternal = 0x00000020, /** * Functions which map directly to the public Phonon video API diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp index 6e6bcb2..45d4f65 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer.cpp @@ -47,7 +47,7 @@ MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player) void MMF::VideoPlayer::construct() { - TRACE_CONTEXT(VideoPlayer::VideoPlayer, EAudioApi); + TRACE_CONTEXT(VideoPlayer::VideoPlayer, EVideoApi); TRACE_ENTRY_0(); CCoeControl* control = m_widget->winId(); @@ -102,9 +102,12 @@ void MMF::VideoPlayer::doPlay() void MMF::VideoPlayer::doPause() { + TRACE_CONTEXT(VideoPlayer::doPause, EVideoApi); + TRAPD(err, m_player->PauseL()); if(KErrNone != err) { + TRACE("PauseL error %d", err); setError(NormalError); } } @@ -133,13 +136,14 @@ void MMF::VideoPlayer::close() void MMF::VideoPlayer::seek(qint64 ms) { - TRACE_CONTEXT(VideoPlayer::seek, EAudioApi); + TRACE_CONTEXT(VideoPlayer::seek, EVideoApi); TRACE_ENTRY("state %d pos %Ld", state(), ms); TRAPD(err, m_player->SetPositionL(TTimeIntervalMicroSeconds(ms))); if(KErrNone != err) { + TRACE("SetPositionL error %d", err); setError(NormalError); } @@ -153,6 +157,8 @@ bool MMF::VideoPlayer::hasVideo() const qint64 MMF::VideoPlayer::currentTime() const { + TRACE_CONTEXT(VideoPlayer::currentTime, EVideoApi); + TTimeIntervalMicroSeconds us; TRAPD(err, us = m_player->PositionL()) @@ -162,17 +168,29 @@ qint64 MMF::VideoPlayer::currentTime() const { result = toMilliSeconds(us); } + else + { + TRACE("PositionL error %d", err); + + // If we don't cast away constness here, we simply have to ignore + // the error. + const_cast<VideoPlayer*>(this)->setError(NormalError); + } return result; } qint64 MMF::VideoPlayer::totalTime() const { + TRACE_CONTEXT(VideoPlayer::totalTime, EVideoApi); + qint64 result = 0; TRAPD(err, result = toMilliSeconds(m_player->DurationL())); if(KErrNone != err) { + TRACE("DurationL error %d", err); + // If we don't cast away constness here, we simply have to ignore // the error. const_cast<VideoPlayer*>(this)->setError(NormalError); @@ -198,7 +216,7 @@ void MMF::VideoPlayer::MvpuoOpenComplete(TInt aError) m_player->Prepare(); } else - { + { // TODO: set different error states according to value of aError? setError(NormalError); } @@ -236,6 +254,7 @@ void MMF::VideoPlayer::MvpuoFrameReady(CFbsBitmap &aFrame, TInt aError) // TODO Q_UNUSED(aFrame); + Q_UNUSED(aError); // suppress warnings in release builds TRACE_EXIT_0(); } @@ -246,6 +265,7 @@ void MMF::VideoPlayer::MvpuoPlayComplete(TInt aError) TRACE_ENTRY("state %d error %d", state(), aError); // TODO + Q_UNUSED(aError); // suppress warnings in release builds TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index 3438aaa..194c885 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -16,9 +16,9 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. */ +#include "utils.h" #include "videowidget.h" - using namespace Phonon; using namespace Phonon::MMF; @@ -49,12 +49,18 @@ MMF::VideoWidget::VideoWidget(QWidget* parent) , m_hue(DefaultHue) , m_saturation(DefaultSaturation) { - + TRACE_CONTEXT(VideoWidget::VideoWidget, EVideoApi); + TRACE_ENTRY_0(); + + TRACE_EXIT_0(); } MMF::VideoWidget::~VideoWidget() { - + TRACE_CONTEXT(VideoWidget::~VideoWidget, EVideoApi); + TRACE_ENTRY_0(); + + TRACE_EXIT_0(); } @@ -70,6 +76,9 @@ Phonon::VideoWidget::AspectRatio MMF::VideoWidget::aspectRatio() const void MMF::VideoWidget::setAspectRatio (Phonon::VideoWidget::AspectRatio aspectRatio) { + TRACE_CONTEXT(VideoWidget::setAspectRatio, EVideoApi); + TRACE("aspectRatio %d", aspectRatio); + m_aspectRatio = aspectRatio; } @@ -80,6 +89,9 @@ qreal MMF::VideoWidget::brightness() const void MMF::VideoWidget::setBrightness(qreal brightness) { + TRACE_CONTEXT(VideoWidget::setBrightness, EVideoApi); + TRACE("brightness %f", brightness); + m_brightness = brightness; } @@ -90,6 +102,9 @@ Phonon::VideoWidget::ScaleMode MMF::VideoWidget::scaleMode() const void MMF::VideoWidget::setScaleMode(Phonon::VideoWidget::ScaleMode scaleMode) { + TRACE_CONTEXT(VideoWidget::setScaleMode, EVideoApi); + TRACE("setScaleMode %d", setScaleMode); + m_scaleMode = scaleMode; } @@ -100,6 +115,9 @@ qreal MMF::VideoWidget::contrast() const void MMF::VideoWidget::setContrast(qreal contrast) { + TRACE_CONTEXT(VideoWidget::setContrast, EVideoApi); + TRACE("contrast %f", contrast); + m_contrast = contrast; } @@ -110,6 +128,9 @@ qreal MMF::VideoWidget::hue() const void MMF::VideoWidget::setHue(qreal hue) { + TRACE_CONTEXT(VideoWidget::setHue, EVideoApi); + TRACE("hue %f", hue); + m_hue = hue; } @@ -120,6 +141,9 @@ qreal MMF::VideoWidget::saturation() const void MMF::VideoWidget::setSaturation(qreal saturation) { + TRACE_CONTEXT(VideoWidget::setSaturation, EVideoApi); + TRACE("saturation %f", saturation); + m_saturation = saturation; } |