From 0b6f2d7b04819711228ed5fbc5d299b58cef997e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 14 Jun 2016 15:07:58 +0100 Subject: Clean up of 3D->2D conversion. It makes slightly more sense to discard 2D in the Transcoder rather than the Encoder. Unfortunately this requires quite invasive changes, mainly to remove Encoder::_position and instead derive this information from the PlayerVideo that is being handled. This is also nicer than before, I think. A notable change is that in player.cc; using time rather than content_video_to_dcp(). This means we are assuming that the decoder returns video at the time we ask it to, rather than checking what it has returned. I can't think of a problem with this (yet). --- src/lib/transcoder.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/lib/transcoder.cc') diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc index fd44e4df7..c667a1486 100644 --- a/src/lib/transcoder.cc +++ b/src/lib/transcoder.cc @@ -36,6 +36,7 @@ #include "compose.hpp" #include "referenced_reel_asset.h" #include "subtitle_content.h" +#include "player_video.h" #include #include #include @@ -96,7 +97,22 @@ Transcoder::go () } for (DCPTime t; t < length; t += frame) { - _encoder->encode (_player->get_video (t, true)); + + BOOST_FOREACH (shared_ptr i, _player->get_video (t, true)) { + if (!_film->three_d()) { + /* 2D DCP */ + if (i->eyes() == EYES_RIGHT) { + /* Discard right-eye images */ + continue; + } else if (i->eyes() == EYES_LEFT) { + /* Use left-eye images for both eyes */ + i->set_eyes (EYES_BOTH); + } + } + + _encoder->encode (i); + } + _writer->write (_player->get_audio (t, frame, true)); if (non_burnt_subtitles) { @@ -126,7 +142,7 @@ Transcoder::current_encoding_rate () const } int -Transcoder::video_frames_out () const +Transcoder::video_frames_enqueued () const { - return _encoder->video_frames_out (); + return _encoder->video_frames_enqueued (); } -- cgit v1.2.3