Merge master.
[dcpomatic.git] / src / lib / imagemagick_decoder.h
index 0e375f6e9e3127a040f862d014189e1d689527ca..cb68655cee2f2a6362dc3be6d0089d095db5b2d9 100644 (file)
@@ -23,44 +23,28 @@ namespace Magick {
        class Image;
 }
 
+class ImageMagickContent;
+
 class ImageMagickDecoder : public VideoDecoder
 {
 public:
-       ImageMagickDecoder (boost::shared_ptr<Film>, DecodeOptions);
+       ImageMagickDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const ImageMagickContent>);
 
-       float frames_per_second () const {
-               /* We don't know */
-               return 0;
+       float video_frame_rate () const {
+               return 24;
        }
 
        libdcp::Size native_size () const;
+       ContentVideoFrame video_length () const;
 
-       SourceFrame length () const {
-               /* We don't know */
-               return 0;
-       }
-
-       int audio_channels () const {
-               return 0;
-       }
-
-       int audio_sample_rate () const {
-               return 0;
-       }
-
-       int64_t audio_channel_layout () const {
-               return 0;
-       }
+       bool seek (double);
+       bool pass ();
 
-       bool has_subtitles () const {
-               return false;
+       boost::shared_ptr<const ImageMagickContent> content () const {
+               return _imagemagick_content;
        }
 
-       bool seek (double);
-       bool seek_to_last ();
-
 protected:
-       bool pass ();
        PixelFormat pixel_format () const;
 
        int time_base_numerator () const {
@@ -82,8 +66,8 @@ protected:
        }
 
 private:
-       void film_changed (Film::Property);
-       
-       std::list<std::string> _files;
-       std::list<std::string>::iterator _iter;
+       boost::shared_ptr<const ImageMagickContent> _imagemagick_content;
+       boost::shared_ptr<Image> _image;
+       ContentVideoFrame _position;
+       mutable boost::optional<libdcp::Size> _native_size;
 };