#include <boost/filesystem.hpp>
#include "ffmpeg_decoder.h"
-#include "tiff_decoder.h"
#include "imagemagick_decoder.h"
-#include "film_state.h"
+#include "film.h"
+#include "sndfile_decoder.h"
+#include "decoder_factory.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::pair;
+using std::make_pair;
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
-shared_ptr<Decoder>
+Decoders
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, DecodeOptions o
)
{
- if (filesystem::is_directory (fs->content_path ())) {
- /* Assume a directory contains TIFFs */
- return shared_ptr<Decoder> (new TIFFDecoder (fs, o, j, l, minimal, ignore_length));
- }
-
- if (fs->content_type() == STILL) {
- /* Always ignore length of decodes of stills, since the decoder finishes very quickly
- and its the encoder that takes the time.
- */
- return shared_ptr<Decoder> (new ImageMagickDecoder (fs, o, j, l, minimal, true));
- }
-
- return shared_ptr<Decoder> (new FFmpegDecoder (fs, o, j, l, minimal, ignore_length));
+ return Decoders ();
}