summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-16 12:55:27 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-16 12:55:27 +0000
commit0813034d7193dc8869126d13a9d12d2c4d1e6c14 (patch)
tree3ba910406777a229badba02189c4daf072503524 /src
parentc726a221e619d22ad5253eaa6c3429bce557e111 (diff)
Remove apply crop flag.
Diffstat (limited to 'src')
-rw-r--r--src/lib/examine_content_job.cc2
-rw-r--r--src/lib/ffmpeg_decoder.cc2
-rw-r--r--src/lib/filter_graph.cc9
-rw-r--r--src/lib/filter_graph.h2
-rw-r--r--src/lib/options.h2
-rw-r--r--src/lib/video_decoder.cc2
-rw-r--r--src/tools/servomatictest.cc1
7 files changed, 6 insertions, 14 deletions
diff --git a/src/lib/examine_content_job.cc b/src/lib/examine_content_job.cc
index 5c565cd88..eaf1033d9 100644
--- a/src/lib/examine_content_job.cc
+++ b/src/lib/examine_content_job.cc
@@ -65,10 +65,10 @@ ExamineContentJob::run ()
will be messed up.
*/
_film->unset_length ();
+ _film->set_crop (Crop ());
shared_ptr<Options> o (new Options ("", "", ""));
o->out_size = Size (512, 512);
- o->apply_crop = false;
o->decode_audio = false;
descend (1);
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index c7c96ce68..7b97a422e 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -534,7 +534,7 @@ FFmpegDecoder::filter_and_emit_video (AVFrame* frame)
}
if (i == _filter_graphs.end ()) {
- graph.reset (new FilterGraph (_film, this, _opt->apply_crop, Size (frame->width, frame->height), (AVPixelFormat) frame->format));
+ graph.reset (new FilterGraph (_film, this, Size (frame->width, frame->height), (AVPixelFormat) frame->format));
_filter_graphs.push_back (graph);
_film->log()->log (String::compose ("New graph for %1x%2, pixel format %3", frame->width, frame->height, frame->format));
} else {
diff --git a/src/lib/filter_graph.cc b/src/lib/filter_graph.cc
index 7320070fe..17107a05b 100644
--- a/src/lib/filter_graph.cc
+++ b/src/lib/filter_graph.cc
@@ -49,11 +49,10 @@ using boost::shared_ptr;
/** Construct a FilterGraph for the settings in a film.
* @param film Film.
* @param decoder Decoder that we are using.
- * @param crop true to apply crop, otherwise false.
* @param s Size of the images to process.
* @param p Pixel format of the images to process.
*/
-FilterGraph::FilterGraph (shared_ptr<Film> film, FFmpegDecoder* decoder, bool crop, Size s, AVPixelFormat p)
+FilterGraph::FilterGraph (shared_ptr<Film> film, FFmpegDecoder* decoder, Size s, AVPixelFormat p)
: _buffer_src_context (0)
, _buffer_sink_context (0)
, _size (s)
@@ -64,11 +63,7 @@ FilterGraph::FilterGraph (shared_ptr<Film> film, FFmpegDecoder* decoder, bool cr
filters += ",";
}
- if (crop) {
- filters += crop_string (Position (film->crop().left, film->crop().top), film->cropped_size (decoder->native_size()));
- } else {
- filters += crop_string (Position (0, 0), decoder->native_size());
- }
+ filters += crop_string (Position (film->crop().left, film->crop().top), film->cropped_size (decoder->native_size()));
avfilter_register_all ();
diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h
index 3842e9f7d..a4b9ef75f 100644
--- a/src/lib/filter_graph.h
+++ b/src/lib/filter_graph.h
@@ -36,7 +36,7 @@ class FFmpegDecoder;
class FilterGraph
{
public:
- FilterGraph (boost::shared_ptr<Film> film, FFmpegDecoder* decoder, bool crop, Size s, AVPixelFormat p);
+ FilterGraph (boost::shared_ptr<Film> film, FFmpegDecoder* decoder, Size s, AVPixelFormat p);
bool can_process (Size s, AVPixelFormat p) const;
std::list<boost::shared_ptr<Image> > process (AVFrame const * frame);
diff --git a/src/lib/options.h b/src/lib/options.h
index 65c7b9ebc..9b3866dcb 100644
--- a/src/lib/options.h
+++ b/src/lib/options.h
@@ -39,7 +39,6 @@ public:
Options (std::string f, std::string e, std::string m)
: padding (0)
- , apply_crop (true)
, decode_video_skip (0)
, decode_audio (true)
, decode_subtitles (false)
@@ -97,7 +96,6 @@ public:
Size out_size; ///< size of output images
float ratio; ///< ratio of the wanted output image (not considering padding)
int padding; ///< number of pixels of padding (in terms of the output size) each side of the image
- bool apply_crop; ///< true to apply cropping
/** Range of video frames to decode */
boost::optional<std::pair<SourceFrame, SourceFrame> > video_decode_range;
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc
index 23a69f958..03a697865 100644
--- a/src/lib/video_decoder.cc
+++ b/src/lib/video_decoder.cc
@@ -77,7 +77,7 @@ VideoDecoder::emit_subtitle (shared_ptr<TimedSubtitle> s)
{
_timed_subtitle = s;
- if (_timed_subtitle && _opt->apply_crop) {
+ if (_timed_subtitle) {
Position const p = _timed_subtitle->subtitle()->position ();
_timed_subtitle->subtitle()->set_position (Position (p.x - _film->crop().left, p.y - _film->crop().top));
}
diff --git a/src/tools/servomatictest.cc b/src/tools/servomatictest.cc
index d6804c981..41ec8075d 100644
--- a/src/tools/servomatictest.cc
+++ b/src/tools/servomatictest.cc
@@ -135,7 +135,6 @@ main (int argc, char* argv[])
shared_ptr<Options> opt (new Options ("fred", "jim", "sheila"));
opt->out_size = Size (1024, 1024);
- opt->apply_crop = false;
opt->decode_audio = false;
shared_ptr<Decoder> decoder = decoder_factory (film.state_copy(), opt, 0, &log_);