Commit ca1b22ee authored by Wieland Morgenstern's avatar Wieland Morgenstern

readerControllerTest: new load API with std::list

parent b651b927
...@@ -113,7 +113,7 @@ void testAsyncLoading() { ...@@ -113,7 +113,7 @@ void testAsyncLoading() {
ENSURE(preloadedFrames >= numReaders, "Controller init should start pre-loading at least one frame per reader"); ENSURE(preloadedFrames >= numReaders, "Controller init should start pre-loading at least one frame per reader");
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
mtime_t date; mtime_t date;
......
...@@ -117,7 +117,7 @@ void testLoadedDate() { ...@@ -117,7 +117,7 @@ void testLoadedDate() {
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
readerController->load(date, frames, audio, metadata); readerController->load(date, frames, audio, metadata);
...@@ -198,7 +198,7 @@ void testLoadedDateWithAudioReader() { ...@@ -198,7 +198,7 @@ void testLoadedDateWithAudioReader() {
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
readerController->load(date, frames, audio, metadata); readerController->load(date, frames, audio, metadata);
...@@ -240,7 +240,7 @@ void testSeekWithImage() { ...@@ -240,7 +240,7 @@ void testSeekWithImage() {
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
readerController->load(date, frames, audio, metadata); readerController->load(date, frames, audio, metadata);
...@@ -294,7 +294,7 @@ void testEOSAudio() { ...@@ -294,7 +294,7 @@ void testEOSAudio() {
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
std::tuple<Input::ReadStatus, Input::ReadStatus, Input::ReadStatus> status = std::tuple<Input::ReadStatus, Input::ReadStatus, Input::ReadStatus> status =
...@@ -326,7 +326,7 @@ void testTryAgainAudio() { ...@@ -326,7 +326,7 @@ void testTryAgainAudio() {
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
std::tuple<Input::ReadStatus, Input::ReadStatus, Input::ReadStatus> status = std::tuple<Input::ReadStatus, Input::ReadStatus, Input::ReadStatus> status =
...@@ -357,7 +357,7 @@ void testAudioVideoResync() { ...@@ -357,7 +357,7 @@ void testAudioVideoResync() {
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
std::tuple<Input::ReadStatus, Input::ReadStatus, Input::ReadStatus> status = std::tuple<Input::ReadStatus, Input::ReadStatus, Input::ReadStatus> status =
...@@ -378,7 +378,7 @@ void testAudioVideoResync() { ...@@ -378,7 +378,7 @@ void testAudioVideoResync() {
} }
iBlk++; iBlk++;
} }
ENSURE_EQ(date, audio[0][0][0].getTimestamp(), "audio and video should be synchro"); ENSURE_EQ(date, audio.front()[0][0].getTimestamp(), "audio and video should be synchro");
readerController->releaseBuffer(frames); readerController->releaseBuffer(frames);
} }
...@@ -421,7 +421,7 @@ void testInputGroups(int fps, ReaderClockResolution clockResolution) { ...@@ -421,7 +421,7 @@ void testInputGroups(int fps, ReaderClockResolution clockResolution) {
} }
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
...@@ -536,7 +536,7 @@ void testCurrentFrame() { ...@@ -536,7 +536,7 @@ void testCurrentFrame() {
ENSURE(readerController.status()); ENSURE(readerController.status());
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t date; mtime_t date;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
...@@ -660,7 +660,7 @@ void testAudioVideoSynchro() { ...@@ -660,7 +660,7 @@ void testAudioVideoSynchro() {
auto readerController = Core::ReaderController::create(*panoDef, *audioPipe, readerFactory); auto readerController = Core::ReaderController::create(*panoDef, *audioPipe, readerFactory);
ENSURE(readerController.status()); ENSURE(readerController.status());
std::map<readerid_t, Input::PotentialFrame> frames; std::map<readerid_t, Input::PotentialFrame> frames;
std::vector<Audio::audioBlockGroupMap_t> audio; std::list<Audio::audioBlockGroupMap_t> audio;
mtime_t videoDate; mtime_t videoDate;
Input::MetadataChunk metadata; Input::MetadataChunk metadata;
...@@ -675,11 +675,11 @@ void testAudioVideoSynchro() { ...@@ -675,11 +675,11 @@ void testAudioVideoSynchro() {
1.5); 1.5);
ENSURE_EQ(nbAudioBlocksExpected, audio.size(), "Check number of audio blocks at the first load"); ENSURE_EQ(nbAudioBlocksExpected, audio.size(), "Check number of audio blocks at the first load");
// Check that the first audio frame of the audio video group are well synchronized // Check that the first audio frame of the audio video group are well synchronized
ENSURE_EQ(videoDate, audio[0].at(audioVideoGrId).at(0).getTimestamp(), ENSURE_EQ(videoDate, audio.front().at(audioVideoGrId).at(0).getTimestamp(),
"Check audio video synchronization of the audio video group"); "Check audio video synchronization of the audio video group");
ENSURE_EQ(videoDate, audio[0].at(audioVideoGrId).at(1).getTimestamp(), ENSURE_EQ(videoDate, audio.front().at(audioVideoGrId).at(1).getTimestamp(),
"Check audio video synchronization of the audio video group"); "Check audio video synchronization of the audio video group");
ENSURE_EQ(videoDate, audio[0].at(audioOnlyGrId).at(2).getTimestamp(), ENSURE_EQ(videoDate, audio.front().at(audioOnlyGrId).at(2).getTimestamp(),
"Check audio video synchronization of the audio video group"); "Check audio video synchronization of the audio video group");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment