Remove minimal flag.
authorCarl Hetherington <cth@carlh.net>
Sun, 4 Nov 2012 16:59:00 +0000 (16:59 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 4 Nov 2012 16:59:00 +0000 (16:59 +0000)
12 files changed:
src/lib/decoder.cc
src/lib/decoder.h
src/lib/decoder_factory.cc
src/lib/decoder_factory.h
src/lib/examine_content_job.cc
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_decoder.h
src/lib/film.cc
src/lib/imagemagick_decoder.cc
src/lib/imagemagick_decoder.h
src/lib/tiff_decoder.cc
src/lib/tiff_decoder.h

index ee2beb3f3ce4c52eb766da6da22afd4c8a9a6bbb..34c04b260502ab75c424dc9635c2aee3e1515956 100644 (file)
@@ -46,14 +46,11 @@ using boost::shared_ptr;
 /** @param f Film.
  *  @param o Options.
  *  @param j Job that we are running within, or 0
- *  @param minimal true to do the bare minimum of work; just run through the content.  Useful for acquiring
- *  accurate frame counts as quickly as possible.  This generates no video or audio output.
  */
-Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal)
+Decoder::Decoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j)
        : _film (f)
        , _opt (o)
        , _job (j)
-       , _minimal (minimal)
        , _video_frame_index (0)
        , _delay_line (0)
        , _delay_in_bytes (0)
@@ -250,11 +247,6 @@ Decoder::process_video (AVFrame* frame)
 {
        assert (_film->length());
        
-       if (_minimal) {
-               ++_video_frame_index;
-               return;
-       }
-
        /* Use Film::length here as our one may be wrong */
 
        if (_opt->decode_video_skip != 0 && (_video_frame_index % _opt->decode_video_skip) != 0) {
index 5750858dfea2efb75c84c0a1cb9df42bc2102eff..fe8149af93deb3a633a133ff0ebbdefb149a8dc0 100644 (file)
@@ -52,7 +52,7 @@ class FilterGraph;
 class Decoder
 {
 public:
-       Decoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
+       Decoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *);
        virtual ~Decoder ();
 
        /* Methods to query our input video */
@@ -121,11 +121,6 @@ protected:
        /** associated Job, or 0 */
        Job* _job;
 
-       /** true to do the bare minimum of work; just run through the content.  Useful for acquiring
-        *  accurate frame counts as quickly as possible.  This generates no video or audio output.
-        */
-       bool _minimal;
-
 private:
        void emit_audio (uint8_t* data, int size);
        
index 287bba0da9b1759a638e9317be188c14d2ff764f..c3a6965e63af4976661da37ad6b719c2727e8481 100644 (file)
@@ -31,18 +31,16 @@ using std::string;
 using boost::shared_ptr;
 
 shared_ptr<Decoder>
-decoder_factory (
-       shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal = false
-       )
+decoder_factory (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j)
 {
        if (boost::filesystem::is_directory (f->content_path ())) {
                /* Assume a directory contains TIFFs */
-               return shared_ptr<Decoder> (new TIFFDecoder (f, o, j, minimal));
+               return shared_ptr<Decoder> (new TIFFDecoder (f, o, j));
        }
 
        if (f->content_type() == STILL) {
-               return shared_ptr<Decoder> (new ImageMagickDecoder (f, o, j, minimal));
+               return shared_ptr<Decoder> (new ImageMagickDecoder (f, o, j));
        }
        
-       return shared_ptr<Decoder> (new FFmpegDecoder (f, o, j, minimal));
+       return shared_ptr<Decoder> (new FFmpegDecoder (f, o, j));
 }
index b86c60c70f224b1f9b5a7825efb8541388aa2aae..3c16d0ec0071347233eec1b5c9651fb5dde77c93 100644 (file)
@@ -25,8 +25,5 @@ class Decoder;
 class Film;
 class Options;
 class Job;
-class Log;
 
-extern boost::shared_ptr<Decoder> decoder_factory (
-       boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool minimal = false
-       );
+extern boost::shared_ptr<Decoder> decoder_factory (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *);
index ec0d2409bb5fc059c597cdfa1f8bec3866ca5841..e71ab361aecf623090012aabc5969e1fedebdb5f 100644 (file)
@@ -66,7 +66,7 @@ ExamineContentJob::run ()
 
        descend (0.5);
 
-       _decoder = decoder_factory (_film, o, this, true);
+       _decoder = decoder_factory (_film, o, this);
        _decoder->go ();
 
        _film->set_length (_decoder->video_frame_index());
index f0e652cbe60663439c51b206547124e6378db478..77e8f365fe934ae6888bfdb755d510909e11b4d8 100644 (file)
@@ -55,8 +55,8 @@ using std::vector;
 using std::stringstream;
 using boost::shared_ptr;
 
-FFmpegDecoder::FFmpegDecoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal)
-       : Decoder (f, o, j, minimal)
+FFmpegDecoder::FFmpegDecoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j)
+       : Decoder (f, o, j)
        , _format_context (0)
        , _video_stream (-1)
        , _audio_stream (-1)
index fbd9e5255b57342b7cc3ef3a9c66985b59a75b54..0265f747804154d3d7ec43715eb7de710a710888 100644 (file)
@@ -52,7 +52,7 @@ class Log;
 class FFmpegDecoder : public Decoder
 {
 public:
-       FFmpegDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
+       FFmpegDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *);
        ~FFmpegDecoder ();
 
        /* Methods to query our input video */
index cacd307643363657b180ef348c0b37bc9a7b0682..cd5fc6535053bb46e87413d13c0516ce96524ed0 100644 (file)
@@ -877,7 +877,7 @@ Film::set_content (string c)
                shared_ptr<Options> o (new Options ("", "", ""));
                o->out_size = Size (1024, 1024);
                
-               shared_ptr<Decoder> d = decoder_factory (shared_from_this(), o, 0, 0);
+               shared_ptr<Decoder> d = decoder_factory (shared_from_this(), o, 0);
                
                set_size (d->native_size ());
                set_frames_per_second (d->frames_per_second ());
index 81349beca72e3ceb8a4ff37cd136698b78439140..cc2fd9d231fa0bd718b785be655cec4c40f740b7 100644 (file)
@@ -27,8 +27,8 @@ using namespace std;
 using namespace boost;
 
 ImageMagickDecoder::ImageMagickDecoder (
-       boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal)
-       : Decoder (f, o, j, minimal)
+       boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j)
+       : Decoder (f, o, j)
        , _done (false)
 {
        _magick_image = new Magick::Image (_film->content_path ());
index 85bcf4c5bc29811ee9acd36e0507315f10739dc4..b7ab9af18119cf0c1677d3c6a0993f2b48335463 100644 (file)
@@ -26,7 +26,7 @@ namespace Magick {
 class ImageMagickDecoder : public Decoder
 {
 public:
-       ImageMagickDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
+       ImageMagickDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *);
 
        float frames_per_second () const {
                return static_frames_per_second ();
index 2c050def67e8098e63056640fac2d095b7ad650d..7cca511dda884d0cdceb84178aea0030940f76fb 100644 (file)
@@ -44,11 +44,9 @@ using namespace boost;
 /** @param f Our Film.
  *  @param o Options.
  *  @param j Job that we are associated with, or 0.
- *  @param minimal true to do the bare minimum of work; just run through the content.  Useful for acquiring
- *  accurate frame counts as quickly as possible.  This generates no video or audio output.
  */
-TIFFDecoder::TIFFDecoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal)
-       : Decoder (f, o, j, minimal)
+TIFFDecoder::TIFFDecoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j)
+       : Decoder (f, o, j)
 {
        string const dir = _film->content_path ();
        
index c02a1d03d72c7373f776b9c71408a0b70b9cb883..1c33443cf17518d5e636fca8f087a4260f61a153 100644 (file)
@@ -42,7 +42,7 @@ class Image;
 class TIFFDecoder : public Decoder
 {
 public:
-       TIFFDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *, bool);
+       TIFFDecoder (boost::shared_ptr<Film>, boost::shared_ptr<const Options>, Job *);
 
        /* Methods to query our input video */
        float frames_per_second () const;