diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-07-09 16:41:53 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-07-09 16:41:53 +0100 |
| commit | 424f9d0c70ff0832da0509776da939b2f855cdc1 (patch) | |
| tree | 619620d613bf1b9d8ade700a01df49469812e72b /src/lib/dcp_decoder.cc | |
| parent | 58c574239f98b03f253934d061d976bdb3e30899 (diff) | |
Use a new ImageProxy to hold J2K data from DCP content.
Diffstat (limited to 'src/lib/dcp_decoder.cc')
| -rw-r--r-- | src/lib/dcp_decoder.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 1939fc1c9..e23efba3e 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -62,23 +62,20 @@ DCPDecoder::pass () shared_ptr<dcp::PictureMXF> mxf = (*_reel)->main_picture()->mxf (); shared_ptr<dcp::MonoPictureMXF> mono = dynamic_pointer_cast<dcp::MonoPictureMXF> (mxf); shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf); - int64_t const ep = (*_reel)->main_picture()->entry_point (); + int64_t const entry_point = (*_reel)->main_picture()->entry_point (); + int64_t const frame = _next.frames (vfr); if (mono) { - shared_ptr<Image> image (new Image (PIX_FMT_RGB24, mxf->size(), false)); - mono->get_frame (ep + _next.frames (vfr))->rgb_frame (image->data()[0]); - shared_ptr<Image> aligned (new Image (image, true)); - video (shared_ptr<ImageProxy> (new RawImageProxy (aligned, _log)), _next.frames (vfr)); + video (shared_ptr<ImageProxy> (new J2KImageProxy (mono->get_frame (entry_point + frame), mxf->size(), _log)), frame); } else { - - shared_ptr<Image> left (new Image (PIX_FMT_RGB24, mxf->size(), false)); - stereo->get_frame (ep + _next.frames (vfr))->rgb_frame (dcp::EYE_LEFT, left->data()[0]); - shared_ptr<Image> aligned_left (new Image (left, true)); - video (shared_ptr<ImageProxy> (new RawImageProxy (aligned_left, _log)), _next.frames (vfr)); - - shared_ptr<Image> right (new Image (PIX_FMT_RGB24, mxf->size(), false)); - stereo->get_frame (ep + _next.frames (vfr))->rgb_frame (dcp::EYE_RIGHT, right->data()[0]); - shared_ptr<Image> aligned_right (new Image (right, true)); - video (shared_ptr<ImageProxy> (new RawImageProxy (aligned_right, _log)), _next.frames (vfr)); + video ( + shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_LEFT, _log)), + frame + ); + + video ( + shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_RIGHT, _log)), + frame + ); } } |
