summaryrefslogtreecommitdiff
path: root/test/video_decoder_fill_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-13 16:09:07 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-13 16:09:07 +0100
commitcd29c4ed26fde9b9c07190f92205705b13c6bd73 (patch)
treeb90771925ef9d92faaf1d1fce574f30cfe5be2bc /test/video_decoder_fill_test.cc
parent78012b8cf9b4c6e35b425c97b6432551ce635c3a (diff)
Fix VideoDecoder::get_video() with 3D.
get_video() promises to return all video frames at the given time, but this wasn't working for none-SBS-3D as it would be satisfied when it got the first (left) frame. Adjust get_video() to get all required frames. This showed up bugs in fill_both_eyes, whereby the from parameter was ignored and the wrong things were done in some cases; video_decoder_fill_test.cc tests this stuff.
Diffstat (limited to 'test/video_decoder_fill_test.cc')
-rw-r--r--test/video_decoder_fill_test.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/video_decoder_fill_test.cc b/test/video_decoder_fill_test.cc
index da23b2775..737bc883c 100644
--- a/test/video_decoder_fill_test.cc
+++ b/test/video_decoder_fill_test.cc
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test2)
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
ImageDecoder decoder (c, film->log());
- decoder.video->fill_both_eyes (0, 4, EYES_LEFT);
+ decoder.video->fill_both_eyes (0, EYES_LEFT, 4, EYES_LEFT);
BOOST_CHECK_EQUAL (decoder.video->_decoded.size(), 8);
list<ContentVideo>::iterator i = decoder.video->_decoded.begin();
for (int j = 0; j < 8; ++j) {
@@ -71,7 +71,8 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test2)
++i;
}
- decoder.video->fill_both_eyes (0, 7, EYES_RIGHT);
+ decoder.video->_decoded.clear ();
+ decoder.video->fill_both_eyes (0, EYES_LEFT, 7, EYES_RIGHT);
BOOST_CHECK_EQUAL (decoder.video->_decoded.size(), 15);
i = decoder.video->_decoded.begin();
for (int j = 0; j < 15; ++j) {
@@ -79,4 +80,14 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test2)
BOOST_CHECK_EQUAL (i->eyes, (j % 2) == 0 ? EYES_LEFT : EYES_RIGHT);
++i;
}
+
+ decoder.video->_decoded.clear ();
+ decoder.video->fill_both_eyes (0, EYES_RIGHT, 7, EYES_RIGHT);
+ BOOST_CHECK_EQUAL (decoder.video->_decoded.size(), 14);
+ i = decoder.video->_decoded.begin();
+ for (int j = 0; j < 14; ++j) {
+ BOOST_CHECK_EQUAL (i->frame, (j + 1) / 2);
+ BOOST_CHECK_EQUAL (i->eyes, (j % 2) == 0 ? EYES_RIGHT : EYES_LEFT);
+ ++i;
+ }
}