Use more local methods rather than calling out to Film in the Decoder.
[dcpomatic.git] / src / lib / decoder_factory.cc
index 6826724af9eb335ac599f13b4d6098b9d7dbcdcc..06377e26c4cb6b476a273ccc0034d4df44dbaac5 100644 (file)
 #include "ffmpeg_decoder.h"
 #include "tiff_decoder.h"
 #include "imagemagick_decoder.h"
-#include "film_state.h"
+#include "film.h"
 
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
 
 shared_ptr<Decoder>
 decoder_factory (
-       shared_ptr<const FilmState> fs, shared_ptr<const Options> o, Job* j, Log* l, bool minimal = false, bool ignore_length = false
+       shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal = false, bool ignore_length = false
        )
 {
-       if (filesystem::is_directory (fs->content_path ())) {
+       if (boost::filesystem::is_directory (f->content_path ())) {
                /* Assume a directory contains TIFFs */
-               return shared_ptr<Decoder> (new TIFFDecoder (fs, o, j, l, minimal, ignore_length));
+               return shared_ptr<Decoder> (new TIFFDecoder (f, o, j, minimal, ignore_length));
        }
 
-       if (fs->content_type() == STILL) {
+       if (f->content_type() == STILL) {
                /* Always ignore length of decodes of stills, since the decoder finishes very quickly
-                  and its the encoder that takes the time.
+                  and it's the encoder that takes the time.
                */
-               return shared_ptr<Decoder> (new ImageMagickDecoder (fs, o, j, l, minimal, true));
+               return shared_ptr<Decoder> (new ImageMagickDecoder (f, o, j, minimal, true));
        }
        
-       return shared_ptr<Decoder> (new FFmpegDecoder (fs, o, j, l, minimal, ignore_length));
+       return shared_ptr<Decoder> (new FFmpegDecoder (f, o, j, minimal, ignore_length));
 }