*/
+
/** @file test/frame_rate_test.cc
* @brief Tests for FrameRateChange and the computation of the best
* frame rate for the DCP.
* @ingroup feature
*/
-#include <boost/test/unit_test.hpp>
-#include "lib/film.h"
+
+#include "lib/audio_content.h"
#include "lib/config.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/playlist.h"
#include "lib/ffmpeg_audio_stream.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
#include "lib/frame_rate_change.h"
+#include "lib/playlist.h"
#include "lib/video_content.h"
-#include "lib/audio_content.h"
#include "test.h"
+#include <boost/test/unit_test.hpp>
+
-using boost::shared_ptr;
/* Test Playlist::best_dcp_frame_rate and FrameRateChange
with a single piece of content.
*/
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single)
{
- shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_single");
+ auto film = new_test_film("best_dcp_frame_rate_test_single");
/* Get any piece of content, it doesn't matter what */
- shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/test.mp4"));
+ auto content = std::make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
content->_video_frame_rate = 60;
int best = film->best_video_frame_rate ();
- FrameRateChange frc = FrameRateChange (60, best);
+ auto frc = FrameRateChange(60, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.skip, true);
BOOST_CHECK_EQUAL (frc.repeat, 1);
*/
BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double)
{
- shared_ptr<Film> film = new_test_film ("best_dcp_frame_rate_test_double");
+ auto film = new_test_film("best_dcp_frame_rate_test_double");
/* Get any old content, it doesn't matter what */
- shared_ptr<FFmpegContent> A (new FFmpegContent("test/data/test.mp4"));
+ auto A = std::make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (A);
- shared_ptr<FFmpegContent> B (new FFmpegContent("test/data/test.mp4"));
+ auto B = std::make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (B);
BOOST_REQUIRE (!wait_for_jobs());
BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
{
- shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
+ auto film = new_test_film("audio_sampling_rate_test");
/* Get any piece of content, it doesn't matter what */
- shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/test.mp4"));
+ auto content = std::make_shared<FFmpegContent>("test/data/test.mp4");
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
afr.push_back (30);
Config::instance()->set_allowed_dcp_frame_rates (afr);
- shared_ptr<FFmpegAudioStream> stream (new FFmpegAudioStream ("foo", 0, 0, 0, 0));
+ auto stream = std::make_shared<FFmpegAudioStream>("foo", 0, 0, 0, 0, 0);
content->audio.reset (new AudioContent (content.get()));
content->audio->add_stream (stream);
content->_video_frame_rate = 24;