/** @file test/frame_rate_test.cc
* @brief Tests for FrameRateChange and the computation of the best
* frame rate for the DCP.
/** @file test/frame_rate_test.cc
* @brief Tests for FrameRateChange and the computation of the best
* frame rate for the DCP.
{
shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
/* Get any piece of content, it doesn't matter what */
{
shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
/* Get any piece of content, it doesn't matter what */
frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 60);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 60);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 50;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 50;
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 50);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 50);
BOOST_CHECK_EQUAL (frc.skip, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 48;
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
content->_video_frame_rate = 48;
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 48);
BOOST_CHECK_EQUAL (frc.skip, false);
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 48);
BOOST_CHECK_EQUAL (frc.skip, false);
{
shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
/* Get any old content, it doesn't matter what */
{
shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
/* Get any old content, it doesn't matter what */
{
shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
/* Get any piece of content, it doesn't matter what */
{
shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
/* Get any piece of content, it doesn't matter what */
content->_video_frame_rate = 24;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
content->_video_frame_rate = 24;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
content->_video_frame_rate = 23.976;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
content->_video_frame_rate = 23.976;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
content->_video_frame_rate = 29.97;
film->set_video_frame_rate (30);
BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
stream->_frame_rate = 48000;
content->_video_frame_rate = 29.97;
film->set_video_frame_rate (30);
BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
stream->_frame_rate = 48000;
content->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
content->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
content->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
content->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
/* The FrameRateChange within resampled_frame_rate should choose to double-up
the 14.99 fps video to 30 and then run it slow at 25.
*/
/* The FrameRateChange within resampled_frame_rate should choose to double-up
the 14.99 fps video to 30 and then run it slow at 25.
*/