Added QMediaRecorder::actualLocation property
To report the actual location file was written. Change-Id: Ibb56a720a258a1e5cedceaf0f9bcea73fb93bc96 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
a26bf6c8b6
commit
ba37f73d44
@@ -210,6 +210,7 @@ void tst_QMediaRecorder::testNullControls()
|
||||
|
||||
recorder.setOutputLocation(QUrl("file://test/save/file.mp4"));
|
||||
QCOMPARE(recorder.outputLocation(), QUrl());
|
||||
QCOMPARE(recorder.actualLocation(), QUrl());
|
||||
|
||||
QAudioEncoderSettings audio;
|
||||
audio.setCodec(id);
|
||||
@@ -285,6 +286,22 @@ void tst_QMediaRecorder::testSink()
|
||||
capture->setOutputLocation(QUrl("test.tmp"));
|
||||
QUrl s = capture->outputLocation();
|
||||
QCOMPARE(s.toString(), QString("test.tmp"));
|
||||
QCOMPARE(capture->actualLocation(), QUrl());
|
||||
|
||||
//the actual location is available after record
|
||||
capture->record();
|
||||
QCOMPARE(capture->actualLocation().toString(), QString("test.tmp"));
|
||||
capture->stop();
|
||||
QCOMPARE(capture->actualLocation().toString(), QString("test.tmp"));
|
||||
|
||||
//setOutputLocation resets the actual location
|
||||
capture->setOutputLocation(QUrl());
|
||||
QCOMPARE(capture->actualLocation(), QUrl());
|
||||
|
||||
capture->record();
|
||||
QCOMPARE(capture->actualLocation(), QUrl::fromLocalFile("default_name.mp4"));
|
||||
capture->stop();
|
||||
QCOMPARE(capture->actualLocation(), QUrl::fromLocalFile("default_name.mp4"));
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder::testRecord()
|
||||
|
||||
@@ -100,6 +100,9 @@ public slots:
|
||||
m_position=1;
|
||||
emit stateChanged(m_state);
|
||||
emit durationChanged(m_position);
|
||||
|
||||
QUrl actualLocation = m_sink.isEmpty() ? QUrl::fromLocalFile("default_name.mp4") : m_sink;
|
||||
emit actualLocationChanged(actualLocation);
|
||||
}
|
||||
|
||||
void pause()
|
||||
|
||||
Reference in New Issue
Block a user