summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-01 01:25:27 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-01 01:25:27 +0200
commit981ffdc9db4a84c614b3186a0fb27136fe6feb37 (patch)
tree9027b208a4eaeccd8a2e8ff3af375d49976f7915
parent0a1aa72f11b7d5109caaa5d3ae0068e18dea6b56 (diff)
Move 3D-to-2D check (#1941).
We were checking for 3D content going into a 2D project in the DCPEncoder, but we also need to do the same thing when exporting. Moving the check into Player::emit_video() means that it is applied to both DCP transcoding and export.
-rw-r--r--src/lib/dcp_encoder.cc10
-rw-r--r--src/lib/player.cc10
-rw-r--r--test/ffmpeg_encoder_test.cc12
3 files changed, 22 insertions, 10 deletions
diff --git a/src/lib/dcp_encoder.cc b/src/lib/dcp_encoder.cc
index c5bcf31f2..f1c412539 100644
--- a/src/lib/dcp_encoder.cc
+++ b/src/lib/dcp_encoder.cc
@@ -132,16 +132,6 @@ DCPEncoder::go ()
void
DCPEncoder::video (shared_ptr<PlayerVideo> data, DCPTime time)
{
- if (!_film->three_d()) {
- if (data->eyes() == Eyes::LEFT) {
- /* Use left-eye images for both eyes... */
- data->set_eyes (Eyes::BOTH);
- } else if (data->eyes() == Eyes::RIGHT) {
- /* ...and discard the right */
- return;
- }
- }
-
_j2k_encoder->encode (data, time);
}
diff --git a/src/lib/player.cc b/src/lib/player.cc
index a5538d9a6..0bdf46f4a 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -1199,6 +1199,16 @@ Player::seek (DCPTime time, bool accurate)
void
Player::emit_video (shared_ptr<PlayerVideo> pv, DCPTime time)
{
+ if (!_film->three_d()) {
+ if (pv->eyes() == Eyes::LEFT) {
+ /* Use left-eye images for both eyes... */
+ pv->set_eyes (Eyes::BOTH);
+ } else if (pv->eyes() == Eyes::RIGHT) {
+ /* ...and discard the right */
+ return;
+ }
+ }
+
/* We need a delay to give a little wiggle room to ensure that relevent subtitles arrive at the
player before the video that requires them.
*/
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index 74603f6c0..9bce836c3 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -331,6 +331,18 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test6)
/** Test export of a 3D DCP in a 2D project */
+BOOST_AUTO_TEST_CASE (ffmpeg_encoder_3d_dcp_to_h264)
+{
+ auto dcp = make_shared<DCPContent>(TestPaths::private_data() / "XMenDarkPhoenix_TLR-12-3D_F_DE-XX_DE_51_2K_TCFG_20190227_TM_IOP-3D_OV");
+ auto film2 = new_test_film2 ("ffmpeg_encoder_3d_dcp_to_h264_export", {dcp});
+
+ auto job = make_shared<TranscodeJob> (film2);
+ FFmpegEncoder encoder (film2, job, "build/test/ffmpeg_encoder_3d_dcp_to_h264.mp4", ExportFormat::H264_AAC, true, false, false, 23);
+ encoder.go ();
+}
+
+
+/** Test export of a 3D DCP in a 2D project */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test7)
{
auto L = make_shared<ImageContent>(TestPaths::private_data() / "bbc405.png");