X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fvideo_decoder.cc;h=144a494dcd48fc5a6cd9916d4d9a7d40c90fd2e5;hb=e6f28e7cda23c1ba3c49cc1bf2dc1491c2f87160;hp=a3b45716c532887473d76c17f50957bf80dba5ac;hpb=e8c1880a2b9a40eb11ee259feee3edd799139a43;p=dcpomatic.git diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index a3b45716c..144a494dc 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -26,33 +26,35 @@ using std::cout; using boost::shared_ptr; using boost::optional; -VideoDecoder::VideoDecoder (shared_ptr f, shared_ptr c) - : Decoder (f) - , _video_content (c) +VideoDecoder::VideoDecoder (shared_ptr c) + : _video_content (c) { } /** Called by subclasses when they have a video frame ready */ void -VideoDecoder::video (shared_ptr image, bool same, VideoFrame frame) +VideoDecoder::video (shared_ptr image, bool same, ContentTime time) { switch (_video_content->video_frame_type ()) { case VIDEO_FRAME_TYPE_2D: - _pending.push_back (shared_ptr (new DecodedVideo (image, EYES_BOTH, same, frame))); + _pending.push_back (shared_ptr (new DecodedVideo (time, image, EYES_BOTH, same))); + break; + case VIDEO_FRAME_TYPE_3D_ALTERNATE: + Video (image, (frame % 2) ? EYES_RIGHT : EYES_LEFT, same); break; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: { int const half = image->size().width / 2; - _pending.push_back (shared_ptr (new DecodedVideo (image->crop (Crop (0, half, 0, 0), true), EYES_LEFT, same, frame))); - _pending.push_back (shared_ptr (new DecodedVideo (image->crop (Crop (half, 0, 0, 0), true), EYES_RIGHT, same, frame))); + _pending.push_back (shared_ptr (new DecodedVideo (time, image->crop (Crop (0, half, 0, 0), true), EYES_LEFT, same))); + _pending.push_back (shared_ptr (new DecodedVideo (time, image->crop (Crop (half, 0, 0, 0), true), EYES_RIGHT, same))); break; } case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM: { int const half = image->size().height / 2; - _pending.push_back (shared_ptr (new DecodedVideo (image->crop (Crop (0, 0, 0, half), true), EYES_LEFT, same, frame))); - _pending.push_back (shared_ptr (new DecodedVideo (image->crop (Crop (0, 0, half, 0), true), EYES_RIGHT, same, frame))); + _pending.push_back (shared_ptr (new DecodedVideo (time, image->crop (Crop (0, 0, 0, half), true), EYES_LEFT, same))); + _pending.push_back (shared_ptr (new DecodedVideo (time, image->crop (Crop (0, 0, half, 0), true), EYES_RIGHT, same))); break; } default: