1 #include "lib/colour_conversion.h"
2 #include "lib/content.h"
5 #include "lib/fastvideo_player_video_preparer.h"
6 #include "lib/j2k_image_proxy.h"
7 #include "lib/player_video.h"
10 #include <boost/optional.hpp>
11 #include <boost/shared_ptr.hpp>
12 #include <boost/test/unit_test.hpp>
17 using boost::optional;
18 using boost::shared_ptr;
19 using boost::weak_ptr;
24 pixel_format (AVPixelFormat)
26 return AV_PIX_FMT_RGB24;
30 BOOST_AUTO_TEST_CASE (fastvideo_preparer_setup_teardown_test)
32 FastvideoPlayerVideoPreparer preparer (&pixel_format, true, true);
36 BOOST_AUTO_TEST_CASE (fastvideo_preparer_simple_decode_test)
38 FastvideoPlayerVideoPreparer preparer (&pixel_format, true, true);
40 shared_ptr<J2KImageProxy> proxy(new J2KImageProxy("test/data/sizing_card_flat.j2k", dcp::Size(1998, 1080), AV_PIX_FMT_XYZ12));
42 vector<shared_ptr<PlayerVideo> > videos;
44 for (int i = 0; i < 16; ++i) {
45 shared_ptr<PlayerVideo> pv(
47 proxy, Crop(), optional<double>(), dcp::Size(1998, 1080), dcp::Size(1998, 1080),
48 EYES_BOTH, PART_WHOLE, optional<ColourConversion>(), VIDEO_RANGE_FULL, weak_ptr<Content>(), optional<Frame>(), false
52 preparer.request (pv);
53 videos.push_back (pv);
56 dcpomatic_sleep_seconds (5);
58 std::cout << "____-> get an image.\n";
59 videos[0]->image_proxy()->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGBA, true, true)->as_png().write("/home/carl/foo.png");