- /* Fill with black... */
- shared_ptr<const ImageProxy> filler_image = make_shared<RawImageProxy> (_black_image);
- Part filler_part = PART_WHOLE;
-
- /* ...unless there's some video we can fill with */
- if (!_decoded.empty ()) {
- filler_image = _decoded.back().image;
- filler_part = _decoded.back().part;
- }
-
- for (Frame i = from; i < to; ++i) {
-#ifdef DCPOMATIC_DEBUG
- test_gaps++;
-#endif
- _decoded.push_back (
- ContentVideo (filler_image, VideoFrame (i, eye), filler_part)
- );
- }
-}
-
-/** Fill _decoded from `from' up to, but not including, `to'
- * adding both left and right eye frames.
- */
-void
-VideoDecoder::fill_both_eyes (VideoFrame from, VideoFrame to)
-{
- /* Fill with black... */
- shared_ptr<const ImageProxy> filler_left_image = make_shared<RawImageProxy> (_black_image);
- shared_ptr<const ImageProxy> filler_right_image = make_shared<RawImageProxy> (_black_image);
- Part filler_left_part = PART_WHOLE;
- Part filler_right_part = PART_WHOLE;
-
- /* ...unless there's some video we can fill with */
- for (list<ContentVideo>::const_reverse_iterator i = _decoded.rbegin(); i != _decoded.rend(); ++i) {
- if (i->frame.eyes() == EYES_LEFT && !filler_left_image) {
- filler_left_image = i->image;
- filler_left_part = i->part;
- } else if (i->frame.eyes() == EYES_RIGHT && !filler_right_image) {
- filler_right_image = i->image;
- filler_right_part = i->part;
- }
-
- if (filler_left_image && filler_right_image) {
- break;
- }
- }
-
- while (from != to) {
-
-#ifdef DCPOMATIC_DEBUG
- test_gaps++;
-#endif
-
- _decoded.push_back (
- ContentVideo (
- from.eyes() == EYES_LEFT ? filler_left_image : filler_right_image,
- from,
- from.eyes() == EYES_LEFT ? filler_left_part : filler_right_part
- )
- );
-
- ++from;
- }
-}
-
-/** Called by decoder classes when they have a video frame ready */
-void
-VideoDecoder::give (shared_ptr<const ImageProxy> image, Frame frame)
-{
- if (_ignore) {
- return;
- }
-
- _log->log (String::compose ("VD receives %1", frame), LogEntry::TYPE_DEBUG_DECODE);
-
- /* Work out what we are going to push into _decoded next */
- list<ContentVideo> to_push;