+
+FFmpegEncoder::FileEncoderSet::FileEncoderSet (
+ dcp::Size video_frame_size,
+ int video_frame_rate,
+ int audio_frame_rate,
+ int channels,
+ shared_ptr<Log> log,
+ ExportFormat format,
+ int x264_crf,
+ bool three_d,
+ boost::filesystem::path output,
+ string extension
+ )
+{
+ if (three_d) {
+ /// TRANSLATORS: L here is an abbreviation for "left", to indicate the left-eye part of a 3D export
+ _encoders[EYES_LEFT] = shared_ptr<FFmpegFileEncoder>(
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1_%2%3", output.string(), _("L"), extension))
+ );
+ /// TRANSLATORS: R here is an abbreviation for "left", to indicate the left-eye part of a 3D export
+ _encoders[EYES_RIGHT] = shared_ptr<FFmpegFileEncoder>(
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1_%2%3", output.string(), _("R"), extension))
+ );
+ } else {
+ _encoders[EYES_BOTH] = shared_ptr<FFmpegFileEncoder>(
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1%2", output.string(), extension))
+ );
+ }
+}
+
+shared_ptr<FFmpegFileEncoder>
+FFmpegEncoder::FileEncoderSet::get (Eyes eyes) const
+{
+ map<Eyes, boost::shared_ptr<FFmpegFileEncoder> >::const_iterator i = _encoders.find (eyes);
+ DCPOMATIC_ASSERT (i != _encoders.end());
+ return i->second;
+}
+
+void
+FFmpegEncoder::FileEncoderSet::flush ()
+{
+ for (map<Eyes, boost::shared_ptr<FFmpegFileEncoder> >::iterator i = _encoders.begin(); i != _encoders.end(); ++i) {
+ i->second->flush ();
+ }
+}
+
+void
+FFmpegEncoder::FileEncoderSet::audio (shared_ptr<AudioBuffers> a)
+{
+ for (map<Eyes, boost::shared_ptr<FFmpegFileEncoder> >::iterator i = _encoders.begin(); i != _encoders.end(); ++i) {
+ i->second->audio (a);
+ }
+}