- if (boost::filesystem::is_directory (f->content_path()) || f->content_type() == STILL) {
- /* A single image file, or a directory of them */
- return Decoders (
- shared_ptr<VideoDecoder> (new ImageMagickDecoder (f, o, j)),
- shared_ptr<AudioDecoder> (new ExternalAudioDecoder (f, o, j))
- );
+ auto fc = dynamic_pointer_cast<const FFmpegContent> (content);
+ if (fc) {
+ return make_shared<FFmpegDecoder>(film, fc, fast);
+ }
+
+ auto dc = dynamic_pointer_cast<const DCPContent> (content);
+ if (dc) {
+ try {
+ return make_shared<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 {};
+ }
+ }
+
+ auto ic = dynamic_pointer_cast<const ImageContent> (content);
+ if (ic) {
+ return make_shared<ImageDecoder>(film, ic);
+ }
+
+ auto rc = dynamic_pointer_cast<const StringTextFileContent> (content);
+ if (rc) {
+ return make_shared<StringTextFileDecoder>(film, rc);
+ }
+
+ auto dsc = dynamic_pointer_cast<const DCPSubtitleContent> (content);
+ if (dsc) {
+ return make_shared<DCPSubtitleDecoder>(film, dsc);
+ }
+
+ auto vmc = dynamic_pointer_cast<const VideoMXFContent> (content);
+ if (vmc) {
+ return make_shared<VideoMXFDecoder>(film, vmc);