diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-08-29 14:50:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-08-29 14:50:55 +0100 |
| commit | b8724f408298ff3e804fb821fa15d3bcded0e3db (patch) | |
| tree | 6b551ad6a7bc2845f105a5f44bc5151d9e600d1a | |
| parent | e60d69b3462755c5f98a460688d391822fdc62fb (diff) | |
| parent | 11619ba7fd5537407798c01c6ca299fb64422338 (diff) | |
Merge branch '1.0' of /home/carl/git/dvdomatic into 1.0
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | src/lib/encoder.cc | 12 | ||||
| -rw-r--r-- | src/lib/encoder.h | 15 | ||||
| -rw-r--r-- | src/lib/transcode_job.cc | 7 | ||||
| -rw-r--r-- | src/lib/transcoder.cc | 6 | ||||
| -rw-r--r-- | src/lib/transcoder.h | 14 | ||||
| -rw-r--r-- | src/lib/writer.cc | 14 | ||||
| -rw-r--r-- | src/wx/server_dialog.cc | 9 |
8 files changed, 57 insertions, 25 deletions
@@ -1,5 +1,10 @@ 2013-08-29 Carl Hetherington <cth@carlh.net> + * Remove limitation to numbers and periods in the + server host name dialogue box. + + * Fix stuck-at-99% progress meters (#184). + * Version 1.01beta1 released. 2013-08-29 Carl Hetherington <cth@carlh.net> diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index ea175f1f4..35ebfb52e 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -52,6 +52,7 @@ Encoder::Encoder (shared_ptr<const Film> f, shared_ptr<Job> j) : _film (f) , _job (j) , _video_frames_out (0) + , _state (TRANSCODING) , _terminate (false) { _have_a_real_frame[EYES_BOTH] = false; @@ -125,6 +126,11 @@ Encoder::process_end () } } + { + boost::mutex::scoped_lock lm (_state_mutex); + _state = HASHING; + } + _writer->finish (); _writer.reset (); } @@ -135,7 +141,7 @@ Encoder::process_end () float Encoder::current_encoding_rate () const { - boost::mutex::scoped_lock lock (_history_mutex); + boost::mutex::scoped_lock lock (_state_mutex); if (int (_time_history.size()) < _history_size) { return 0; } @@ -150,7 +156,7 @@ Encoder::current_encoding_rate () const int Encoder::video_frames_out () const { - boost::mutex::scoped_lock (_history_mutex); + boost::mutex::scoped_lock (_state_mutex); return _video_frames_out; } @@ -160,7 +166,7 @@ Encoder::video_frames_out () const void Encoder::frame_done () { - boost::mutex::scoped_lock lock (_history_mutex); + boost::mutex::scoped_lock lock (_state_mutex); struct timeval tv; gettimeofday (&tv, 0); diff --git a/src/lib/encoder.h b/src/lib/encoder.h index 44134e568..e9b30df9e 100644 --- a/src/lib/encoder.h +++ b/src/lib/encoder.h @@ -77,6 +77,16 @@ public: float current_encoding_rate () const; int video_frames_out () const; + enum State { + TRANSCODING, + HASHING + }; + + State state () const { + boost::mutex::scoped_lock lm (_state_mutex); + return _state; + } + private: void frame_done (); @@ -88,8 +98,8 @@ private: boost::shared_ptr<const Film> _film; boost::shared_ptr<Job> _job; - /** Mutex for _time_history and _last_frame */ - mutable boost::mutex _history_mutex; + /** Mutex for _time_history, _last_frame and _state */ + mutable boost::mutex _state_mutex; /** List of the times of completion of the last _history_size frames; first is the most recently completed. */ @@ -99,6 +109,7 @@ private: /** Number of video frames written for the DCP so far */ int _video_frames_out; + State _state; bool _have_a_real_frame[EYES_COUNT]; bool _terminate; diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index 6d5edd7c0..c9ec2053d 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -91,7 +91,12 @@ TranscodeJob::status () const s << Job::status (); if (!finished ()) { - s << N_("; ") << fixed << setprecision (1) << fps << N_(" ") << _("frames per second"); + if (_transcoder->state() == Encoder::TRANSCODING) { + s << "; " << fixed << setprecision (1) << fps << N_(" ") << _("frames per second"); + } else { + /* TRANSLATORS: this means `computing a hash' as in a digest of a block of data */ + s << "; " << _("hashing"); + } } return s.str (); diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc index 715a158db..63ba77939 100644 --- a/src/lib/transcoder.cc +++ b/src/lib/transcoder.cc @@ -90,3 +90,9 @@ Transcoder::video_frames_out () const { return _encoder->video_frames_out (); } + +Encoder::State +Transcoder::state () const +{ + return _encoder->state (); +} diff --git a/src/lib/transcoder.h b/src/lib/transcoder.h index 007065b65..7bf214a88 100644 --- a/src/lib/transcoder.h +++ b/src/lib/transcoder.h @@ -18,12 +18,7 @@ */ #include "types.h" - -/** @file src/transcoder.h - * - * A decoder is selected according to the content type, and the encoder can be specified - * as a parameter to the constructor. - */ +#include "encoder.h" class Film; class Job; @@ -31,11 +26,7 @@ class Encoder; class VideoFilter; class Player; -/** @class Transcoder - * - * A decoder is selected according to the content type, and the encoder can be specified - * as a parameter to the constructor. - */ +/** @class Transcoder */ class Transcoder : public boost::noncopyable { public: @@ -47,6 +38,7 @@ public: void go (); float current_encoding_rate () const; + Encoder::State state () const; int video_frames_out () const; private: diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 2e0ffd833..5f94d5d6b 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -110,6 +110,8 @@ Writer::Writer (shared_ptr<const Film> f, shared_ptr<Job> j) _sound_asset_writer = _sound_asset->start_write (_film->interop ()); _thread = new boost::thread (boost::bind (&Writer::thread, this)); + + _job->descend (0.9); } void @@ -389,6 +391,18 @@ Writer::finish () ) )); + /* Compute the digests for the assets now so that we can keep track of progress. + We did _job->descend (0.9) in our constructor */ + _job->ascend (); + + _job->descend (0.1); + _picture_asset->compute_digest (boost::bind (&Job::set_progress, _job.get(), _1)); + _job->ascend (); + + _job->descend (0.1); + _sound_asset->compute_digest (boost::bind (&Job::set_progress, _job.get(), _1)); + _job->ascend (); + libdcp::XMLMetadata meta = Config::instance()->dcp_metadata (); meta.set_issue_date_now (); dcp.write_xml (_film->interop (), meta); diff --git a/src/wx/server_dialog.cc b/src/wx/server_dialog.cc index 5e360b690..c1dbc4bca 100644 --- a/src/wx/server_dialog.cc +++ b/src/wx/server_dialog.cc @@ -37,15 +37,8 @@ ServerDialog::ServerDialog (wxWindow* parent) wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); wxArrayString list; - wxString n (wxT ("0123456789.")); - for (size_t i = 0; i < n.Length(); ++i) { - list.Add (n[i]); - } - - validator.SetIncludes (list); - add_label_to_sizer (table, this, _("Host name or IP address"), true); - _host = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, size, 0, validator); + _host = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, size); table->Add (_host, 1, wxEXPAND | wxALL); add_label_to_sizer (table, this, _("Threads to use"), true); |
