Merge master.
[dcpomatic.git] / src / lib / imagemagick_decoder.h
index 80a08f81f8374a3126a425ee413d0c0eedf21e29..82c87876bdc8dba4a69de0c4872ffcfc015897ae 100644 (file)
@@ -23,62 +23,36 @@ namespace Magick {
        class Image;
 }
 
+class ImageMagickContent;
+
 class ImageMagickDecoder : public VideoDecoder
 {
 public:
-       ImageMagickDecoder (boost::shared_ptr<Film>, DecodeOptions);
-
-       float frames_per_second () const;
-
-       libdcp::Size native_size () const;
-
-       SourceFrame length () const {
-               /* We don't know */
-               return 0;
-       }
+       ImageMagickDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const ImageMagickContent>);
 
-       int audio_channels () const {
-               return 0;
-       }
+       /* Decoder */
 
-       int audio_sample_rate () const {
-               return 0;
-       }
+       void pass ();
+       void seek (Time);
+       void seek_back ();
+       void seek_forward ();
+       Time next () const;
+       bool done () const;
 
-       int64_t audio_channel_layout () const {
-               return 0;
-       }
+       /* VideoDecoder */
 
-       bool seek (double);
-       bool seek_to_last ();
+       float video_frame_rate () const;
+       libdcp::Size video_size () const;
+       ContentVideoFrame video_length () const;
 
-protected:
-       bool pass ();
-       PixelFormat pixel_format () const;
+       /* ImageMagickDecoder */
 
-       int time_base_numerator () const {
-               return 0;
-       }
-
-       int time_base_denominator () const {
-               return 0;
-       }
-
-       int sample_aspect_ratio_numerator () const {
-               /* XXX */
-               return 1;
-       }
-
-       int sample_aspect_ratio_denominator () const {
-               /* XXX */
-               return 1;
+       boost::shared_ptr<const ImageMagickContent> content () const {
+               return _imagemagick_content;
        }
 
 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;
+       mutable boost::optional<libdcp::Size> _video_size;
 };