-#include "imagemagick_decoder.h"
-#include "film.h"
-#include "sndfile_decoder.h"
-#include "decoder_factory.h"
-
-using std::string;
-using std::pair;
-using std::make_pair;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
-
-Decoders
-decoder_factory (
- shared_ptr<Film> f, DecodeOptions o
- )
+#include "dcp_content.h"
+#include "dcp_decoder.h"
+#include "image_content.h"
+#include "image_decoder.h"
+#include "string_text_file_content.h"
+#include "string_text_file_decoder.h"
+#include "dcp_subtitle_content.h"
+#include "dcp_subtitle_decoder.h"
+#include "video_mxf_content.h"
+#include "video_mxf_decoder.h"
+#include "timer.h"
+
+using std::list;
+using std::shared_ptr;
+using std::dynamic_pointer_cast;
+
+template <class T>
+shared_ptr<T>
+maybe_cast (shared_ptr<Decoder> d)
+{
+ if (!d) {
+ return shared_ptr<T> ();
+ }
+ return dynamic_pointer_cast<T> (d);
+}
+
+/**
+ @param tolerant true to proceed in the face of `survivable' errors, otherwise false.
+ @param old_decoder A `used' decoder that has been previously made for this piece of content, or 0
+*/
+shared_ptr<Decoder>
+decoder_factory (shared_ptr<const Film> film, shared_ptr<const Content> content, bool fast, bool tolerant, shared_ptr<Decoder> old_decoder)