Make the multimedia examples less verbose

Important warnings such as missing services are still printed though.

Task-number: QTBUG-31080
Change-Id: I96fd3837c4edc58c61b97bf950b7cab05ceed014
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Alex Blasche
2014-09-18 11:33:46 +02:00
parent da383e5c7e
commit f788f8e5c6
12 changed files with 5 additions and 68 deletions

View File

@@ -315,20 +315,11 @@ void InputTest::initializeAudio()
void InputTest::createAudioInput() void InputTest::createAudioInput()
{ {
m_audioInput = new QAudioInput(m_device, m_format, this); m_audioInput = new QAudioInput(m_device, m_format, this);
connect(m_audioInput, SIGNAL(notify()), SLOT(notified()));
connect(m_audioInput, SIGNAL(stateChanged(QAudio::State)), SLOT(handleStateChanged(QAudio::State)));
m_volumeSlider->setValue(m_audioInput->volume() * 100); m_volumeSlider->setValue(m_audioInput->volume() * 100);
m_audioInfo->start(); m_audioInfo->start();
m_audioInput->start(m_audioInfo); m_audioInput->start(m_audioInfo);
} }
void InputTest::notified()
{
qWarning() << "bytesReady = " << m_audioInput->bytesReady()
<< ", " << "elapsedUSecs = " <<m_audioInput->elapsedUSecs()
<< ", " << "processedUSecs = "<<m_audioInput->processedUSecs();
}
void InputTest::readMore() void InputTest::readMore()
{ {
if (!m_audioInput) if (!m_audioInput)
@@ -364,27 +355,19 @@ void InputTest::toggleSuspend()
{ {
// toggle suspend/resume // toggle suspend/resume
if (m_audioInput->state() == QAudio::SuspendedState) { if (m_audioInput->state() == QAudio::SuspendedState) {
qWarning() << "status: Suspended, resume()";
m_audioInput->resume(); m_audioInput->resume();
m_suspendResumeButton->setText(tr(SUSPEND_LABEL)); m_suspendResumeButton->setText(tr(SUSPEND_LABEL));
} else if (m_audioInput->state() == QAudio::ActiveState) { } else if (m_audioInput->state() == QAudio::ActiveState) {
qWarning() << "status: Active, suspend()";
m_audioInput->suspend(); m_audioInput->suspend();
m_suspendResumeButton->setText(tr(RESUME_LABEL)); m_suspendResumeButton->setText(tr(RESUME_LABEL));
} else if (m_audioInput->state() == QAudio::StoppedState) { } else if (m_audioInput->state() == QAudio::StoppedState) {
qWarning() << "status: Stopped, resume()";
m_audioInput->resume(); m_audioInput->resume();
m_suspendResumeButton->setText(tr(SUSPEND_LABEL)); m_suspendResumeButton->setText(tr(SUSPEND_LABEL));
} else if (m_audioInput->state() == QAudio::IdleState) { } else if (m_audioInput->state() == QAudio::IdleState) {
qWarning() << "status: IdleState"; // no-op
} }
} }
void InputTest::handleStateChanged(QAudio::State state)
{
qWarning() << "state = " << state;
}
void InputTest::refreshDisplay() void InputTest::refreshDisplay()
{ {
m_canvas->setLevel(m_audioInfo->level()); m_canvas->setLevel(m_audioInfo->level());

View File

@@ -110,11 +110,9 @@ private:
private slots: private slots:
void refreshDisplay(); void refreshDisplay();
void notified();
void readMore(); void readMore();
void toggleMode(); void toggleMode();
void toggleSuspend(); void toggleSuspend();
void handleStateChanged(QAudio::State state);
void deviceChanged(int index); void deviceChanged(int index);
void sliderChanged(int value); void sliderChanged(int value);

View File

@@ -247,8 +247,6 @@ void AudioTest::createAudioOutput()
delete m_audioOutput; delete m_audioOutput;
m_audioOutput = 0; m_audioOutput = 0;
m_audioOutput = new QAudioOutput(m_device, m_format, this); m_audioOutput = new QAudioOutput(m_device, m_format, this);
connect(m_audioOutput, SIGNAL(notify()), SLOT(notified()));
connect(m_audioOutput, SIGNAL(stateChanged(QAudio::State)), SLOT(handleStateChanged(QAudio::State)));
m_generator->start(); m_generator->start();
m_audioOutput->start(m_generator); m_audioOutput->start(m_generator);
m_volumeSlider->setValue(int(m_audioOutput->volume()*100.0f)); m_volumeSlider->setValue(int(m_audioOutput->volume()*100.0f));
@@ -275,13 +273,6 @@ void AudioTest::volumeChanged(int value)
m_audioOutput->setVolume(qreal(value/100.0f)); m_audioOutput->setVolume(qreal(value/100.0f));
} }
void AudioTest::notified()
{
qWarning() << "bytesFree = " << m_audioOutput->bytesFree()
<< ", " << "elapsedUSecs = " << m_audioOutput->elapsedUSecs()
<< ", " << "processedUSecs = " << m_audioOutput->processedUSecs();
}
void AudioTest::pullTimerExpired() void AudioTest::pullTimerExpired()
{ {
if (m_audioOutput && m_audioOutput->state() != QAudio::StoppedState) { if (m_audioOutput && m_audioOutput->state() != QAudio::StoppedState) {
@@ -319,23 +310,16 @@ void AudioTest::toggleMode()
void AudioTest::toggleSuspendResume() void AudioTest::toggleSuspendResume()
{ {
if (m_audioOutput->state() == QAudio::SuspendedState) { if (m_audioOutput->state() == QAudio::SuspendedState) {
qWarning() << "status: Suspended, resume()";
m_audioOutput->resume(); m_audioOutput->resume();
m_suspendResumeButton->setText(tr(SUSPEND_LABEL)); m_suspendResumeButton->setText(tr(SUSPEND_LABEL));
} else if (m_audioOutput->state() == QAudio::ActiveState) { } else if (m_audioOutput->state() == QAudio::ActiveState) {
qWarning() << "status: Active, suspend()";
m_audioOutput->suspend(); m_audioOutput->suspend();
m_suspendResumeButton->setText(tr(RESUME_LABEL)); m_suspendResumeButton->setText(tr(RESUME_LABEL));
} else if (m_audioOutput->state() == QAudio::StoppedState) { } else if (m_audioOutput->state() == QAudio::StoppedState) {
qWarning() << "status: Stopped, resume()";
m_audioOutput->resume(); m_audioOutput->resume();
m_suspendResumeButton->setText(tr(SUSPEND_LABEL)); m_suspendResumeButton->setText(tr(SUSPEND_LABEL));
} else if (m_audioOutput->state() == QAudio::IdleState) { } else if (m_audioOutput->state() == QAudio::IdleState) {
qWarning() << "status: IdleState"; // no-op
} }
} }
void AudioTest::handleStateChanged(QAudio::State state)
{
qWarning() << "state = " << state;
}

View File

@@ -110,11 +110,9 @@ private:
QByteArray m_buffer; QByteArray m_buffer;
private slots: private slots:
void notified();
void pullTimerExpired(); void pullTimerExpired();
void toggleMode(); void toggleMode();
void toggleSuspendResume(); void toggleSuspendResume();
void handleStateChanged(QAudio::State state);
void deviceChanged(int index); void deviceChanged(int index);
void volumeChanged(int); void volumeChanged(int);
}; };

View File

@@ -97,21 +97,16 @@ Rectangle {
} }
function initialize() { function initialize() {
console.log("[qmlvideo] Content.initialize: contentType " + contentType)
if ("video" == contentType) { if ("video" == contentType) {
console.log("[qmlvideo] Content.initialize: loading VideoItem.qml")
contentLoader.source = "VideoItem.qml" contentLoader.source = "VideoItem.qml"
if (Loader.Error == contentLoader.status) { if (Loader.Error == contentLoader.status) {
console.log("[qmlvideo] Content.initialize: loading VideoDummy.qml")
contentLoader.source = "VideoDummy.qml" contentLoader.source = "VideoDummy.qml"
dummy = true dummy = true
} }
contentLoader.item.volume = volume contentLoader.item.volume = volume
} else if ("camera" == contentType) { } else if ("camera" == contentType) {
console.log("[qmlvideo] Content.initialize: loading CameraItem.qml")
contentLoader.source = "CameraItem.qml" contentLoader.source = "CameraItem.qml"
if (Loader.Error == contentLoader.status) { if (Loader.Error == contentLoader.status) {
console.log("[qmlvideo] Content.initialize: loading CameraDummy.qml")
contentLoader.source = "CameraDummy.qml" contentLoader.source = "CameraDummy.qml"
dummy = true dummy = true
} }
@@ -127,12 +122,10 @@ Rectangle {
if (root.autoStart) if (root.autoStart)
root.start() root.start()
} }
console.log("[qmlvideo] Content.initialize: complete")
root.initialized() root.initialized()
} }
function start() { function start() {
console.log("[qmlvideo] Content.start")
if (contentLoader.item) { if (contentLoader.item) {
if (root.contentType == "video") if (root.contentType == "video")
contentLoader.item.mediaSource = root.source contentLoader.item.mediaSource = root.source
@@ -142,7 +135,6 @@ Rectangle {
} }
function stop() { function stop() {
console.log("[qmlvideo] Content.stop")
if (contentLoader.item) { if (contentLoader.item) {
contentLoader.item.stop() contentLoader.item.stop()
if (root.contentType == "video") if (root.contentType == "video")

View File

@@ -67,7 +67,6 @@ Scene {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
console.log("[qmlvideo] SceneBasic.onClicked, started = " + content.started)
if (content.started) if (content.started)
content.stop() content.stop()
else else

View File

@@ -65,7 +65,6 @@ Rectangle {
} }
function init() { function init() {
console.log("[qmlvideo] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
source = enabled ? "../performancemonitor/PerformanceItem.qml" : "" source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
} }
@@ -137,7 +136,6 @@ Rectangle {
} }
radius: 10 radius: 10
onSceneSourceChanged: { onSceneSourceChanged: {
console.log("[qmlvideo] main.onSceneSourceChanged source " + sceneSource)
sceneLoader.source = sceneSource sceneLoader.source = sceneSource
var scene = null var scene = null
var innerVisible = true var innerVisible = true
@@ -224,7 +222,6 @@ Rectangle {
} }
function closeScene() { function closeScene() {
console.log("[qmlvideo] main.closeScene")
sceneSelectionPanel.sceneSource = "" sceneSelectionPanel.sceneSource = ""
} }
} }

View File

@@ -32,7 +32,6 @@
****************************************************************************/ ****************************************************************************/
#include "filereader.h" #include "filereader.h"
#include "trace.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDir> #include <QDir>
@@ -42,7 +41,6 @@
QString FileReader::readFile(const QString &fileName) QString FileReader::readFile(const QString &fileName)
{ {
qtTrace() << "FileReader::readFile" << "fileName" << fileName;
QString content; QString content;
QFile file(fileName); QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) { if (file.open(QIODevice::ReadOnly)) {

View File

@@ -84,7 +84,6 @@ Rectangle {
} }
onEffectSourceChanged: { onEffectSourceChanged: {
console.log("[qmlvideofx] Content.onEffectSourceChanged " + effectSource)
effectLoader.source = effectSource effectLoader.source = effectSource
effectLoader.item.parent = root effectLoader.item.parent = root
effectLoader.item.targetWidth = root.width effectLoader.item.targetWidth = root.width
@@ -96,7 +95,6 @@ Rectangle {
} }
function init() { function init() {
console.log("[qmlvideofx] Content.init")
openImage("qrc:/images/qt-logo.png") openImage("qrc:/images/qt-logo.png")
root.effectSource = "EffectPassThrough.qml" root.effectSource = "EffectPassThrough.qml"
} }
@@ -107,7 +105,6 @@ Rectangle {
} }
function updateSource() { function updateSource() {
console.log("[qmlvideofx] Content.updateSource")
if (contentLoader.item) { if (contentLoader.item) {
contentLoader.item.parent = root contentLoader.item.parent = root
contentLoader.item.anchors.fill = root contentLoader.item.anchors.fill = root
@@ -118,7 +115,6 @@ Rectangle {
} }
function openImage(path) { function openImage(path) {
console.log("[qmlvideofx] Content.openImage \"" + path + "\"")
stop() stop()
contentLoader.source = "ContentImage.qml" contentLoader.source = "ContentImage.qml"
videoFramePaintedConnection.target = null videoFramePaintedConnection.target = null
@@ -127,7 +123,6 @@ Rectangle {
} }
function openVideo(path) { function openVideo(path) {
console.log("[qmlvideofx] Content.openVideo \"" + path + "\"")
stop() stop()
contentLoader.source = "ContentVideo.qml" contentLoader.source = "ContentVideo.qml"
videoFramePaintedConnection.target = contentLoader.item videoFramePaintedConnection.target = contentLoader.item
@@ -138,7 +133,6 @@ Rectangle {
} }
function openCamera() { function openCamera() {
console.log("[qmlvideofx] Content.openCamera")
stop() stop()
contentLoader.source = "ContentCamera.qml" contentLoader.source = "ContentCamera.qml"
videoFramePaintedConnection.target = contentLoader.item videoFramePaintedConnection.target = contentLoader.item
@@ -146,7 +140,6 @@ Rectangle {
} }
function stop() { function stop() {
console.log("[qmlvideofx] Content.stop")
if (contentLoader.source == "ContentVideo.qml") if (contentLoader.source == "ContentVideo.qml")
contentLoader.item.stop() contentLoader.item.stop()
theSource.sourceItem = null theSource.sourceItem = null

View File

@@ -160,7 +160,6 @@ Rectangle {
Loader { Loader {
id: performanceLoader id: performanceLoader
function init() { function init() {
console.log("[qmlvideofx] performanceLoader.init logging " + root.perfMonitorsLogging + " visible " + root.perfMonitorsVisible)
var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible var enabled = root.perfMonitorsLogging || root.perfMonitorsVisible
source = enabled ? "../performancemonitor/PerformanceItem.qml" : "" source = enabled ? "../performancemonitor/PerformanceItem.qml" : ""
} }
@@ -249,11 +248,6 @@ Rectangle {
height = windowHeight height = windowHeight
width = windowWidth width = windowWidth
console.log("[qmlvideofx] root.init")
console.log("Height: ", Screen.desktopAvailableHeight)
console.log("Width: ", Screen.desktopAvailableWidth)
console.log("Pixels per mm: ", Math.ceil(Screen.pixelDensity))
console.log("Orientation: ", Screen.orientation)
imageFileBrowser.folder = imagePath imageFileBrowser.folder = imagePath
videoFileBrowser.folder = videoPath videoFileBrowser.folder = videoPath
content.init() content.init()

View File

@@ -125,7 +125,6 @@ void FrequencyMonitorPrivate::calculateAverageFrequency()
void FrequencyMonitorPrivate::stalled() void FrequencyMonitorPrivate::stalled()
{ {
if (m_instantaneousFrequency) { if (m_instantaneousFrequency) {
qtVerboseTrace() << "FrequencyMonitor::stalled";
m_instantaneousFrequency = 0; m_instantaneousFrequency = 0;
emit q_ptr->instantaneousFrequencyChanged(m_instantaneousFrequency); emit q_ptr->instantaneousFrequencyChanged(m_instantaneousFrequency);
emit q_ptr->frequencyChanged(); emit q_ptr->frequencyChanged();
@@ -136,7 +135,6 @@ FrequencyMonitor::FrequencyMonitor(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
d_ptr = new FrequencyMonitorPrivate(this); d_ptr = new FrequencyMonitorPrivate(this);
qtTrace() << "FrequencyMonitor::FrequencyMonitor";
} }
FrequencyMonitor::~FrequencyMonitor() FrequencyMonitor::~FrequencyMonitor()

View File

@@ -281,6 +281,9 @@ void QDeclarativeRadioData::_q_availabilityChanged(QMultimedia::AvailabilityStat
void QDeclarativeRadioData::connectSignals() void QDeclarativeRadioData::connectSignals()
{ {
if (!m_radioData)
return;
connect(m_radioData, SIGNAL(programTypeChanged(QRadioData::ProgramType)), this, connect(m_radioData, SIGNAL(programTypeChanged(QRadioData::ProgramType)), this,
SLOT(_q_programTypeChanged(QRadioData::ProgramType))); SLOT(_q_programTypeChanged(QRadioData::ProgramType)));