+ shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (content);
+ if (fc) {
+ return shared_ptr<Decoder> (new FFmpegDecoder(film, fc, fast));
+ }
+
+ shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (content);
+ if (dc) {
+ try {
+ return shared_ptr<Decoder> (new DCPDecoder(film, dc, fast, tolerant, maybe_cast<DCPDecoder>(old_decoder)));
+ } catch (KDMError& e) {
+ /* This will be found and reported to the user when the content is examined */
+ return shared_ptr<Decoder>();
+ }
+ }
+
+ shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (content);
+ if (ic) {
+ return shared_ptr<Decoder> (new ImageDecoder(film, ic));
+ }
+
+ shared_ptr<const StringTextFileContent> rc = dynamic_pointer_cast<const StringTextFileContent> (content);
+ if (rc) {
+ return shared_ptr<Decoder> (new StringTextFileDecoder(film, rc));
+ }
+
+ shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (content);
+ if (dsc) {
+ return shared_ptr<Decoder> (new DCPSubtitleDecoder(film, dsc));
+ }
+
+ shared_ptr<const VideoMXFContent> vmc = dynamic_pointer_cast<const VideoMXFContent> (content);
+ if (vmc) {
+ return shared_ptr<Decoder> (new VideoMXFDecoder(film, vmc));
+ }
+
+ shared_ptr<const AtmosMXFContent> amc = dynamic_pointer_cast<const AtmosMXFContent> (content);
+ if (amc) {
+ return shared_ptr<Decoder> (new AtmosMXFDecoder(film, amc));
+ }
+
+ return shared_ptr<Decoder> ();