Basics of DCP import.
[dcpomatic.git] / src / lib / player.cc
index ebec19b2dc40f2d86da3c51865e05eb1d9105a6e..9f9f8db2e3374b369f7c206e480310b9d278dd01 100644 (file)
@@ -43,6 +43,8 @@
 #include "content_video.h"
 #include "player_video.h"
 #include "frame_rate_change.h"
+#include "dcp_content.h"
+#include "dcp_decoder.h"
 
 #define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
 
@@ -120,6 +122,12 @@ Player::setup_pieces ()
                        frc = FrameRateChange (fc->video_frame_rate(), _film->video_frame_rate());
                }
 
+               shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (*i);
+               if (dc) {
+                       decoder.reset (new DCPDecoder (dc, _film->log ()));
+                       frc = FrameRateChange (dc->video_frame_rate(), _film->video_frame_rate());
+               }
+
                /* ImageContent */
                shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (*i);
                if (ic) {