From f0f62057c9333adf3e201c124a13574947348cfb Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Tue, 19 Nov 2013 13:25:54 +0100 Subject: [PATCH 1/7] iOS: Remove duplicate class name from qmldir It was added twice, which breaks the build when using Multimedia on iOS Change-Id: I0b5f08bc57d5d558fb060b00d5bdeb4149499a0d Reviewed-by: Richard Moe Gustavsen --- src/imports/multimedia/qmldir | 1 - 1 file changed, 1 deletion(-) diff --git a/src/imports/multimedia/qmldir b/src/imports/multimedia/qmldir index 428bfc8d..3d2d7c46 100644 --- a/src/imports/multimedia/qmldir +++ b/src/imports/multimedia/qmldir @@ -3,4 +3,3 @@ plugin declarative_multimedia classname QMultimediaDeclarativeModule typeinfo plugins.qmltypes Video 5.0 Video.qml -classname QMultimediaDeclarativeModule From eb221bfd6d68a8028d55c344cb29bf8defd2a81e Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 9 Nov 2013 00:15:21 +0800 Subject: [PATCH 2/7] Doc: Document asynchronous nature of QMediaPlayer::setMedia() The function name can be interpreted to mean that it loads the media. Users have made this mistake before: http://comments.gmane.org/gmane.comp.lib.qt.user/9189 https://bugreports.qt-project.org/browse/QTBUG-28514 Change-Id: I9e9b36405d67d40db42b77d8eeb8f9d528ee16e2 Reviewed-by: Jerome Pasion Reviewed-by: Yoann Lopes --- src/multimedia/playback/qmediaplayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index eaac8282..bf6294a1 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -864,6 +864,11 @@ void QMediaPlayer::setPlaybackRate(qreal rate) Setting the media to a null QMediaContent will cause the player to discard all information relating to the current media source and to cease all I/O operations related to that media. + + \note This function returns immediately after recording the specified source of the media. + It does not wait for the media to finish loading and does not check for errors. Listen for + the mediaStatusChanged() and error() signals to be notified when the media is loaded and + when an error occurs during loading. */ void QMediaPlayer::setMedia(const QMediaContent &media, QIODevice *stream) From 041e75d1c099a937a16759ad40aee4d83e2316f6 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Thu, 21 Nov 2013 14:20:15 +0100 Subject: [PATCH 3/7] Add mmrenderer configure check No all QNX versions/variations have a mmrenderer by default, so we need to check for it, otherwise it fails to compile. Change-Id: I3efe9df37cf7807c1b0ac4d2e8f49aa02e3408cd Reviewed-by: Frank Osterfeld Reviewed-by: Rafael Roquetto Reviewed-by: Lars Knoll --- config.tests/mmrenderer/mmrenderer.pro | 6 +++ config.tests/mmrenderer/mmrenderertest.cpp | 50 ++++++++++++++++++++++ qtmultimedia.pro | 2 + src/plugins/plugins.pro | 3 +- 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 config.tests/mmrenderer/mmrenderer.pro create mode 100644 config.tests/mmrenderer/mmrenderertest.cpp diff --git a/config.tests/mmrenderer/mmrenderer.pro b/config.tests/mmrenderer/mmrenderer.pro new file mode 100644 index 00000000..cc1e21e8 --- /dev/null +++ b/config.tests/mmrenderer/mmrenderer.pro @@ -0,0 +1,6 @@ +SOURCES = mmrenderertest.cpp + +CONFIG -= qt + +LIBS += -lmmrndclient -lstrm + diff --git a/config.tests/mmrenderer/mmrenderertest.cpp b/config.tests/mmrenderer/mmrenderertest.cpp new file mode 100644 index 00000000..90942696 --- /dev/null +++ b/config.tests/mmrenderer/mmrenderertest.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +int main(int argc,char **argv) +{ + mmr_connect(0); + + return 0; +} + diff --git a/qtmultimedia.pro b/qtmultimedia.pro index 489f81fa..404a2bf5 100644 --- a/qtmultimedia.pro +++ b/qtmultimedia.pro @@ -16,6 +16,8 @@ win32 { SDK_ROOT = $$(ANDROID_SDK_ROOT) isEmpty(SDK_ROOT): SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT !exists($$SDK_ROOT/platforms/android-11/android.jar): error("QtMultimedia for Android requires API level 11") +} else:qnx { + qtCompileTest(mmrenderer) } else { qtCompileTest(alsa) qtCompileTest(pulseaudio) diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 4c70e3d1..d947f3b2 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -13,7 +13,8 @@ android { } qnx { - SUBDIRS += qnx audiocapture + config_mmrenderer: SUBDIRS += qnx + SUBDIRS += audiocapture } qnx:!blackberry { From 6799e9eab0619598ece481243277b4b9f1d42db4 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 25 Nov 2013 12:48:11 +0100 Subject: [PATCH 4/7] Bump MODULE_VERSION to 5.2.1 Change-Id: Ib02770f3a7a799b77bfa4356ed903a6fbb473497 Reviewed-by: Matti Paaso Reviewed-by: Oswald Buddenhagen --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 4baafa83..457f68b5 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,4 +1,4 @@ load(qt_build_config) CONFIG += qt_example_installs -MODULE_VERSION = 5.2.0 +MODULE_VERSION = 5.2.1 From 160656d68855bc09a44c19d1b0656668c0fa4046 Mon Sep 17 00:00:00 2001 From: Marius Wachtler Date: Mon, 25 Nov 2013 15:22:56 +0100 Subject: [PATCH 5/7] Fix WMF Video not playing if no soundcard is available Do not add the AudioEndpoint to the topology if no Audio output device is available. Fixes video not playing if you deactivate your soundcard or have no headphones/speakers plugged in. Change-Id: I9fc2486198a299b3e75af648f69475270968c6f7 Reviewed-by: Yoann Lopes --- src/plugins/wmf/player/mfaudioendpointcontrol.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp index 39fc41c5..c04e47f7 100644 --- a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp +++ b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp @@ -60,6 +60,8 @@ void MFAudioEndpointControl::clear() foreach (LPWSTR wstrID, m_devices) CoTaskMemFree(wstrID); + m_devices.clear(); + if (m_currentActivate) m_currentActivate->Release(); m_currentActivate = NULL; @@ -130,6 +132,11 @@ IMFActivate* MFAudioEndpointControl::createActivate() clear(); updateEndpoints(); + + // Check if an endpoint is available ("Default" is always inserted) + if (m_devices.count() <= 1) + return NULL; + setActiveOutput(m_defaultEndpoint); return m_currentActivate; From 0fd995ac8b58b460f0740699cee9a221a66f6b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 25 Nov 2013 14:17:51 +0100 Subject: [PATCH 6/7] Don't use integers to describe volume internally in QSoundEffect. The public api takes floating point values and so does most of the back- ends. Conversion should be done in the back-ends that expect other value types to avoid unnecessary float -> int -> float conversions. Change-Id: I0ee1bfbe350f985294c20f897ffa3bd55288b4c9 Reviewed-by: Yoann Lopes --- src/multimedia/audio/qsoundeffect.cpp | 10 +++++----- src/multimedia/audio/qsoundeffect_pulse_p.cpp | 8 ++++---- src/multimedia/audio/qsoundeffect_pulse_p.h | 6 +++--- src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 14 +++++++------- src/multimedia/audio/qsoundeffect_qaudio_p.h | 6 +++--- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp index 437d3a4e..cd7a9ad5 100644 --- a/src/multimedia/audio/qsoundeffect.cpp +++ b/src/multimedia/audio/qsoundeffect.cpp @@ -265,7 +265,7 @@ int QSoundEffect::loopsRemaining() const */ qreal QSoundEffect::volume() const { - return qreal(d->volume()) / 100; + return d->volume(); } /*! @@ -273,15 +273,15 @@ qreal QSoundEffect::volume() const */ void QSoundEffect::setVolume(qreal volume) { - if (volume < 0 || volume > 1) { + if (volume < qreal(0.0) || volume > qreal(1.0)) { qWarning("SoundEffect: volume should be between 0.0 and 1.0"); return; } - int iVolume = qRound(volume * 100); - if (d->volume() == iVolume) + + if (qFuzzyCompare(d->volume(), volume)) return; - d->setVolume(iVolume); + d->setVolume(volume); } /*! diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index 328a3b0b..8bac6c99 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -382,7 +382,7 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent): m_muted(false), m_playQueued(false), m_stopping(false), - m_volume(100), + m_volume(1.0), m_loopCount(1), m_runningCount(0), m_reloadCategory(false), @@ -517,12 +517,12 @@ void QSoundEffectPrivate::setLoopCount(int loopCount) m_loopCount = loopCount; } -int QSoundEffectPrivate::volume() const +qreal QSoundEffectPrivate::volume() const { return m_volume; } -void QSoundEffectPrivate::setVolume(int volume) +void QSoundEffectPrivate::setVolume(qreal volume) { m_volume = volume; emit volumeChanged(); @@ -537,7 +537,7 @@ void QSoundEffectPrivate::updateVolume() pa_cvolume volume; volume.channels = m_pulseSpec.channels; if (pulseDaemon()->context()) - pa_operation_unref(pa_context_set_sink_input_volume(pulseDaemon()->context(), m_sinkInputId, pulseDaemon()->calcVolume(&volume, m_volume), setvolume_callback, m_ref->getRef())); + pa_operation_unref(pa_context_set_sink_input_volume(pulseDaemon()->context(), m_sinkInputId, pulseDaemon()->calcVolume(&volume, qRound(m_volume * 100)), setvolume_callback, m_ref->getRef())); Q_ASSERT(pa_cvolume_valid(&volume)); #ifdef QT_PA_DEBUG qDebug() << this << "updateVolume =" << pa_cvolume_max(&volume); diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.h b/src/multimedia/audio/qsoundeffect_pulse_p.h index 4dc58f0b..04267918 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.h +++ b/src/multimedia/audio/qsoundeffect_pulse_p.h @@ -80,8 +80,8 @@ public: int loopCount() const; int loopsRemaining() const; void setLoopCount(int loopCount); - int volume() const; - void setVolume(int volume); + qreal volume() const; + void setVolume(qreal volume); bool isMuted() const; void setMuted(bool muted); bool isLoaded() const; @@ -153,7 +153,7 @@ private: bool m_muted; bool m_playQueued; bool m_stopping; - int m_volume; + qreal m_volume; int m_loopCount; int m_runningCount; QUrl m_source; diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp index 2de1b006..aed8a7ae 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.cpp +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.cpp @@ -175,20 +175,20 @@ void QSoundEffectPrivate::setLoopCount(int loopCount) d->m_runningCount = loopCount; } -int QSoundEffectPrivate::volume() const +qreal QSoundEffectPrivate::volume() const { if (d->m_audioOutput && !d->m_muted) - return d->m_audioOutput->volume()*100.0f; + return d->m_audioOutput->volume(); return d->m_volume; } -void QSoundEffectPrivate::setVolume(int volume) +void QSoundEffectPrivate::setVolume(qreal volume) { d->m_volume = volume; if (d->m_audioOutput && !d->m_muted) - d->m_audioOutput->setVolume(volume/100.0f); + d->m_audioOutput->setVolume(volume); emit volumeChanged(); } @@ -203,7 +203,7 @@ void QSoundEffectPrivate::setMuted(bool muted) if (muted && d->m_audioOutput) d->m_audioOutput->setVolume(0); else if (!muted && d->m_audioOutput && d->m_muted) - d->m_audioOutput->setVolume(d->m_volume/100.0f); + d->m_audioOutput->setVolume(d->m_volume); d->m_muted = muted; emit mutedChanged(); @@ -314,7 +314,7 @@ PrivateSoundSource::PrivateSoundSource(QSoundEffectPrivate* s): m_audioOutput(0), m_sample(0), m_muted(false), - m_volume(100), + m_volume(1.0), m_sampleReady(false), m_offset(0) { @@ -337,7 +337,7 @@ void PrivateSoundSource::sampleReady() m_audioOutput = new QAudioOutput(m_sample->format()); connect(m_audioOutput,SIGNAL(stateChanged(QAudio::State)), this, SLOT(stateChanged(QAudio::State))); if (!m_muted) - m_audioOutput->setVolume(m_volume/100.0f); + m_audioOutput->setVolume(m_volume); else m_audioOutput->setVolume(0); } diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.h b/src/multimedia/audio/qsoundeffect_qaudio_p.h index 8dfd7826..c1762672 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.h +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.h @@ -88,7 +88,7 @@ private: QAudioOutput *m_audioOutput; QSample *m_sample; bool m_muted; - int m_volume; + qreal m_volume; bool m_sampleReady; qint64 m_offset; QString m_category; @@ -113,8 +113,8 @@ public: int loopCount() const; int loopsRemaining() const; void setLoopCount(int loopCount); - int volume() const; - void setVolume(int volume); + qreal volume() const; + void setVolume(qreal volume); bool isMuted() const; void setMuted(bool muted); bool isLoaded() const; From 9b7fd8c7691981bb1d89704f595ebf50daf8876e Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Tue, 26 Nov 2013 19:40:36 -0200 Subject: [PATCH 7/7] BlackBerry: Fix metadata key for "artist" In order to retrieve the metadata information describing the Artist of a given album, Qt queries for AlbumArtist, and not Author. Author actually refers to the person who created the media file (i.e. the encoder in case of a mp3 song), and is also a string list (since more than one author is supported). Task-number: QTBUG-34985 Change-Id: I30b61f83db07ad2274eb79b28d92d772654220de Reviewed-by: Tobias Koenig Reviewed-by: Sean Harmer --- src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp b/src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp index c0fe7d08..5ffa7a09 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp @@ -57,7 +57,7 @@ QVariant MmRendererMetaDataReaderControl::metaData(const QString &key) const { if (key == QMediaMetaData::Title) return m_metaData.title(); - else if (key == QMediaMetaData::Author) + else if (key == QMediaMetaData::AlbumArtist) return m_metaData.artist(); else if (key == QMediaMetaData::Comment) return m_metaData.comment();