Couple of missing formats from Image::components().
[dcpomatic.git] / src / lib / imagemagick_decoder.h
index 05dc7f113386caef7384493e0ff9bdf8e9114fe8..80a08f81f8374a3126a425ee413d0c0eedf21e29 100644 (file)
@@ -1,23 +1,41 @@
-#include "decoder.h"
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "video_decoder.h"
 
 namespace Magick {
        class Image;
 }
 
-class ImageMagickDecoder : public Decoder
+class ImageMagickDecoder : public VideoDecoder
 {
 public:
-       ImageMagickDecoder (boost::shared_ptr<const FilmState>, boost::shared_ptr<const Options>, Job *, Log *, bool, bool);
+       ImageMagickDecoder (boost::shared_ptr<Film>, DecodeOptions);
 
-       int length_in_frames () const {
-               return 1;
-       }
+       float frames_per_second () const;
 
-       float frames_per_second () const {
-               return static_frames_per_second ();
-       }
+       libdcp::Size native_size () const;
 
-       Size native_size () const;
+       SourceFrame length () const {
+               /* We don't know */
+               return 0;
+       }
 
        int audio_channels () const {
                return 0;
@@ -27,24 +45,15 @@ public:
                return 0;
        }
 
-       AVSampleFormat audio_sample_format () const {
-               return AV_SAMPLE_FMT_NONE;
-       }
-
        int64_t audio_channel_layout () const {
                return 0;
        }
 
-       bool has_subtitles () const {
-               return false;
-       }
-
-       static float static_frames_per_second () {
-               return 24;
-       }
+       bool seek (double);
+       bool seek_to_last ();
 
 protected:
-       bool do_pass ();
+       bool pass ();
        PixelFormat pixel_format () const;
 
        int time_base_numerator () const {
@@ -66,6 +75,10 @@ protected:
        }
 
 private:
-       Magick::Image* _magick_image;
-       bool _done;
+       void film_changed (Film::Property);
+       
+       std::list<std::string> _files;
+       std::list<std::string>::iterator _iter;
+
+       boost::shared_ptr<Image> _image;
 };