diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-29 16:03:52 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-29 16:03:52 +0100 |
commit | c5706f05a8315c10398a53ba3b269a2b22d01a7d (patch) | |
tree | 54f83c3f0bd4ce7325adbd767a46bb146f1fdab6 | |
parent | 0c8be637087a3c7aa038cf72f3a3ed6f7aca0510 (diff) | |
parent | 9b7fd8c7691981bb1d89704f595ebf50daf8876e (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
.qmake.conf
Change-Id: I6ea9c40c69f55fa733fd9000a57d570fff21f1e9
-rw-r--r-- | config.tests/mmrenderer/mmrenderer.pro | 6 | ||||
-rw-r--r-- | config.tests/mmrenderer/mmrenderertest.cpp | 50 | ||||
-rw-r--r-- | qtmultimedia.pro | 2 | ||||
-rw-r--r-- | src/imports/multimedia/qmldir | 1 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect.cpp | 10 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.cpp | 8 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.h | 6 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_qaudio_p.cpp | 14 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_qaudio_p.h | 6 | ||||
-rw-r--r-- | src/multimedia/playback/qmediaplayer.cpp | 5 | ||||
-rw-r--r-- | src/plugins/plugins.pro | 3 | ||||
-rw-r--r-- | src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp | 2 | ||||
-rw-r--r-- | src/plugins/wmf/player/mfaudioendpointcontrol.cpp | 7 |
13 files changed, 95 insertions, 25 deletions
diff --git a/config.tests/mmrenderer/mmrenderer.pro b/config.tests/mmrenderer/mmrenderer.pro new file mode 100644 index 000000000..cc1e21e82 --- /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 000000000..90942696e --- /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 <mm/renderer.h> + +int main(int argc,char **argv) +{ + mmr_connect(0); + + return 0; +} + diff --git a/qtmultimedia.pro b/qtmultimedia.pro index 489f81fa7..404a2bf51 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/imports/multimedia/qmldir b/src/imports/multimedia/qmldir index 428bfc8d5..3d2d7c460 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 diff --git a/src/multimedia/audio/qsoundeffect.cpp b/src/multimedia/audio/qsoundeffect.cpp index 437d3a4e6..cd7a9ad5d 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 328a3b0b3..8bac6c998 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 4dc58f0b6..042679180 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 2de1b0067..aed8a7aea 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 8dfd7826a..c1762672d 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; diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index eaac82820..bf6294a1e 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) diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 4c70e3d11..d947f3b25 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 { diff --git a/src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp b/src/plugins/qnx/mediaplayer/mmrenderermetadatareadercontrol.cpp index c0fe7d085..5ffa7a093 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(); diff --git a/src/plugins/wmf/player/mfaudioendpointcontrol.cpp b/src/plugins/wmf/player/mfaudioendpointcontrol.cpp index 39fc41c5f..c04e47f72 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; |