diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-06-20 16:25:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-06-20 16:25:52 +0100 |
| commit | edfd92e5554e3389e6456f497f44ca6e866800bf (patch) | |
| tree | d3b0196ec470016cf93cd273ba4d324d1ab0c39e /src/lib | |
| parent | 69efa47dbd1684c897f780c80fd68bdc05c817f4 (diff) | |
Remove A/B mode for now.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ab_transcode_job.cc | 68 | ||||
| -rw-r--r-- | src/lib/ab_transcode_job.h | 49 | ||||
| -rw-r--r-- | src/lib/ab_transcoder.cc | 66 | ||||
| -rw-r--r-- | src/lib/ab_transcoder.h | 59 | ||||
| -rw-r--r-- | src/lib/config.cc | 21 | ||||
| -rw-r--r-- | src/lib/config.h | 8 | ||||
| -rw-r--r-- | src/lib/film.cc | 28 | ||||
| -rw-r--r-- | src/lib/film.h | 12 | ||||
| -rw-r--r-- | src/lib/wscript | 2 |
9 files changed, 1 insertions, 312 deletions
diff --git a/src/lib/ab_transcode_job.cc b/src/lib/ab_transcode_job.cc deleted file mode 100644 index a29e78776..000000000 --- a/src/lib/ab_transcode_job.cc +++ /dev/null @@ -1,68 +0,0 @@ -/* - 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 <stdexcept> -#include "ab_transcode_job.h" -#include "film.h" -#include "ab_transcoder.h" -#include "config.h" -#include "log.h" - -#include "i18n.h" - -using std::string; -using boost::shared_ptr; - -/** @param f Film to compare. - */ -ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f) - : Job (f) -{ - _film_b.reset (new Film (*_film)); - _film_b->set_scaler (Config::instance()->reference_scaler ()); - /* XXX */ -// _film_b->set_filters (Config::instance()->reference_filters ()); -} - -string -ABTranscodeJob::name () const -{ - return String::compose (_("A/B transcode %1"), _film->name()); -} - -void -ABTranscodeJob::run () -{ - try { - /* _film_b is the one with reference filters */ - ABTranscoder w (_film_b, _film, shared_from_this ()); - w.go (); - set_progress (1); - set_state (FINISHED_OK); - - _film->log()->log ("A/B transcode job completed successfully"); - - } catch (std::exception& e) { - - set_progress (1); - set_state (FINISHED_ERROR); - _film->log()->log (String::compose ("A/B transcode job failed (%1)", e.what())); - throw; - } -} diff --git a/src/lib/ab_transcode_job.h b/src/lib/ab_transcode_job.h deleted file mode 100644 index cd82d4247..000000000 --- a/src/lib/ab_transcode_job.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - 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. - -*/ - -/** @file src/ab_transcode_job.h - * @brief Job to run a transcoder which produces output for A/B comparison of various settings. - */ - -#include <boost/shared_ptr.hpp> -#include "job.h" - -class Film; - -/** @class ABTranscodeJob - * @brief Job to run a transcoder which produces output for A/B comparison of various settings. - * - * The right half of the frame will be processed using the Film supplied; - * the left half will be processed using the same state but with the reference - * filters and scaler. - */ -class ABTranscodeJob : public Job -{ -public: - ABTranscodeJob ( - boost::shared_ptr<Film> f - ); - - std::string name () const; - void run (); - -private: - /** Copy of our Film using the reference filters and scaler */ - boost::shared_ptr<Film> _film_b; -}; diff --git a/src/lib/ab_transcoder.cc b/src/lib/ab_transcoder.cc deleted file mode 100644 index a5659b22f..000000000 --- a/src/lib/ab_transcoder.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* - 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 <iostream> -#include <boost/shared_ptr.hpp> -#include "ab_transcoder.h" -#include "film.h" -#include "encoder.h" -#include "job.h" -#include "image.h" -#include "player.h" -#include "combiner.h" - -/** @file src/ab_transcoder.cc - * @brief A transcoder which uses one Film for the left half of the screen, and a different one - * for the right half (to facilitate A/B comparisons of settings) - */ - -using std::string; -using boost::shared_ptr; -using boost::dynamic_pointer_cast; - -/** @param a Film to use for the left half of the screen. - * @param b Film to use for the right half of the screen. - * @param o Decoder options. - * @param j Job that we are associated with. - * @param e Encoder to use. - */ - -ABTranscoder::ABTranscoder (shared_ptr<Film> film_a, shared_ptr<Film> film_b, shared_ptr<Job> j) - : _player_a (film_a->player ()) - , _player_b (film_b->player ()) - , _job (j) - , _encoder (new Encoder (film_a, j)) - , _combiner (new Combiner) -{ - _player_a->Video.connect (bind (&Combiner::process_video, _combiner, _1, _2, _3)); - _player_b->Video.connect (bind (&Combiner::process_video_b, _combiner, _1, _2, _3)); - - _combiner->connect_video (_encoder); - _player_a->connect_audio (_encoder); -} - -void -ABTranscoder::go () -{ - _encoder->process_begin (); - while (!_player_a->pass () || !_player_b->pass ()) {} - _encoder->process_end (); -} diff --git a/src/lib/ab_transcoder.h b/src/lib/ab_transcoder.h deleted file mode 100644 index 54d7ed0be..000000000 --- a/src/lib/ab_transcoder.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - 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. - -*/ - -/** @file src/ab_transcoder.h - * @brief A transcoder which uses one Film for the left half of the screen, and a different one - * for the right half (to facilitate A/B comparisons of settings) - */ - -#include <boost/shared_ptr.hpp> -#include <stdint.h> -#include "util.h" - -class Job; -class Encoder; -class Image; -class Log; -class Film; -class Combiner; -class Player; - -/** @class ABTranscoder - * @brief A transcoder which uses one Film for the left half of the screen, and a different one - * for the right half (to facilitate A/B comparisons of settings) - */ -class ABTranscoder -{ -public: - ABTranscoder ( - boost::shared_ptr<Film> a, - boost::shared_ptr<Film> b, - boost::shared_ptr<Job> j - ); - - void go (); - -private: - boost::shared_ptr<Player> _player_a; - boost::shared_ptr<Player> _player_b; - boost::shared_ptr<Job> _job; - boost::shared_ptr<Encoder> _encoder; - boost::shared_ptr<Combiner> _combiner; - boost::shared_ptr<Image> _image; -}; diff --git a/src/lib/config.cc b/src/lib/config.cc index e4cebdc73..c9ec730f2 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -48,7 +48,6 @@ Config* Config::_instance = 0; Config::Config () : _num_local_encoding_threads (2) , _server_port (6192) - , _reference_scaler (Scaler::from_id (N_("bicubic"))) , _tms_path (N_(".")) , _sound_processor (SoundProcessor::from_id (N_("dolby_cp750"))) , _default_still_length (10) @@ -77,15 +76,6 @@ Config::read () _num_local_encoding_threads = f.number_child<int> ("NumLocalEncodingThreads"); _default_directory = f.string_child ("DefaultDirectory"); _server_port = f.number_child<int> ("ServerPort"); - c = f.optional_string_child ("ReferenceScaler"); - if (c) { - _reference_scaler = Scaler::from_id (c.get ()); - } - - list<shared_ptr<cxml::Node> > filters = f.node_children ("ReferenceFilter"); - for (list<shared_ptr<cxml::Node> >::iterator i = filters.begin(); i != filters.end(); ++i) { - _reference_filters.push_back (Filter::from_id ((*i)->content ())); - } list<shared_ptr<cxml::Node> > servers = f.node_children ("Server"); for (list<shared_ptr<cxml::Node> >::iterator i = servers.begin(); i != servers.end(); ++i) { @@ -149,10 +139,6 @@ Config::read_old_metadata () _default_directory = v; } else if (k == N_("server_port")) { _server_port = atoi (v.c_str ()); - } else if (k == N_("reference_scaler")) { - _reference_scaler = Scaler::from_id (v); - } else if (k == N_("reference_filter")) { - _reference_filters.push_back (Filter::from_id (v)); } else if (k == N_("server")) { _servers.push_back (ServerDescription::create_from_metadata (v)); } else if (k == N_("tms_ip")) { @@ -227,13 +213,6 @@ Config::write () const root->add_child("NumLocalEncodingThreads")->add_child_text (lexical_cast<string> (_num_local_encoding_threads)); root->add_child("DefaultDirectory")->add_child_text (_default_directory); root->add_child("ServerPort")->add_child_text (lexical_cast<string> (_server_port)); - if (_reference_scaler) { - root->add_child("ReferenceScaler")->add_child_text (_reference_scaler->id ()); - } - - for (vector<Filter const *>::const_iterator i = _reference_filters.begin(); i != _reference_filters.end(); ++i) { - root->add_child("ReferenceFilter")->add_child_text ((*i)->id ()); - } for (vector<ServerDescription*>::const_iterator i = _servers.begin(); i != _servers.end(); ++i) { (*i)->as_xml (root->add_child ("Server")); diff --git a/src/lib/config.h b/src/lib/config.h index 110bcc6a8..f3e8f1441 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -65,14 +65,6 @@ public: return _servers; } - Scaler const * reference_scaler () const { - return _reference_scaler; - } - - std::vector<Filter const *> reference_filters () const { - return _reference_filters; - } - /** @return The IP address of a TMS that we can copy DCPs to */ std::string tms_ip () const { return _tms_ip; diff --git a/src/lib/film.cc b/src/lib/film.cc index b50fe67d1..a29f6c331 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -36,7 +36,6 @@ #include "filter.h" #include "util.h" #include "job_manager.h" -#include "ab_transcode_job.h" #include "transcode_job.h" #include "scp_dcp_job.h" #include "log.h" @@ -94,7 +93,6 @@ Film::Film (string d) , _dcp_content_type (Config::instance()->default_dcp_content_type ()) , _container (Config::instance()->default_container ()) , _scaler (Scaler::from_id ("bicubic")) - , _ab (false) , _with_subtitles (false) , _subtitle_offset (0) , _subtitle_scale (1) @@ -143,7 +141,6 @@ Film::Film (Film const & o) , _dcp_content_type (o._dcp_content_type) , _container (o._container) , _scaler (o._scaler) - , _ab (o._ab) , _with_subtitles (o._with_subtitles) , _subtitle_offset (o._subtitle_offset) , _subtitle_scale (o._subtitle_scale) @@ -171,11 +168,6 @@ Film::video_state_identifier () const << "_" << j2k_bandwidth() << "_" << lexical_cast<int> (colour_lut()); - if (ab()) { - pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters()); - s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second; - } - return s.str (); } @@ -294,13 +286,7 @@ Film::make_dcp () throw MissingSettingError (_("name")); } - shared_ptr<Job> r; - - if (ab()) { - r = JobManager::instance()->add (shared_ptr<Job> (new ABTranscodeJob (shared_from_this()))); - } else { - r = JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this()))); - } + JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this()))); } /** Start a job to analyse the audio in our Playlist */ @@ -384,7 +370,6 @@ Film::write_metadata () const } root->add_child("Scaler")->add_child_text (_scaler->id ()); - root->add_child("AB")->add_child_text (_ab ? "1" : "0"); root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0"); root->add_child("SubtitleOffset")->add_child_text (lexical_cast<string> (_subtitle_offset)); root->add_child("SubtitleScale")->add_child_text (lexical_cast<string> (_subtitle_scale)); @@ -432,7 +417,6 @@ Film::read_metadata () } _scaler = Scaler::from_id (f.string_child ("Scaler")); - _ab = f.bool_child ("AB"); _with_subtitles = f.bool_child ("WithSubtitles"); _subtitle_offset = f.number_child<float> ("SubtitleOffset"); _subtitle_scale = f.number_child<float> ("SubtitleScale"); @@ -623,16 +607,6 @@ Film::set_scaler (Scaler const * s) } void -Film::set_ab (bool a) -{ - { - boost::mutex::scoped_lock lm (_state_mutex); - _ab = a; - } - signal_changed (AB); -} - -void Film::set_with_subtitles (bool w) { { diff --git a/src/lib/film.h b/src/lib/film.h index 28beeaed1..5f06a1dc7 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -135,7 +135,6 @@ public: DCP_CONTENT_TYPE, CONTAINER, SCALER, - AB, WITH_SUBTITLES, SUBTITLE_OFFSET, SUBTITLE_SCALE, @@ -178,11 +177,6 @@ public: return _scaler; } - bool ab () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _ab; - } - bool with_subtitles () const { boost::mutex::scoped_lock lm (_state_mutex); return _with_subtitles; @@ -235,7 +229,6 @@ public: void set_dcp_content_type (DCPContentType const *); void set_container (Ratio const *); void set_scaler (Scaler const *); - void set_ab (bool); void set_with_subtitles (bool); void set_subtitle_offset (int); void set_subtitle_scale (float); @@ -288,11 +281,6 @@ private: Ratio const * _container; /** Scaler algorithm to use */ Scaler const * _scaler; - /** true to create an A/B comparison DCP, where the left half of the image - is the video without any filters or post-processing, and the right half - has the specified filters and post-processing. - */ - bool _ab; /** True if subtitles should be shown for this film */ bool _with_subtitles; /** y offset for placing subtitles, in source pixels; +ve is further down diff --git a/src/lib/wscript b/src/lib/wscript index 6e69b98b2..9945fc753 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -2,8 +2,6 @@ import os import i18n sources = """ - ab_transcode_job.cc - ab_transcoder.cc analyse_audio_job.cc audio_analysis.cc audio_buffers.cc |
