X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fvideo_content_scale_test.cc;h=67bfda3e5afae3f6e2f6c81a091b949d53ac6f8e;hb=eee043737998021bb36fa202d68f1d7543f6ca6d;hp=e297d0cd231fcf38dee6e8af7c6726ddeb1c1893;hpb=422be0eece2bf6ee80db1d3c21553cd82efff789;p=dcpomatic.git diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index e297d0cd2..67bfda3e5 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -18,52 +18,58 @@ */ -#include +/** @file test/video_content_scale_test.cc + * @brief Test VideoContentScale + * @ingroup selfcontained + */ + #include "lib/ffmpeg_content.h" #include "lib/ratio.h" #include "lib/video_content.h" +#include +#include using std::list; using std::string; using std::cerr; using boost::shared_ptr; using boost::optional; +using dcp::raw_convert; static void test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop crop, Ratio const * ratio, bool scale, dcp::Size correct) { shared_ptr film; - locked_stringstream s; - s << "" + string s = "" "" "FFmpeg" - "/home/c.hetherington/DCP/prophet_clip.mkv" + "/home/c.hetherington/DCP/prophet_long_clip.mkv" "f3f23663da5bef6d2cbaa0db066f3351314142710" "0" "0" "0" "2879" - "" << content_size.width << "" - "" << content_size.height << "" + "" + raw_convert(content_size.width) + "" + "" + raw_convert(content_size.height) + "" "23.97602462768555" "23.97602462768555" "0" "1" "12" - "" << crop.left << "" - "" << crop.right << "" - "" << crop.top << "" - "" << crop.bottom << "" + "" + raw_convert(crop.left) + "" + "" + raw_convert(crop.right) + "" + "" + raw_convert(crop.top) + "" + "" + raw_convert(crop.bottom) + "" ""; if (ratio) { - s << "" << ratio->id() << ""; + s += "" + ratio->id() + ""; } else { - s << "" << scale << ""; + s += "" + string(scale ? "1" : "0") + ""; } - s << "" + s += "" "" "2.4" "1" @@ -87,10 +93,10 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop ""; shared_ptr doc (new cxml::Document ()); - doc->read_string(s.str ()); + doc->read_string (s); list notes; - shared_ptr vc (new FFmpegContent (film, doc, 10, notes)); + shared_ptr vc (new FFmpegContent (doc, 10, notes)); optional sc; if (ratio) {