diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-14 15:07:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-14 15:07:58 +0100 |
| commit | 0b6f2d7b04819711228ed5fbc5d299b58cef997e (patch) | |
| tree | 6acc37024cadbcc50755e8cc7c5075749893e231 /src/lib/transcoder.cc | |
| parent | 2a72bebc04cc5d0b34c81840f10bd1387955a7a4 (diff) | |
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).
Diffstat (limited to 'src/lib/transcoder.cc')
| -rw-r--r-- | src/lib/transcoder.cc | 22 |
1 files changed, 19 insertions, 3 deletions
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 <boost/signals2.hpp> #include <boost/foreach.hpp> #include <iostream> @@ -96,7 +97,22 @@ Transcoder::go () } for (DCPTime t; t < length; t += frame) { - _encoder->encode (_player->get_video (t, true)); + + BOOST_FOREACH (shared_ptr<PlayerVideo> 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 (); } |
