Untested merge of master.
[dcpomatic.git] / src / lib / imagemagick_decoder.h
index 05dc7f113386caef7384493e0ff9bdf8e9114fe8..e7c9dee9a3ac35373668433e6208d02128aafc0a 100644 (file)
@@ -1,50 +1,46 @@
-#include "decoder.h"
+/*
+    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
 
-namespace Magick {
-       class Image;
-}
+    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.
 
-class ImageMagickDecoder : public Decoder
-{
-public:
-       ImageMagickDecoder (boost::shared_ptr<const FilmState>, boost::shared_ptr<const Options>, Job *, Log *, bool, bool);
+    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.
 
-       int length_in_frames () const {
-               return 1;
-       }
+    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.
 
-       float frames_per_second () const {
-               return static_frames_per_second ();
-       }
+*/
 
-       Size native_size () const;
+#include "video_decoder.h"
 
-       int audio_channels () const {
-               return 0;
-       }
+namespace Magick {
+       class Image;
+}
 
-       int audio_sample_rate () const {
-               return 0;
-       }
+class ImageMagickContent;
 
-       AVSampleFormat audio_sample_format () const {
-               return AV_SAMPLE_FMT_NONE;
-       }
+class ImageMagickDecoder : public VideoDecoder
+{
+public:
+       ImageMagickDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const ImageMagickContent>);
 
-       int64_t audio_channel_layout () const {
-               return 0;
+       float video_frame_rate () const {
+               return 24;
        }
 
-       bool has_subtitles () const {
-               return false;
-       }
+       libdcp::Size native_size () const;
+       ContentVideoFrame video_length () const;
 
-       static float static_frames_per_second () {
-               return 24;
-       }
+       bool seek (double);
+       bool pass ();
 
 protected:
-       bool do_pass ();
        PixelFormat pixel_format () const;
 
        int time_base_numerator () const {
@@ -66,6 +62,7 @@ protected:
        }
 
 private:
-       Magick::Image* _magick_image;
-       bool _done;
+       boost::shared_ptr<const ImageMagickContent> _imagemagick_content;
+       boost::shared_ptr<Image> _image;
+       ContentVideoFrame _position;
 };