diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-06-11 11:06:25 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-06-16 08:56:48 +0200 |
commit | 994bcb23af8399485ddfdd16d2ba34c20326b432 (patch) | |
tree | 6eab8c28f89c82382321becde133f8dba885bd81 /tests | |
parent | 52c8d7efdd4f783097dcec6e66f3e076cdbc88ca (diff) |
Kill QMediaEncoderBase
The class was only needed because of QMediaRecorder. Now
that that class is gone, we can move the enums into QMediaEncoder.
Also rename the State enum to RecorderState as per API review.
Change-Id: I2e0811e2c29f922265ac5a719226b647236e52b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/unit/mockbackend/qmockmediaencoder.h | 6 | ||||
-rw-r--r-- | tests/auto/unit/multimedia/qmediaencoder/tst_qmediaencoder.cpp | 22 |
2 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/unit/mockbackend/qmockmediaencoder.h b/tests/auto/unit/mockbackend/qmockmediaencoder.h index ecdf21e61..0a9530a98 100644 --- a/tests/auto/unit/mockbackend/qmockmediaencoder.h +++ b/tests/auto/unit/mockbackend/qmockmediaencoder.h @@ -57,7 +57,7 @@ public: return true; } - QMediaEncoder::State state() const + QMediaEncoder::RecorderState state() const { return m_state; } @@ -119,7 +119,7 @@ public: emit statusChanged(m_status); } - void setState(QMediaEncoder::State state) + void setState(QMediaEncoder::RecorderState state) { switch (state) { case QMediaEncoder::StoppedState: @@ -137,7 +137,7 @@ public: public: QMediaMetaData m_metaData; QUrl m_sink; - QMediaEncoder::State m_state; + QMediaEncoder::RecorderState m_state; QMediaEncoder::Status m_status; QMediaEncoderSettings m_settings; qint64 m_position; diff --git a/tests/auto/unit/multimedia/qmediaencoder/tst_qmediaencoder.cpp b/tests/auto/unit/multimedia/qmediaencoder/tst_qmediaencoder.cpp index bca09aca8..9261c6115 100644 --- a/tests/auto/unit/multimedia/qmediaencoder/tst_qmediaencoder.cpp +++ b/tests/auto/unit/multimedia/qmediaencoder/tst_qmediaencoder.cpp @@ -117,7 +117,7 @@ void tst_QMediaEncoder::testBasicSession() session.setEncoder(&recorder); QCOMPARE(recorder.outputLocation(), QUrl()); - QCOMPARE(recorder.state(), QMediaEncoder::StoppedState); + QCOMPARE(recorder.recorderState(), QMediaEncoder::StoppedState); QCOMPARE(recorder.error(), QMediaEncoder::NoError); QCOMPARE(recorder.duration(), qint64(0)); } @@ -136,7 +136,7 @@ void tst_QMediaEncoder::testNullControls() // session.setEncoder(&recorder); QCOMPARE(recorder.outputLocation(), QUrl()); - QCOMPARE(recorder.state(), QMediaEncoder::StoppedState); + QCOMPARE(recorder.recorderState(), QMediaEncoder::StoppedState); QCOMPARE(recorder.error(), QMediaEncoder::NoError); QCOMPARE(recorder.duration(), qint64(0)); @@ -158,20 +158,20 @@ void tst_QMediaEncoder::testNullControls() QCOMPARE(recorder.encoderSettings().videoCodec(), QMediaFormat::VideoCodec::VP9); QCOMPARE(recorder.encoderSettings().fileFormat(), QMediaFormat::MPEG4); - QSignalSpy spy(&recorder, SIGNAL(stateChanged(QMediaEncoder::State))); + QSignalSpy spy(&recorder, SIGNAL(stateChanged(QMediaEncoder::RecorderState))); recorder.record(); - QCOMPARE(recorder.state(), QMediaEncoder::StoppedState); + QCOMPARE(recorder.recorderState(), QMediaEncoder::StoppedState); QCOMPARE(recorder.error(), QMediaEncoder::NoError); QCOMPARE(spy.count(), 0); recorder.pause(); - QCOMPARE(recorder.state(), QMediaEncoder::StoppedState); + QCOMPARE(recorder.recorderState(), QMediaEncoder::StoppedState); QCOMPARE(recorder.error(), QMediaEncoder::NoError); QCOMPARE(spy.count(), 0); recorder.stop(); - QCOMPARE(recorder.state(), QMediaEncoder::StoppedState); + QCOMPARE(recorder.recorderState(), QMediaEncoder::StoppedState); QCOMPARE(recorder.error(), QMediaEncoder::NoError); QCOMPARE(spy.count(), 0); } @@ -237,16 +237,16 @@ void tst_QMediaEncoder::testSink() void tst_QMediaEncoder::testRecord() { - QSignalSpy stateSignal(encoder,SIGNAL(stateChanged(QMediaEncoder::State))); + QSignalSpy stateSignal(encoder,SIGNAL(stateChanged(QMediaEncoder::RecorderState))); QSignalSpy statusSignal(encoder,SIGNAL(statusChanged(QMediaEncoder::Status))); QSignalSpy progressSignal(encoder, SIGNAL(durationChanged(qint64))); encoder->record(); - QCOMPARE(encoder->state(), QMediaEncoder::RecordingState); + QCOMPARE(encoder->recorderState(), QMediaEncoder::RecordingState); QCOMPARE(encoder->error(), QMediaEncoder::NoError); QCOMPARE(encoder->errorString(), QString()); QCOMPARE(stateSignal.count(), 1); - QCOMPARE(stateSignal.last()[0].value<QMediaEncoder::State>(), QMediaEncoder::RecordingState); + QCOMPARE(stateSignal.last()[0].value<QMediaEncoder::RecorderState>(), QMediaEncoder::RecordingState); QTestEventLoop::instance().enterLoop(1); @@ -259,7 +259,7 @@ void tst_QMediaEncoder::testRecord() encoder->pause(); - QCOMPARE(encoder->state(), QMediaEncoder::PausedState); + QCOMPARE(encoder->recorderState(), QMediaEncoder::PausedState); QCOMPARE(stateSignal.count(), 2); @@ -271,7 +271,7 @@ void tst_QMediaEncoder::testRecord() encoder->stop(); - QCOMPARE(encoder->state(), QMediaEncoder::StoppedState); + QCOMPARE(encoder->recorderState(), QMediaEncoder::StoppedState); QCOMPARE(stateSignal.count(), 3); QTestEventLoop::instance().enterLoop(1); |