EncodeOptions can go.
authorCarl Hetherington <cth@carlh.net>
Thu, 17 Jan 2013 00:10:12 +0000 (00:10 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 17 Jan 2013 00:10:12 +0000 (00:10 +0000)
16 files changed:
src/lib/ab_transcode_job.cc
src/lib/ab_transcode_job.h
src/lib/check_hashes_job.cc
src/lib/check_hashes_job.h
src/lib/dcp_video_frame.cc
src/lib/dcp_video_frame.h
src/lib/encoder.cc
src/lib/encoder.h
src/lib/film.cc
src/lib/film.h
src/lib/make_dcp_job.cc
src/lib/make_dcp_job.h
src/lib/options.h
src/lib/transcode_job.cc
src/lib/transcode_job.h
src/lib/transcoder.h

index a6233c185783d42055be316361ff4e4713c76a3a..2dd8f95adfdc44fc5033dceec9ce9c7bc6fb7c31 100644 (file)
@@ -32,10 +32,9 @@ using boost::shared_ptr;
 /** @param f Film to compare.
  *  @param o Options.
  */
-ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<const EncodeOptions> oe, shared_ptr<Job> req)
+ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<Job> req)
        : Job (f, req)
        , _decode_opt (od)
-       , _encode_opt (oe)
 {
        _film_b.reset (new Film (*_film));
        _film_b->set_scaler (Config::instance()->reference_scaler ());
@@ -53,7 +52,7 @@ ABTranscodeJob::run ()
 {
        try {
                /* _film_b is the one with reference filters */
-               ABTranscoder w (_film_b, _film, _decode_opt, this, shared_ptr<Encoder> (new Encoder (_film, _encode_opt)));
+               ABTranscoder w (_film_b, _film, _decode_opt, this, shared_ptr<Encoder> (new Encoder (_film)));
                w.go ();
                set_progress (1);
                set_state (FINISHED_OK);
index 86a2a81b8b2b0e4416503eb00ae1c7025f5dd5a2..69c157651468f7de7f86ef685abff698a7704196 100644 (file)
@@ -26,7 +26,6 @@
 
 class Film;
 class DecodeOptions;
-class EncodeOptions;
 
 /** @class ABTranscodeJob
  *  @brief Job to run a transcoder which produces output for A/B comparison of various settings.
@@ -41,7 +40,6 @@ public:
        ABTranscodeJob (
                boost::shared_ptr<Film> f,
                boost::shared_ptr<const DecodeOptions> od,
-               boost::shared_ptr<const EncodeOptions> oe,
                boost::shared_ptr<Job> req
                );
 
@@ -50,7 +48,6 @@ public:
 
 private:
        boost::shared_ptr<const DecodeOptions> _decode_opt;
-       boost::shared_ptr<const EncodeOptions> _encode_opt;
        
        /** Copy of our Film using the reference filters and scaler */
        boost::shared_ptr<Film> _film_b;
index 6f6591396a13fca3702c6784b2743e4ebf05ca0d..099845d8c7a94583b735354d416d3b94f6acef8c 100644 (file)
@@ -34,10 +34,9 @@ using std::stringstream;
 using std::ifstream;
 using boost::shared_ptr;
 
-CheckHashesJob::CheckHashesJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<const EncodeOptions> oe, shared_ptr<Job> req)
+CheckHashesJob::CheckHashesJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<Job> req)
        : Job (f, req)
        , _decode_opt (od)
-       , _encode_opt (oe)
        , _bad (0)
 {
 
@@ -64,8 +63,8 @@ CheckHashesJob::run ()
        int const inc = dfr.skip ? 2 : 1;
        
        for (SourceFrame i = _film->dcp_trim_start(); i < N; i += inc) {
-               string const j2k_file = _encode_opt->frame_out_path (i, false);
-               string const hash_file = _encode_opt->hash_out_path (i, false);
+               string const j2k_file = _film->frame_out_path (i, false);
+               string const hash_file = _film->hash_out_path (i, false);
 
                if (!boost::filesystem::exists (j2k_file)) {
                        _film->log()->log (String::compose ("Frame %1 has a missing J2K file.", i));
@@ -94,13 +93,13 @@ CheckHashesJob::run ()
                shared_ptr<Job> tc;
 
                if (_film->dcp_ab()) {
-                       tc.reset (new ABTranscodeJob (_film, _decode_opt, _encode_opt, shared_from_this()));
+                       tc.reset (new ABTranscodeJob (_film, _decode_opt, shared_from_this()));
                } else {
-                       tc.reset (new TranscodeJob (_film, _decode_opt, _encode_opt, shared_from_this()));
+                       tc.reset (new TranscodeJob (_film, _decode_opt, shared_from_this()));
                }
                
                JobManager::instance()->add_after (shared_from_this(), tc);
-               JobManager::instance()->add_after (tc, shared_ptr<Job> (new CheckHashesJob (_film, _decode_opt, _encode_opt, tc)));
+               JobManager::instance()->add_after (tc, shared_ptr<Job> (new CheckHashesJob (_film, _decode_opt, tc)));
        }
                
        set_progress (1);
index c41af9d3f885fbfc0bb63873b3dd85a5b0c0afff..7e62b0e7ac83424407deb7e4fe5633172fad623a 100644 (file)
@@ -20,7 +20,6 @@
 #include "job.h"
 
 class DecodeOptions;
-class EncodeOptions;
 
 class CheckHashesJob : public Job
 {
@@ -28,7 +27,6 @@ public:
        CheckHashesJob (
                boost::shared_ptr<Film> f,
                boost::shared_ptr<const DecodeOptions> od,
-               boost::shared_ptr<const EncodeOptions> oe,
                boost::shared_ptr<Job> req
                );
 
@@ -38,6 +36,5 @@ public:
 
 private:
        boost::shared_ptr<const DecodeOptions> _decode_opt;
-       boost::shared_ptr<const EncodeOptions> _encode_opt;
        int _bad;
 };
index f6fb8fe2e2d7eb5d457295426fcc0c208f9e4d42..c00ed9b88c1e0652a333f2da80d1d3bdcc8e4042 100644 (file)
@@ -376,9 +376,9 @@ DCPVideoFrame::encode_remotely (ServerDescription const * serv)
  *  @param frame Frame index.
  */
 void
-EncodedData::write (shared_ptr<const EncodeOptions> opt, SourceFrame frame)
+EncodedData::write (shared_ptr<const Film> film, SourceFrame frame)
 {
-       string const tmp_j2k = opt->frame_out_path (frame, true);
+       string const tmp_j2k = film->frame_out_path (frame, true);
 
        FILE* f = fopen (tmp_j2k.c_str (), "wb");
        
@@ -389,13 +389,13 @@ EncodedData::write (shared_ptr<const EncodeOptions> opt, SourceFrame frame)
        fwrite (_data, 1, _size, f);
        fclose (f);
 
-       string const real_j2k = opt->frame_out_path (frame, false);
+       string const real_j2k = film->frame_out_path (frame, false);
 
        /* Rename the file from foo.j2c.tmp to foo.j2c now that it is complete */
        boost::filesystem::rename (tmp_j2k, real_j2k);
 
        /* Write a file containing the hash */
-       string const hash = opt->hash_out_path (frame, false);
+       string const hash = film->hash_out_path (frame, false);
        ofstream h (hash.c_str());
        h << md5_digest (_data, _size) << "\n";
        h.close ();
index 134720da8d5fdba78b80b9dd1749498bc51ebf6c..1b75cb20745e773ff5ed70975cfbdd31ccad1e7b 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 class FilmState;
-class EncodeOptions;
+class Film;
 class ServerDescription;
 class Scaler;
 class Image;
@@ -50,7 +50,7 @@ public:
        virtual ~EncodedData () {}
 
        void send (boost::shared_ptr<Socket> socket);
-       void write (boost::shared_ptr<const EncodeOptions>, SourceFrame);
+       void write (boost::shared_ptr<const Film>, SourceFrame);
 
        /** @return data */
        uint8_t* data () const {
index afa636150dc99e529d4258f045db7826747e7b2a..35b43e334b8d49b414c89692c01c6e258950dc86 100644 (file)
@@ -34,6 +34,7 @@
 #include "config.h"
 #include "dcp_video_frame.h"
 #include "server.h"
+#include "format.h"
 #include "cross.h"
 
 using std::pair;
@@ -50,9 +51,8 @@ int const Encoder::_history_size = 25;
 /** @param f Film that we are encoding.
  *  @param o Options.
  */
-Encoder::Encoder (shared_ptr<const Film> f, shared_ptr<const EncodeOptions> o)
+Encoder::Encoder (shared_ptr<const Film> f)
        : _film (f)
-       , _opt (o)
        , _just_skipped (false)
        , _video_frame (0)
        , _audio_frame (0)
@@ -72,9 +72,9 @@ Encoder::Encoder (shared_ptr<const Film> f, shared_ptr<const EncodeOptions> o)
                        /* We write mono files */
                        sf_info.channels = 1;
                        sf_info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_24;
-                       SNDFILE* f = sf_open (_opt->multichannel_audio_out_path (i, true).c_str (), SFM_WRITE, &sf_info);
+                       SNDFILE* f = sf_open (_film->multichannel_audio_out_path (i, true).c_str (), SFM_WRITE, &sf_info);
                        if (f == 0) {
-                               throw CreateFileError (_opt->multichannel_audio_out_path (i, true));
+                               throw CreateFileError (_film->multichannel_audio_out_path (i, true));
                        }
                        _sound_files.push_back (f);
                }
@@ -165,10 +165,10 @@ Encoder::process_end ()
                
                /* Rename .wav.tmp files to .wav */
                for (int i = 0; i < dcp_audio_channels (_film->audio_channels()); ++i) {
-                       if (boost::filesystem::exists (_opt->multichannel_audio_out_path (i, false))) {
-                               boost::filesystem::remove (_opt->multichannel_audio_out_path (i, false));
+                       if (boost::filesystem::exists (_film->multichannel_audio_out_path (i, false))) {
+                               boost::filesystem::remove (_film->multichannel_audio_out_path (i, false));
                        }
-                       boost::filesystem::rename (_opt->multichannel_audio_out_path (i, true), _opt->multichannel_audio_out_path (i, false));
+                       boost::filesystem::rename (_film->multichannel_audio_out_path (i, true), _film->multichannel_audio_out_path (i, false));
                }
        }
 
@@ -202,7 +202,7 @@ Encoder::process_end ()
                _film->log()->log (String::compose ("Encode left-over frame %1", (*i)->frame ()));
                try {
                        shared_ptr<EncodedData> e = (*i)->encode_locally ();
-                       e->write (_opt, (*i)->frame ());
+                       e->write (_film, (*i)->frame ());
                        frame_done ();
                } catch (std::exception& e) {
                        _film->log()->log (String::compose ("Local encode failed (%1)", e.what ()));
@@ -211,8 +211,8 @@ Encoder::process_end ()
 
        /* Now do links (or copies on windows) to duplicate frames */
        for (list<pair<int, int> >::iterator i = _links_required.begin(); i != _links_required.end(); ++i) {
-               link (_opt->frame_out_path (i->first, false), _opt->frame_out_path (i->second, false));
-               link (_opt->hash_out_path (i->first, false), _opt->hash_out_path (i->second, false));
+               link (_film->frame_out_path (i->first, false), _film->frame_out_path (i->second, false));
+               link (_film->hash_out_path (i->first, false), _film->hash_out_path (i->second, false));
        }
 }      
 
@@ -279,13 +279,15 @@ Encoder::frame_skipped ()
 void
 Encoder::process_video (shared_ptr<Image> image, bool same, boost::shared_ptr<Subtitle> sub)
 {
-       if (_opt->video_skip && (_video_frame % 2)) {
+       DCPFrameRate dfr (_film->frames_per_second ());
+       
+       if (dfr.skip && (_video_frame % 2)) {
                ++_video_frame;
                return;
        }
 
-       if (_opt->video_range) {
-               pair<SourceFrame, SourceFrame> const r = _opt->video_range.get();
+       if (_film->video_range ()) {
+               pair<SourceFrame, SourceFrame> const r = _film->video_range().get();
                if (_video_frame < r.first || _video_frame >= r.second) {
                        ++_video_frame;
                        return;
@@ -306,7 +308,7 @@ Encoder::process_video (shared_ptr<Image> image, bool same, boost::shared_ptr<Su
        }
 
        /* Only do the processing if we don't already have a file for this frame */
-       if (boost::filesystem::exists (_opt->frame_out_path (_video_frame, false))) {
+       if (boost::filesystem::exists (_film->frame_out_path (_video_frame, false))) {
                frame_skipped ();
                return;
        }
@@ -323,7 +325,8 @@ Encoder::process_video (shared_ptr<Image> image, bool same, boost::shared_ptr<Su
                TIMING ("adding to queue of %1", _queue.size ());
                _queue.push_back (boost::shared_ptr<DCPVideoFrame> (
                                          new DCPVideoFrame (
-                                                 image, sub, _opt->out_size, _opt->padding, _film->subtitle_offset(), _film->subtitle_scale(),
+                                                 image, sub, _film->format()->dcp_size(), _film->format()->dcp_padding (_film),
+                                                 _film->subtitle_offset(), _film->subtitle_scale(),
                                                  _film->scaler(), _video_frame, _film->frames_per_second(), s.second,
                                                  _film->colour_lut(), _film->j2k_bandwidth(),
                                                  _film->log()
@@ -340,11 +343,11 @@ Encoder::process_video (shared_ptr<Image> image, bool same, boost::shared_ptr<Su
 void
 Encoder::process_audio (shared_ptr<AudioBuffers> data)
 {
-       if (_opt->audio_range) {
+       if (_film->audio_range ()) {
                shared_ptr<AudioBuffers> trimmed (new AudioBuffers (*data.get ()));
                
                /* Range that we are encoding */
-               pair<int64_t, int64_t> required_range = _opt->audio_range.get();
+               pair<int64_t, int64_t> required_range = _film->audio_range().get();
                /* Range of this block of data */
                pair<int64_t, int64_t> this_range (_audio_frame, _audio_frame + trimmed->frames());
 
@@ -508,7 +511,7 @@ Encoder::encoder_thread (ServerDescription* server)
                }
 
                if (encoded) {
-                       encoded->write (_opt, vf->frame ());
+                       encoded->write (_film, vf->frame ());
                        frame_done ();
                } else {
                        lock.lock ();
index bd38dc6bdab58b0738bdb7141bfa9d437b5c95c7..d8edf9b26b32197edd826c2a98b0ce9ad609c104 100644 (file)
@@ -44,7 +44,6 @@ extern "C" {
 #include "video_sink.h"
 #include "audio_sink.h"
 
-class EncodeOptions;
 class Image;
 class Subtitle;
 class AudioBuffers;
@@ -62,7 +61,7 @@ class DCPVideoFrame;
 class Encoder : public VideoSink, public AudioSink
 {
 public:
-       Encoder (boost::shared_ptr<const Film> f, boost::shared_ptr<const EncodeOptions> o);
+       Encoder (boost::shared_ptr<const Film> f);
        virtual ~Encoder ();
 
        /** Called to indicate that a processing run is about to begin */
@@ -99,8 +98,6 @@ private:
 
        /** Film that we are encoding */
        boost::shared_ptr<const Film> _film;
-       /** Options */
-       boost::shared_ptr<const EncodeOptions> _opt;
 
        /** Mutex for _time_history, _just_skipped and _last_frame */
        mutable boost::mutex _history_mutex;
index 83c60a5f5308915c41919a762af9577fcaa1e367..4bf6606a932ce4bd983fc37e25d65c527f14f39e 100644 (file)
@@ -290,33 +290,6 @@ Film::make_dcp (bool transcode)
                throw MissingSettingError ("name");
        }
 
-       shared_ptr<EncodeOptions> oe (new EncodeOptions (j2k_dir(), ".j2c", dir ("wavs")));
-       oe->out_size = format()->dcp_size ();
-       oe->padding = format()->dcp_padding (shared_from_this ());
-       if (dcp_length ()) {
-               oe->video_range = make_pair (dcp_trim_start(), dcp_trim_start() + dcp_length().get());
-               if (audio_stream()) {
-                       DCPFrameRate dfr (frames_per_second ());
-                       oe->audio_range = make_pair (
-
-                               video_frames_to_audio_frames (
-                                       oe->video_range.get().first,
-                                       dcp_audio_sample_rate (audio_stream()->sample_rate()),
-                                       dfr.frames_per_second
-                                       ),
-                               
-                               video_frames_to_audio_frames (
-                                       oe->video_range.get().second,
-                                       dcp_audio_sample_rate (audio_stream()->sample_rate()),
-                                       dfr.frames_per_second
-                                       )
-                               );
-               }
-                       
-       }
-       
-       oe->video_skip = DCPFrameRate (frames_per_second()).skip;
-
        shared_ptr<DecodeOptions> od (new DecodeOptions);
        od->decode_subtitles = with_subtitles ();
 
@@ -324,14 +297,14 @@ Film::make_dcp (bool transcode)
 
        if (transcode) {
                if (dcp_ab()) {
-                       r = JobManager::instance()->add (shared_ptr<Job> (new ABTranscodeJob (shared_from_this(), od, oe, shared_ptr<Job> ())));
+                       r = JobManager::instance()->add (shared_ptr<Job> (new ABTranscodeJob (shared_from_this(), od, shared_ptr<Job> ())));
                } else {
-                       r = JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this(), od, oe, shared_ptr<Job> ())));
+                       r = JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this(), od, shared_ptr<Job> ())));
                }
        }
 
-       r = JobManager::instance()->add (shared_ptr<Job> (new CheckHashesJob (shared_from_this(), od, oe, r)));
-       JobManager::instance()->add (shared_ptr<Job> (new MakeDCPJob (shared_from_this(), oe, r)));
+       r = JobManager::instance()->add (shared_ptr<Job> (new CheckHashesJob (shared_from_this(), od, r)));
+       JobManager::instance()->add (shared_ptr<Job> (new MakeDCPJob (shared_from_this(), r)));
 }
 
 /** Start a job to examine our content file */
@@ -1437,3 +1410,79 @@ Film::audio_stream () const
 
        return _external_audio_stream;
 }
+
+/** @param f Source frame index.
+ *  @param t true to return a temporary file path, otherwise a permanent one.
+ *  @return The path to write this video frame to.
+ */
+string
+Film::frame_out_path (SourceFrame f, bool t) const
+{
+       stringstream s;
+       s << j2k_dir() << "/";
+       s.width (8);
+       s << std::setfill('0') << f << ".j2c";
+
+       if (t) {
+               s << ".tmp";
+       }
+
+       return s.str ();
+}
+
+string
+Film::hash_out_path (SourceFrame f, bool t) const
+{
+       return frame_out_path (f, t) + ".md5";
+}
+
+/** @param c Audio channel index.
+ *  @param t true to return a temporary file path, otherwise a permanent one.
+ *  @return The path to write this audio file to.
+ */
+string
+Film::multichannel_audio_out_path (int c, bool t) const
+{
+       stringstream s;
+       s << dir ("wavs") << "/" << (c + 1) << ".wav";
+       if (t) {
+               s << ".tmp";
+       }
+       
+       return s.str ();
+}
+
+boost::optional<pair<SourceFrame, SourceFrame> >
+Film::video_range () const
+{
+       if (!dcp_length()) {
+               return boost::optional<pair<SourceFrame, SourceFrame> > ();
+       }
+       
+       return make_pair (dcp_trim_start(), dcp_trim_start() + dcp_length().get());
+}
+
+boost::optional<pair<int64_t, int64_t> >
+Film::audio_range () const
+{
+       boost::optional<pair<SourceFrame, SourceFrame> > vr = video_range ();
+       if (!vr || !audio_stream()) {
+               return boost::optional<pair<int64_t, int64_t> > ();
+       }
+
+       DCPFrameRate dfr (frames_per_second ());
+       return make_pair (
+               
+               video_frames_to_audio_frames (
+                       vr.get().first,
+                       dcp_audio_sample_rate (audio_stream()->sample_rate()),
+                       dfr.frames_per_second
+                       ),
+               
+               video_frames_to_audio_frames (
+                       vr.get().second,
+                       dcp_audio_sample_rate (audio_stream()->sample_rate()),
+                       dfr.frames_per_second
+                       )
+               );
+}
index 3485dfaae8dd1eec33e7f9cb6527daf963390d04..6c27af3ab8c35a36ce2a3d0f0ab7c4c75fe4394d 100644 (file)
@@ -78,6 +78,10 @@ public:
        std::string file (std::string f) const;
        std::string dir (std::string d) const;
 
+       std::string frame_out_path (SourceFrame f, bool t) const;
+       std::string hash_out_path (SourceFrame f, bool t) const;
+       std::string multichannel_audio_out_path (int c, bool t) const;
+       
        std::string content_path () const;
        ContentType content_type () const;
        
@@ -97,6 +101,8 @@ public:
        }
 
        int audio_channels () const;
+       boost::optional<std::pair<SourceFrame, SourceFrame> > video_range () const;
+       boost::optional<std::pair<int64_t, int64_t> > audio_range () const;
 
        void set_dci_date_today ();
 
index 67a2d8b13e35e8f16d1565660a37b068bf61fa65..efc2f05d565cf2d761f155532b9bdc9e4741affc 100644 (file)
@@ -36,6 +36,7 @@ extern "C" {
 #include "options.h"
 #include "imagemagick_decoder.h"
 #include "film.h"
+#include "format.h"
 
 using std::string;
 using std::cout;
@@ -44,9 +45,8 @@ using boost::shared_ptr;
 /** @param f Film we are making the DCP for.
  *  @param o Options.
  */
-MakeDCPJob::MakeDCPJob (shared_ptr<Film> f, shared_ptr<const EncodeOptions> o, shared_ptr<Job> req)
+MakeDCPJob::MakeDCPJob (shared_ptr<Film> f, shared_ptr<Job> req)
        : Job (f, req)
-       , _opt (o)
 {
        
 }
@@ -64,13 +64,13 @@ MakeDCPJob::j2c_path (int f, int offset) const
        DCPFrameRate dfr (_film->frames_per_second());
        int const mult = dfr.skip ? 2 : 1;
        SourceFrame const s = ((f + offset) * mult) + _film->dcp_trim_start();
-       return _opt->frame_out_path (s, false);
+       return _film->frame_out_path (s, false);
 }
 
 string
 MakeDCPJob::wav_path (libdcp::Channel c) const
 {
-       return _opt->multichannel_audio_out_path (int (c), false);
+       return _film->multichannel_audio_out_path (int (c), false);
 }
 
 void
@@ -138,8 +138,8 @@ MakeDCPJob::run ()
                                &dcp.Progress,
                                dfr.frames_per_second,
                                this_time,
-                               _opt->out_size.width,
-                               _opt->out_size.height
+                               _film->format()->dcp_size().width,
+                               _film->format()->dcp_size().height
                                )
                        );
        
index 5e4f78a2513aa858f8cbe7e851962de2040f19c3..481382248f3fd247075e3daf933fabd7ea2cae64 100644 (file)
 
 #include "job.h"
 
-class EncodeOptions;
-
 /** @class MakeDCPJob
  *  @brief A job to create DCPs
  */
 class MakeDCPJob : public Job
 {
 public:
-       MakeDCPJob (boost::shared_ptr<Film>, boost::shared_ptr<const EncodeOptions>, boost::shared_ptr<Job> req);
+       MakeDCPJob (boost::shared_ptr<Film>, boost::shared_ptr<Job> req);
 
        std::string name () const;
        void run ();
@@ -40,7 +38,5 @@ private:
        void dcp_progress (float);
        std::string j2c_path (int, int) const;
        std::string wav_path (libdcp::Channel) const;
-
-       boost::shared_ptr<const EncodeOptions> _opt;
 };
 
index d1fc1d54e7c6928010220e1296ffea279294a25c..2f8733507c3d033081ec09a2d063cb9239decfdd 100644 (file)
 #include <boost/optional.hpp>
 #include "util.h"
 
-/** @class EncodeOptions
- *  @brief EncodeOptions for an encoding operation.
- *
- *  These are settings which may be different, in different circumstances, for
- *  the same film; ie they are options for a particular operation.
- */
-class EncodeOptions
-{
-public:
-
-       EncodeOptions (std::string f, std::string e, std::string m)
-               : padding (0)
-               , video_skip (false)
-               , _frame_out_path (f)
-               , _frame_out_extension (e)
-               , _multichannel_audio_out_path (m)
-       {}
-
-       /** @return The path to write video frames to */
-       std::string frame_out_path () const {
-               return _frame_out_path;
-       }
-
-       /** @param f Source frame index.
-        *  @param t true to return a temporary file path, otherwise a permanent one.
-        *  @return The path to write this video frame to.
-        */
-       std::string frame_out_path (SourceFrame f, bool t) const {
-               std::stringstream s;
-               s << _frame_out_path << "/";
-               s.width (8);
-               s << std::setfill('0') << f << _frame_out_extension;
-
-               if (t) {
-                       s << ".tmp";
-               }
-
-               return s.str ();
-       }
-
-       std::string hash_out_path (SourceFrame f, bool t) const {
-               return frame_out_path (f, t) + ".md5";
-       }
-
-       /** @return Path to write multichannel audio data to */
-       std::string multichannel_audio_out_path () const {
-               return _multichannel_audio_out_path;
-       }
-
-       /** @param c Audio channel index.
-        *  @param t true to return a temporary file path, otherwise a permanent one.
-        *  @return The path to write this audio file to.
-        */
-       std::string multichannel_audio_out_path (int c, bool t) const {
-               std::stringstream s;
-               s << _multichannel_audio_out_path << "/" << (c + 1) << ".wav";
-               if (t) {
-                       s << ".tmp";
-               }
-
-               return s.str ();
-       }
-
-       Size out_size;              ///< size of output images
-       int padding;                ///< number of pixels of padding (in terms of the output size) each side of the image
-
-       /** Range of video frames to encode (in DCP frames) */
-       boost::optional<std::pair<int, int> > video_range;
-       /** Range of audio frames to decode (in the DCP's sampling rate) */
-       boost::optional<std::pair<int64_t, int64_t> > audio_range;
-       
-       /** true to skip every other frame */
-       SourceFrame video_skip;
-
-private:
-       /** Path of the directory to write video frames to */
-       std::string _frame_out_path;
-       /** Extension to use for video frame files (including the leading .) */
-       std::string _frame_out_extension;
-       /** Path of the directory to write audio files to */
-       std::string _multichannel_audio_out_path;
-};
-
-
 class DecodeOptions
 {
 public:
index dfb9b107192748f7dbe8c6b4f2280cd69fa05057..db5c336418db5f55da763cdc1e697f4faacc07e9 100644 (file)
@@ -40,10 +40,9 @@ using boost::shared_ptr;
  *  @param o Options.
  *  @param req Job that must be completed before this job is run.
  */
-TranscodeJob::TranscodeJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<const EncodeOptions> oe, shared_ptr<Job> req)
+TranscodeJob::TranscodeJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<Job> req)
        : Job (f, req)
        , _decode_opt (od)
-       , _encode_opt (oe)
 {
        
 }
@@ -62,7 +61,7 @@ TranscodeJob::run ()
                _film->log()->log ("Transcode job starting");
                _film->log()->log (String::compose ("Audio delay is %1ms", _film->audio_delay()));
 
-               _encoder.reset (new Encoder (_film, _encode_opt));
+               _encoder.reset (new Encoder (_film));
                Transcoder w (_film, _decode_opt, this, _encoder);
                w.go ();
                set_progress (1);
index 97f655e15c212e78aba5ad9f6564dbfc84f9f7e9..aef190a64d56d8c59abcff918b9ffb0f63d4bb0a 100644 (file)
@@ -26,7 +26,6 @@
 
 class Encoder;
 class DecodeOptions;
-class EncodeOptions;
 
 /** @class TranscodeJob
  *  @brief A job which transcodes from one format to another.
@@ -34,7 +33,7 @@ class EncodeOptions;
 class TranscodeJob : public Job
 {
 public:
-       TranscodeJob (boost::shared_ptr<Film> f, boost::shared_ptr<const DecodeOptions> od, boost::shared_ptr<const EncodeOptions> oe, boost::shared_ptr<Job> req);
+       TranscodeJob (boost::shared_ptr<Film> f, boost::shared_ptr<const DecodeOptions> od, boost::shared_ptr<Job> req);
        
        std::string name () const;
        void run ();
@@ -45,6 +44,5 @@ protected:
 
 private:
        boost::shared_ptr<const DecodeOptions> _decode_opt;
-       boost::shared_ptr<const EncodeOptions> _encode_opt;
        boost::shared_ptr<Encoder> _encoder;
 };
index b50113742369c817aa3e0b57d28158f31d111b41..ef6a438c8aa724791dc1bb1e475853cc3062aae6 100644 (file)
@@ -36,7 +36,6 @@ class Gain;
 class VideoDecoder;
 class AudioDecoder;
 class DelayLine;
-class EncodeOptions;
 class DecodeOptions;
 
 /** @class Transcoder