summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-06-01 23:53:06 +0100
committerCarl Hetherington <cth@carlh.net>2016-06-01 23:53:06 +0100
commita68b877d96a9e9f366f27752e071bc0e895e9dc7 (patch)
tree11a32d1efd6abf182b03ce22f1f1fe84258bb7de /examples
parentf9cba324c8160a70b108d9e5b60a4ccad6ee9be2 (diff)
Add Reader classes to permit much more efficient DCP reading.
Diffstat (limited to 'examples')
-rw-r--r--examples/read_dcp.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/read_dcp.cc b/examples/read_dcp.cc
index 4e3f4836..6cc9b676 100644
--- a/examples/read_dcp.cc
+++ b/examples/read_dcp.cc
@@ -29,6 +29,7 @@
#include "reel_picture_asset.h"
#include "mono_picture_frame.h"
#include "mono_picture_asset.h"
+#include "mono_picture_asset_reader.h"
#include "stereo_picture_asset.h"
#include "sound_asset.h"
#include "subtitle_asset.h"
@@ -82,8 +83,11 @@ main ()
cpl->reels().front()->main_picture()->asset()
);
+ /* Get a reader for it */
+ boost::shared_ptr<dcp::MonoPictureAssetReader> picture_asset_reader = picture_asset->start_read();
+
/* Get the 1000th frame of it */
- boost::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_asset->get_frame(999);
+ boost::shared_ptr<const dcp::MonoPictureFrame> picture_frame_j2k = picture_asset_reader->get_frame(999);
/* Get the frame as an XYZ image */
boost::shared_ptr<const dcp::OpenJPEGImage> picture_image_xyz = picture_frame_j2k->xyz_image ();