summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-04 13:10:28 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-04 13:10:28 +0100
commit4a74ca2cb973585122e84c21ff48ff4ff1ebd488 (patch)
treee73cc4ef0850326f1f45037b0c22ab00a0f94685 /test
parent418f17235e05d5f8c449e848c6a81e1b9017bd8a (diff)
Back-port v2's rename and slight extension of FrameRateConversion.
Diffstat (limited to 'test')
-rw-r--r--test/frame_rate_test.cc39
1 files changed, 20 insertions, 19 deletions
diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc
index fdfdcf452..8981a9d7e 100644
--- a/test/frame_rate_test.cc
+++ b/test/frame_rate_test.cc
@@ -22,11 +22,12 @@
#include "lib/config.h"
#include "lib/ffmpeg_content.h"
#include "lib/playlist.h"
+#include "lib/frame_rate_change.h"
#include "test.h"
using boost::shared_ptr;
-/* Test Playlist::best_dcp_frame_rate and FrameRateConversion
+/* Test Playlist::best_dcp_frame_rate and FrameRateChange
with a single piece of content.
*/
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
@@ -47,7 +48,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 60;
int best = film->playlist()->best_dcp_frame_rate ();
- FrameRateConversion frc = FrameRateConversion (60, best);
+ FrameRateChange frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, true);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -55,7 +56,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 50;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (50, best);
+ frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, true);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -63,7 +64,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 48;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (48, best);
+ frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, true);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -71,7 +72,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 30;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (30, best);
+ frc = FrameRateChange (30, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -79,7 +80,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 29.97;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (29.97, best);
+ frc = FrameRateChange (29.97, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -87,7 +88,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 25;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (25, best);
+ frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -95,7 +96,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 24;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (24, best);
+ frc = FrameRateChange (24, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -103,7 +104,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 14.5;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (14.5, best);
+ frc = FrameRateChange (14.5, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 2);
@@ -111,7 +112,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 12.6;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (12.6, best);
+ frc = FrameRateChange (12.6, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 2);
@@ -119,7 +120,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 12.4;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (12.4, best);
+ frc = FrameRateChange (12.4, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 2);
@@ -127,7 +128,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 12;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (12, best);
+ frc = FrameRateChange (12, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 2);
@@ -144,7 +145,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 60;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (60, best);
+ frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 60);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -152,7 +153,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 50;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (50, best);
+ frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 50);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -160,7 +161,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 48;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (48, best);
+ frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 48);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
@@ -168,7 +169,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
/* Check some out-there conversions (not the best) */
- frc = FrameRateConversion (14.99, 24);
+ frc = FrameRateChange (14.99, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 2);
BOOST_CHECK_EQUAL (frc.change_speed, true);
@@ -181,14 +182,14 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
content->_video_frame_rate = 25;
best = film->playlist()->best_dcp_frame_rate ();
- frc = FrameRateConversion (25, best);
+ frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_EQUAL (frc.repeat, 1);
BOOST_CHECK_EQUAL (frc.change_speed, true);
}
-/* Test Playlist::best_dcp_frame_rate and FrameRateConversion
+/* Test Playlist::best_dcp_frame_rate and FrameRateChange
with two pieces of content.
*/
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
@@ -266,7 +267,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
content->_video_frame_rate = 14.99;
film->set_video_frame_rate (25);
content->set_audio_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream ("a", 42, 16000, 0)));
- /* The FrameRateConversion within output_audio_frame_rate should choose to double-up
+ /* The FrameRateChange within output_audio_frame_rate should choose to double-up
the 14.99 fps video to 30 and then run it slow at 25.
*/
BOOST_CHECK_EQUAL (content->output_audio_frame_rate(), rint (48000 * 2 * 14.99 / 25));