- /* Clean up _decoded_video; keep the frame we are returning, but nothing before that */
- while (!_decoded_video.empty() && _decoded_video.front().frame < dec.front().frame) {
- _decoded_video.pop_front ();
- }
-
- return dec;
-}
-
-
-/** Called by subclasses when they have a video frame ready */
-void
-VideoDecoder::video (shared_ptr<const ImageProxy> image, VideoFrame frame)
-{
- /* We may receive the same frame index twice for 3D, and we need to know
- when that happens.
- */
- _same = (!_decoded_video.empty() && frame == _decoded_video.back().frame);
-
- /* Fill in gaps */
- /* XXX: 3D */
-
- while (!_decoded_video.empty () && (_decoded_video.back().frame + 1) < frame) {
-#ifdef DCPOMATIC_DEBUG
- test_gaps++;
-#endif
- _decoded_video.push_back (
- ContentVideo (
- _decoded_video.back().image,
- _decoded_video.back().eyes,
- _decoded_video.back().part,
- _decoded_video.back().frame + 1
- )
- );
- }
-
- switch (_video_content->video_frame_type ()) {
- case VIDEO_FRAME_TYPE_2D:
- _decoded_video.push_back (ContentVideo (image, EYES_BOTH, PART_WHOLE, frame));
+ switch (vft) {
+ case VideoFrameType::TWO_D:
+ case VideoFrameType::THREE_D:
+ Data (ContentVideo (image, frame, eyes, Part::WHOLE));