diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-05 01:24:19 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-05 01:24:19 +0000 |
| commit | 5ee3348142f4cfafdbcf2c9c833843d717affc11 (patch) | |
| tree | 1c97c80eeccc6b5f515a611e35dee35b21d3b09b /test/imf_test.cc | |
| parent | 740938890d95e853cf13d4780a5d674c3d6c7f6f (diff) | |
Various IMF hacks.imf
Diffstat (limited to 'test/imf_test.cc')
| -rw-r--r-- | test/imf_test.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/imf_test.cc b/test/imf_test.cc index 3b95416b..0a3c8914 100644 --- a/test/imf_test.cc +++ b/test/imf_test.cc @@ -18,12 +18,40 @@ */ #include "imp.h" +#include "imp_cpl.h" +#include "sequence.h" +#include "segment.h" #include "test.h" +#include "resource.h" +#include "mono_picture_asset.h" +#include "mono_picture_frame.h" #include <boost/test/unit_test.hpp> +using boost::shared_ptr; + /** Simple test of reading an IMF package */ BOOST_AUTO_TEST_CASE (imf_test1) { dcp::IMP imp (private_test / "data" / "BelleSebastian2_TLR-2-2398_HD-239_DE-XX_CH_51_HD_PATH_20151229_DGL_SMPTE_IMPAPP2_OV"); imp.read (); + + BOOST_REQUIRE_EQUAL (imp.cpls().size(), 1); + shared_ptr<dcp::IMPCPL> cpl = imp.cpls().front (); + + BOOST_REQUIRE_EQUAL (cpl->segments().size(), 1); + shared_ptr<dcp::Segment> segment = cpl->segments().front (); + + BOOST_REQUIRE (segment->main_image ()); + shared_ptr<dcp::Sequence> main_image = segment->main_image (); + + BOOST_REQUIRE_EQUAL (main_image->resources().size(), 1); + shared_ptr<dcp::Resource> resource = main_image->resources().front (); + + BOOST_REQUIRE (resource->asset<dcp::MonoPictureAsset>()); + shared_ptr<dcp::MonoPictureAsset> picture = resource->asset<dcp::MonoPictureAsset> (); + + shared_ptr<const dcp::MonoPictureFrame> frame = picture->get_frame (100); + FILE* out = fopen ("/home/carl/piss.j2c", "wb"); + fwrite (frame->j2k_data(), 1, frame->j2k_size(), out); + fclose (out); } |
