diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-23 16:51:07 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-23 16:51:07 +0100 |
| commit | 38fda7888663429d452b9c71902e8bb5239dd720 (patch) | |
| tree | 93d05ef9dc1e3d04d198452393dd626717f6346c /src | |
| parent | 89ea093ab1ed7a526b9332922c674d9eca42d7f2 (diff) | |
Remove some dcp prefixes; better logging of content on DCP creation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/analyse_audio_job.cc | 4 | ||||
| -rw-r--r-- | src/lib/audio_content.cc | 6 | ||||
| -rw-r--r-- | src/lib/audio_content.h | 1 | ||||
| -rw-r--r-- | src/lib/content.cc | 6 | ||||
| -rw-r--r-- | src/lib/content.h | 1 | ||||
| -rw-r--r-- | src/lib/encoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 32 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 1 | ||||
| -rw-r--r-- | src/lib/film.cc | 83 | ||||
| -rw-r--r-- | src/lib/film.h | 43 | ||||
| -rw-r--r-- | src/lib/player.cc | 24 | ||||
| -rw-r--r-- | src/lib/sndfile_content.cc | 10 | ||||
| -rw-r--r-- | src/lib/sndfile_content.h | 1 | ||||
| -rw-r--r-- | src/lib/still_image_content.cc | 10 | ||||
| -rw-r--r-- | src/lib/still_image_content.h | 1 | ||||
| -rw-r--r-- | src/lib/still_image_examiner.cc | 2 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 6 | ||||
| -rw-r--r-- | src/lib/video_content.h | 1 | ||||
| -rw-r--r-- | src/lib/writer.cc | 24 | ||||
| -rw-r--r-- | src/wx/audio_panel.cc | 4 | ||||
| -rw-r--r-- | src/wx/film_editor.cc | 98 | ||||
| -rw-r--r-- | src/wx/film_editor.h | 20 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 6 | ||||
| -rw-r--r-- | src/wx/timing_panel.cc | 8 |
24 files changed, 229 insertions, 165 deletions
diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 2848c1ed7..3902ec537 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -70,8 +70,8 @@ AnalyseAudioJob::run () _samples_per_point = max (int64_t (1), _film->time_to_audio_frames (_film->length()) / _num_points); - _current.resize (_film->dcp_audio_channels ()); - _analysis.reset (new AudioAnalysis (_film->dcp_audio_channels ())); + _current.resize (_film->audio_channels ()); + _analysis.reset (new AudioAnalysis (_film->audio_channels ())); _done = 0; while (!player->pass ()) { diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 4814f8244..100264d44 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -112,3 +112,9 @@ AudioContent::audio_analysis_path () const return film->audio_analysis_path (dynamic_pointer_cast<const AudioContent> (shared_from_this ())); } + +string +AudioContent::technical_summary () const +{ + return String::compose ("audio: channels %1, length %2, raw rate %3, out rate %4", audio_channels(), audio_length(), content_audio_frame_rate(), output_audio_frame_rate()); +} diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 58d00e686..73919105d 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -48,6 +48,7 @@ public: AudioContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>); void as_xml (xmlpp::Node *) const; + std::string technical_summary () const; virtual int audio_channels () const = 0; virtual AudioContent::Frame audio_length () const = 0; diff --git a/src/lib/content.cc b/src/lib/content.cc index cca4d56de..0db93d5e3 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -109,3 +109,9 @@ Content::clone () const as_xml (node); return content_factory (film, shared_ptr<cxml::Node> (new cxml::Node (node))); } + +string +Content::technical_summary () const +{ + return String::compose ("%1 %2 %3", file(), digest(), start()); +} diff --git a/src/lib/content.h b/src/lib/content.h index 26e115354..33af0a624 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -52,6 +52,7 @@ public: virtual void examine (boost::shared_ptr<Job>); virtual std::string summary () const = 0; + virtual std::string technical_summary () const; virtual std::string information () const = 0; virtual void as_xml (xmlpp::Node *) const; virtual Time length () const = 0; diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 7959fda6f..0c7434220 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -205,7 +205,7 @@ Encoder::process_video (shared_ptr<const Image> image, Eyes eyes, bool same) TIMING ("adding to queue of %1", _queue.size ()); _queue.push_back (shared_ptr<DCPVideoFrame> ( new DCPVideoFrame ( - image, _video_frames_out, eyes, _film->dcp_video_frame_rate(), + image, _video_frames_out, eyes, _film->video_frame_rate(), _film->j2k_bandwidth(), _film->log() ) )); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 8419fd31f..00499cf13 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -34,6 +34,7 @@ using std::stringstream; using std::vector; using std::list; using std::cout; +using std::pair; using boost::shared_ptr; using boost::lexical_cast; @@ -169,6 +170,28 @@ FFmpegContent::summary () const } string +FFmpegContent::technical_summary () const +{ + string as = "none"; + if (_audio_stream) { + as = String::compose ("id %1", _audio_stream->id); + } + + string ss = "none"; + if (_subtitle_stream) { + ss = String::compose ("id %1", _subtitle_stream->id); + } + + pair<string, string> filt = Filter::ffmpeg_strings (_filters); + + return Content::technical_summary() + " - " + + VideoContent::technical_summary() + " - " + + String::compose ( + "ffmpeg: audio %1, subtitle %2, filters %3 %4", as, ss, filt.first, filt.second + ); +} + +string FFmpegContent::information () const { if (video_length() == 0 || video_frame_rate() == 0) { @@ -253,7 +276,7 @@ FFmpegContent::output_audio_frame_rate () const /* Resample to a DCI-approved sample rate */ double t = dcp_audio_frame_rate (content_audio_frame_rate ()); - FrameRateConversion frc (video_frame_rate(), film->dcp_video_frame_rate()); + FrameRateConversion frc (video_frame_rate(), film->video_frame_rate()); /* Compensate if the DCP is being run at a different frame rate to the source; that is, if the video is run such that it will @@ -262,7 +285,7 @@ FFmpegContent::output_audio_frame_rate () const */ if (frc.change_speed) { - t *= video_frame_rate() * frc.factor() / film->dcp_video_frame_rate(); + t *= video_frame_rate() * frc.factor() / film->video_frame_rate(); } return rint (t); @@ -326,8 +349,8 @@ FFmpegContent::length () const shared_ptr<const Film> film = _film.lock (); assert (film); - FrameRateConversion frc (video_frame_rate (), film->dcp_video_frame_rate ()); - return video_length() * frc.factor() * TIME_HZ / film->dcp_video_frame_rate (); + FrameRateConversion frc (video_frame_rate (), film->video_frame_rate ()); + return video_length() * frc.factor() * TIME_HZ / film->video_frame_rate (); } AudioMapping @@ -379,3 +402,4 @@ FFmpegContent::identifier () const return s.str (); } + diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 1af586a71..96d8c1727 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -104,6 +104,7 @@ public: void examine (boost::shared_ptr<Job>); std::string summary () const; + std::string technical_summary () const; std::string information () const; void as_xml (xmlpp::Node *) const; Time length () const; diff --git a/src/lib/film.cc b/src/lib/film.cc index e9c60429d..b8a26501e 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -93,9 +93,9 @@ Film::Film (string d) , _with_subtitles (false) , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ()) , _dci_metadata (Config::instance()->default_dci_metadata ()) - , _dcp_video_frame_rate (24) - , _dcp_audio_channels (MAX_AUDIO_CHANNELS) - , _dcp_3d (false) + , _video_frame_rate (24) + , _audio_channels (MAX_AUDIO_CHANNELS) + , _three_d (false) , _sequence_video (true) , _dirty (false) { @@ -138,11 +138,11 @@ Film::video_identifier () const s << container()->id() << "_" << resolution_to_string (_resolution) << "_" << _playlist->video_identifier() - << "_" << _dcp_video_frame_rate + << "_" << _video_frame_rate << "_" << scaler()->id() << "_" << j2k_bandwidth(); - if (_dcp_3d) { + if (_three_d) { s << "_3D"; } @@ -172,13 +172,13 @@ Film::internal_video_mxf_filename () const } string -Film::dcp_video_mxf_filename () const +Film::video_mxf_filename () const { return filename_safe_name() + "_video.mxf"; } string -Film::dcp_audio_mxf_filename () const +Film::audio_mxf_filename () const { return filename_safe_name() + "_audio.mxf"; } @@ -224,13 +224,12 @@ Film::make_dcp () gethostname (buffer, sizeof (buffer)); log()->log (String::compose ("Starting to make DCP on %1", buffer)); } - -// log()->log (String::compose ("Content is %1; type %2", content_path(), (content_type() == STILL ? _("still") : _("video")))); -// if (length()) { -// log()->log (String::compose ("Content length %1", length().get())); -// } -// log()->log (String::compose ("Content digest %1", content_digest())); -// log()->log (String::compose ("Content at %1 fps, DCP at %2 fps", source_frame_rate(), dcp_frame_rate())); + + ContentList cl = content (); + for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) { + log()->log (String::compose ("Content: %1", (*i)->technical_summary())); + } + log()->log (String::compose ("DCP video rate %2 fps", video_frame_rate())); log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads())); log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth())); #ifdef DCPOMATIC_DEBUG @@ -329,10 +328,10 @@ Film::write_metadata () const root->add_child("WithSubtitles")->add_child_text (_with_subtitles ? "1" : "0"); root->add_child("J2KBandwidth")->add_child_text (lexical_cast<string> (_j2k_bandwidth)); _dci_metadata.as_xml (root->add_child ("DCIMetadata")); - root->add_child("DCPVideoFrameRate")->add_child_text (lexical_cast<string> (_dcp_video_frame_rate)); + root->add_child("VideoFrameRate")->add_child_text (lexical_cast<string> (_video_frame_rate)); root->add_child("DCIDate")->add_child_text (boost::gregorian::to_iso_string (_dci_date)); - root->add_child("DCPAudioChannels")->add_child_text (lexical_cast<string> (_dcp_audio_channels)); - root->add_child("DCP3D")->add_child_text (_dcp_3d ? "1" : "0"); + root->add_child("AudioChannels")->add_child_text (lexical_cast<string> (_audio_channels)); + root->add_child("3D")->add_child_text (_three_d ? "1" : "0"); root->add_child("SequenceVideo")->add_child_text (_sequence_video ? "1" : "0"); _playlist->as_xml (root->add_child ("Playlist")); @@ -376,11 +375,11 @@ Film::read_metadata () _with_subtitles = f.bool_child ("WithSubtitles"); _j2k_bandwidth = f.number_child<int> ("J2KBandwidth"); _dci_metadata = DCIMetadata (f.node_child ("DCIMetadata")); - _dcp_video_frame_rate = f.number_child<int> ("DCPVideoFrameRate"); + _video_frame_rate = f.number_child<int> ("VideoFrameRate"); _dci_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate")); - _dcp_audio_channels = f.number_child<int> ("DCPAudioChannels"); + _audio_channels = f.number_child<int> ("AudioChannels"); _sequence_video = f.bool_child ("SequenceVideo"); - _dcp_3d = f.bool_child ("DCP3D"); + _three_d = f.bool_child ("3D"); _playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist")); @@ -446,12 +445,12 @@ Film::dci_name (bool if_created_now) const d << "_" << dcp_content_type()->dci_name(); } - if (dcp_3d ()) { + if (three_d ()) { d << "-3D"; } - if (dcp_video_frame_rate() != 24) { - d << "-" << dcp_video_frame_rate(); + if (video_frame_rate() != 24) { + d << "-" << video_frame_rate(); } if (container()) { @@ -476,7 +475,7 @@ Film::dci_name (bool if_created_now) const } } - switch (dcp_audio_channels ()) { + switch (audio_channels ()) { case 1: d << "_10"; break; @@ -631,33 +630,33 @@ Film::set_dci_metadata (DCIMetadata m) } void -Film::set_dcp_video_frame_rate (int f) +Film::set_video_frame_rate (int f) { { boost::mutex::scoped_lock lm (_state_mutex); - _dcp_video_frame_rate = f; + _video_frame_rate = f; } - signal_changed (DCP_VIDEO_FRAME_RATE); + signal_changed (VIDEO_FRAME_RATE); } void -Film::set_dcp_audio_channels (int c) +Film::set_audio_channels (int c) { { boost::mutex::scoped_lock lm (_state_mutex); - _dcp_audio_channels = c; + _audio_channels = c; } - signal_changed (DCP_AUDIO_CHANNELS); + signal_changed (AUDIO_CHANNELS); } void -Film::set_dcp_3d (bool t) +Film::set_three_d (bool t) { { boost::mutex::scoped_lock lm (_state_mutex); - _dcp_3d = t; + _three_d = t; } - signal_changed (DCP_3D); + signal_changed (THREE_D); } void @@ -670,9 +669,9 @@ Film::signal_changed (Property p) switch (p) { case Film::CONTENT: - set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ()); + set_video_frame_rate (_playlist->best_dcp_frame_rate ()); break; - case Film::DCP_VIDEO_FRAME_RATE: + case Film::VIDEO_FRAME_RATE: case Film::SEQUENCE_VIDEO: _playlist->maybe_sequence_video (); break; @@ -833,7 +832,7 @@ Film::has_subtitles () const } OutputVideoFrame -Film::best_dcp_video_frame_rate () const +Film::best_video_frame_rate () const { return _playlist->best_dcp_frame_rate (); } @@ -842,7 +841,7 @@ void Film::playlist_content_changed (boost::weak_ptr<Content> c, int p) { if (p == VideoContentProperty::VIDEO_FRAME_RATE) { - set_dcp_video_frame_rate (_playlist->best_dcp_frame_rate ()); + set_video_frame_rate (_playlist->best_dcp_frame_rate ()); } if (ui_signaller) { @@ -859,29 +858,29 @@ Film::playlist_changed () OutputAudioFrame Film::time_to_audio_frames (Time t) const { - return t * dcp_audio_frame_rate () / TIME_HZ; + return t * audio_frame_rate () / TIME_HZ; } OutputVideoFrame Film::time_to_video_frames (Time t) const { - return t * dcp_video_frame_rate () / TIME_HZ; + return t * video_frame_rate () / TIME_HZ; } Time Film::audio_frames_to_time (OutputAudioFrame f) const { - return f * TIME_HZ / dcp_audio_frame_rate (); + return f * TIME_HZ / audio_frame_rate (); } Time Film::video_frames_to_time (OutputVideoFrame f) const { - return f * TIME_HZ / dcp_video_frame_rate (); + return f * TIME_HZ / video_frame_rate (); } OutputAudioFrame -Film::dcp_audio_frame_rate () const +Film::audio_frame_rate () const { /* XXX */ return 48000; diff --git a/src/lib/film.h b/src/lib/film.h index 5aff6f0be..7279541e4 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -61,8 +61,8 @@ public: std::string internal_video_mxf_filename () const; boost::filesystem::path audio_analysis_path (boost::shared_ptr<const AudioContent>) const; - std::string dcp_video_mxf_filename () const; - std::string dcp_audio_mxf_filename () const; + std::string video_mxf_filename () const; + std::string audio_mxf_filename () const; void send_dcp_to_tms (); void make_dcp (); @@ -97,7 +97,7 @@ public: boost::shared_ptr<Player> make_player () const; boost::shared_ptr<Playlist> playlist () const; - OutputAudioFrame dcp_audio_frame_rate () const; + OutputAudioFrame audio_frame_rate () const; OutputAudioFrame time_to_audio_frames (Time) const; OutputVideoFrame time_to_video_frames (Time) const; @@ -110,7 +110,7 @@ public: Time length () const; bool has_subtitles () const; - OutputVideoFrame best_dcp_video_frame_rate () const; + OutputVideoFrame best_video_frame_rate () const; /** Identifiers for the parts of our state; used for signalling changes. @@ -128,10 +128,10 @@ public: WITH_SUBTITLES, J2K_BANDWIDTH, DCI_METADATA, - DCP_VIDEO_FRAME_RATE, - DCP_AUDIO_CHANNELS, - /** The setting of _dcp_3d has been changed */ - DCP_3D, + VIDEO_FRAME_RATE, + AUDIO_CHANNELS, + /** The setting of _three_d has been changed */ + THREE_D, SEQUENCE_VIDEO, }; @@ -188,20 +188,20 @@ public: return _dci_metadata; } - /* XXX: -> "video_frame_rate" */ - int dcp_video_frame_rate () const { + /** @return The frame rate of the DCP */ + int video_frame_rate () const { boost::mutex::scoped_lock lm (_state_mutex); - return _dcp_video_frame_rate; + return _video_frame_rate; } - int dcp_audio_channels () const { + int audio_channels () const { boost::mutex::scoped_lock lm (_state_mutex); - return _dcp_audio_channels; + return _audio_channels; } - bool dcp_3d () const { + bool three_d () const { boost::mutex::scoped_lock lm (_state_mutex); - return _dcp_3d; + return _three_d; } bool sequence_video () const { @@ -225,9 +225,9 @@ public: void set_with_subtitles (bool); void set_j2k_bandwidth (int); void set_dci_metadata (DCIMetadata); - void set_dcp_video_frame_rate (int); - void set_dcp_audio_channels (int); - void set_dcp_3d (bool); + void set_video_frame_rate (int); + void set_audio_channels (int); + void set_three_d (bool); void set_dci_date_today (); void set_sequence_video (bool); @@ -279,14 +279,15 @@ private: /** DCI naming stuff */ DCIMetadata _dci_metadata; /** Frames per second to run our DCP at */ - int _dcp_video_frame_rate; + int _video_frame_rate; /** The date that we should use in a DCI name */ boost::gregorian::date _dci_date; - int _dcp_audio_channels; + /** Number of audio channels to put in the DCP */ + int _audio_channels; /** If true, the DCP will be written in 3D mode; otherwise in 2D. This will be regardless of what content is on the playlist. */ - bool _dcp_3d; + bool _three_d; bool _sequence_video; /** true if our state has changed since we last saved it */ diff --git a/src/lib/player.cc b/src/lib/player.cc index e1173a36b..e50f26534 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -95,7 +95,7 @@ Player::Player (shared_ptr<const Film> f, shared_ptr<const Playlist> p) , _have_valid_pieces (false) , _video_position (0) , _audio_position (0) - , _audio_buffers (f->dcp_audio_channels(), 0) + , _audio_buffers (f->audio_channels(), 0) { _playlist->Changed.connect (bind (&Player::playlist_changed, this)); _playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3)); @@ -213,7 +213,7 @@ Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image shared_ptr<VideoContent> content = dynamic_pointer_cast<VideoContent> (piece->content); assert (content); - FrameRateConversion frc (content->video_frame_rate(), _film->dcp_video_frame_rate()); + FrameRateConversion frc (content->video_frame_rate(), _film->video_frame_rate()); if (frc.skip && (frame % 2) == 1) { return; } @@ -224,7 +224,7 @@ Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image work_image = work_image->scale_and_convert_to_rgb (image_size, _film->scaler(), true); - Time time = content->start() + (frame * frc.factor() * TIME_HZ / _film->dcp_video_frame_rate()); + Time time = content->start() + (frame * frc.factor() * TIME_HZ / _film->video_frame_rate()); if (_film->with_subtitles () && _out_subtitle.image && time >= _out_subtitle.from && time <= _out_subtitle.to) { work_image->alpha_blend (_out_subtitle.image, _out_subtitle.position); @@ -244,11 +244,11 @@ Player::process_video (weak_ptr<Piece> weak_piece, shared_ptr<const Image> image #endif Video (work_image, eyes, same, time); - time += TIME_HZ / _film->dcp_video_frame_rate(); + time += TIME_HZ / _film->video_frame_rate(); if (frc.repeat) { Video (work_image, eyes, true, time); - time += TIME_HZ / _film->dcp_video_frame_rate(); + time += TIME_HZ / _film->video_frame_rate(); } _video_position = piece->video_position = time; @@ -272,7 +272,7 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers } /* Remap channels */ - shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->dcp_audio_channels(), audio->frames())); + shared_ptr<AudioBuffers> dcp_mapped (new AudioBuffers (_film->audio_channels(), audio->frames())); dcp_mapped->make_silent (); list<pair<int, libdcp::Channel> > map = content->audio_mapping().content_to_dcp (); for (list<pair<int, libdcp::Channel> >::iterator i = map.begin(); i != map.end(); ++i) { @@ -283,11 +283,11 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers audio = dcp_mapped; - Time time = content->start() + (frame * TIME_HZ / _film->dcp_audio_frame_rate()) + (content->audio_delay() * TIME_HZ / 1000); + Time time = content->start() + (frame * TIME_HZ / _film->audio_frame_rate()) + (content->audio_delay() * TIME_HZ / 1000); /* We must cut off anything that comes before the start of all time */ if (time < 0) { - int const frames = - time * _film->dcp_audio_frame_rate() / TIME_HZ; + int const frames = - time * _film->audio_frame_rate() / TIME_HZ; if (frames >= audio->frames ()) { return; } @@ -381,12 +381,12 @@ Player::seek (Time t, bool accurate) (*i)->video_position = (*i)->audio_position = vc->start() + s; - FrameRateConversion frc (vc->video_frame_rate(), _film->dcp_video_frame_rate()); + FrameRateConversion frc (vc->video_frame_rate(), _film->video_frame_rate()); /* Here we are converting from time (in the DCP) to a frame number in the content. Hence we need to use the DCP's frame rate and the double/skip correction, not the source's rate. */ - VideoContent::Frame f = s * _film->dcp_video_frame_rate() / (frc.factor() * TIME_HZ); + VideoContent::Frame f = s * _film->video_frame_rate() / (frc.factor() * TIME_HZ); dynamic_pointer_cast<VideoDecoder>((*i)->decoder)->seek (f, accurate); } @@ -529,8 +529,8 @@ Player::emit_black () void Player::emit_silence (OutputAudioFrame most) { - OutputAudioFrame N = min (most, _film->dcp_audio_frame_rate() / 2); - shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->dcp_audio_channels(), N)); + OutputAudioFrame N = min (most, _film->audio_frame_rate() / 2); + shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->audio_channels(), N)); silence->make_silent (); Audio (silence, _audio_position); _audio_position += _film->audio_frames_to_time (N); diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc index e5491480f..ee55ede91 100644 --- a/src/lib/sndfile_content.cc +++ b/src/lib/sndfile_content.cc @@ -59,6 +59,14 @@ SndfileContent::summary () const } string +SndfileContent::technical_summary () const +{ + return Content::technical_summary() + " - " + + AudioContent::technical_summary () + + "sndfile"; +} + +string SndfileContent::information () const { if (_audio_frame_rate == 0) { @@ -141,7 +149,7 @@ SndfileContent::output_audio_frame_rate () const shared_ptr<const Film> film = _film.lock (); assert (film); - return film->dcp_audio_frame_rate (); + return film->audio_frame_rate (); } void diff --git a/src/lib/sndfile_content.h b/src/lib/sndfile_content.h index 3b61eee64..27e0ca21d 100644 --- a/src/lib/sndfile_content.h +++ b/src/lib/sndfile_content.h @@ -41,6 +41,7 @@ public: void examine (boost::shared_ptr<Job>); std::string summary () const; + std::string technical_summary () const; std::string information () const; void as_xml (xmlpp::Node *) const; Time length () const; diff --git a/src/lib/still_image_content.cc b/src/lib/still_image_content.cc index 3a30ccf87..804a5c0f6 100644 --- a/src/lib/still_image_content.cc +++ b/src/lib/still_image_content.cc @@ -51,6 +51,14 @@ StillImageContent::summary () const return String::compose (_("%1 [still]"), file().filename().string()); } +string +StillImageContent::technical_summary () const +{ + return Content::technical_summary() + " - " + + VideoContent::technical_summary() + " - " + + "still"; +} + bool StillImageContent::valid_file (boost::filesystem::path f) { @@ -98,7 +106,7 @@ StillImageContent::length () const shared_ptr<const Film> film = _film.lock (); assert (film); - FrameRateConversion frc (video_frame_rate(), film->dcp_video_frame_rate ()); + FrameRateConversion frc (video_frame_rate(), film->video_frame_rate ()); return video_length() * frc.factor() * TIME_HZ / video_frame_rate(); } diff --git a/src/lib/still_image_content.h b/src/lib/still_image_content.h index 02921f4e2..b81879279 100644 --- a/src/lib/still_image_content.h +++ b/src/lib/still_image_content.h @@ -39,6 +39,7 @@ public: void examine (boost::shared_ptr<Job>); std::string summary () const; + std::string technical_summary () const; void as_xml (xmlpp::Node *) const; Time length () const; diff --git a/src/lib/still_image_examiner.cc b/src/lib/still_image_examiner.cc index 71357e5ef..07848d7b9 100644 --- a/src/lib/still_image_examiner.cc +++ b/src/lib/still_image_examiner.cc @@ -58,6 +58,6 @@ StillImageExaminer::video_frame_rate () const return 24; } - return f->dcp_video_frame_rate (); + return f->video_frame_rate (); } diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 076cd6ec6..d70ece340 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -237,3 +237,9 @@ VideoContent::set_video_frame_type (VideoFrameType t) signal_changed (VideoContentProperty::VIDEO_FRAME_TYPE); } + +string +VideoContent::technical_summary () const +{ + return String::compose ("video: length %1, size %2x%3, rate %4", video_length(), video_size().width, video_size().height, video_frame_rate()); +} diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 348e2ce8b..513e1f598 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -45,6 +45,7 @@ public: VideoContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>); void as_xml (xmlpp::Node *) const; + std::string technical_summary () const; virtual std::string information () const; virtual std::string identifier () const; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 939a2906d..522ecc1c1 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -73,12 +73,12 @@ Writer::Writer (shared_ptr<const Film> f, shared_ptr<Job> j) it into the DCP later. */ - if (f->dcp_3d ()) { + if (f->three_d ()) { _picture_asset.reset ( new libdcp::StereoPictureAsset ( _film->internal_video_mxf_dir (), _film->internal_video_mxf_filename (), - _film->dcp_video_frame_rate (), + _film->video_frame_rate (), _film->container()->size (_film->full_frame ()) ) ); @@ -88,7 +88,7 @@ Writer::Writer (shared_ptr<const Film> f, shared_ptr<Job> j) new libdcp::MonoPictureAsset ( _film->internal_video_mxf_dir (), _film->internal_video_mxf_filename (), - _film->dcp_video_frame_rate (), + _film->video_frame_rate (), _film->container()->size (_film->full_frame ()) ) ); @@ -100,10 +100,10 @@ Writer::Writer (shared_ptr<const Film> f, shared_ptr<Job> j) _sound_asset.reset ( new libdcp::SoundAsset ( _film->dir (_film->dcp_name()), - _film->dcp_audio_mxf_filename (), - _film->dcp_video_frame_rate (), - _film->dcp_audio_channels (), - _film->dcp_audio_frame_rate () + _film->audio_mxf_filename (), + _film->video_frame_rate (), + _film->audio_channels (), + _film->audio_frame_rate () ) ); @@ -122,7 +122,7 @@ Writer::write (shared_ptr<const EncodedData> encoded, int frame, Eyes eyes) qi.encoded = encoded; qi.frame = frame; - if (_film->dcp_3d() && eyes == EYES_BOTH) { + if (_film->three_d() && eyes == EYES_BOTH) { /* 2D material in a 3D DCP; fake the 3D */ qi.eyes = EYES_LEFT; _queue.push_back (qi); @@ -345,7 +345,7 @@ Writer::finish () boost::filesystem::path to; to /= _film->dir (_film->dcp_name()); - to /= _film->dcp_video_mxf_filename (); + to /= _film->video_mxf_filename (); boost::system::error_code ec; boost::filesystem::create_hard_link (from, to, ec); @@ -358,7 +358,7 @@ Writer::finish () /* And update the asset */ _picture_asset->set_directory (_film->dir (_film->dcp_name ())); - _picture_asset->set_file_name (_film->dcp_video_mxf_filename ()); + _picture_asset->set_file_name (_film->video_mxf_filename ()); _sound_asset->set_duration (frames); libdcp::DCP dcp (_film->dir (_film->dcp_name())); @@ -369,7 +369,7 @@ Writer::finish () _film->dcp_name(), _film->dcp_content_type()->libdcp_kind (), frames, - _film->dcp_video_frame_rate () + _film->video_frame_rate () ) ); @@ -445,7 +445,7 @@ Writer::check_existing_picture_mxf () while (1) { - if (_film->dcp_3d ()) { + if (_film->three_d ()) { if (!check_existing_picture_mxf_frame (mxf, _first_nonexistant_frame, EYES_LEFT)) { break; } diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index b686b6154..e8b1db382 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -100,8 +100,8 @@ void AudioPanel::film_changed (Film::Property property) { switch (property) { - case Film::DCP_AUDIO_CHANNELS: - _mapping->set_channels (_editor->film()->dcp_audio_channels ()); + case Film::AUDIO_CHANNELS: + _mapping->set_channels (_editor->film()->audio_channels ()); _sizer->Layout (); break; default: diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 048791a10..4a3781ecd 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -138,26 +138,26 @@ FilmEditor::make_dcp_panel () { add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Frame Rate"), true, wxGBPosition (r, 0)); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _dcp_frame_rate = new wxChoice (_dcp_panel, wxID_ANY); - s->Add (_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL); - _best_dcp_frame_rate = new wxButton (_dcp_panel, wxID_ANY, _("Use best")); - s->Add (_best_dcp_frame_rate, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND); + _frame_rate = new wxChoice (_dcp_panel, wxID_ANY); + s->Add (_frame_rate, 1, wxALIGN_CENTER_VERTICAL); + _best_frame_rate = new wxButton (_dcp_panel, wxID_ANY, _("Use best")); + s->Add (_best_frame_rate, 1, wxALIGN_CENTER_VERTICAL | wxEXPAND); grid->Add (s, wxGBPosition (r, 1)); } ++r; add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Audio channels"), true, wxGBPosition (r, 0)); - _dcp_audio_channels = new wxSpinCtrl (_dcp_panel, wxID_ANY); - grid->Add (_dcp_audio_channels, wxGBPosition (r, 1)); + _audio_channels = new wxSpinCtrl (_dcp_panel, wxID_ANY); + grid->Add (_audio_channels, wxGBPosition (r, 1)); ++r; - _dcp_3d = new wxCheckBox (_dcp_panel, wxID_ANY, _("3D")); - grid->Add (_dcp_3d, wxGBPosition (r, 0), wxGBSpan (1, 2)); + _three_d = new wxCheckBox (_dcp_panel, wxID_ANY, _("3D")); + grid->Add (_three_d, wxGBPosition (r, 0), wxGBSpan (1, 2)); ++r; add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Resolution"), true, wxGBPosition (r, 0)); - _dcp_resolution = new wxChoice (_dcp_panel, wxID_ANY); - grid->Add (_dcp_resolution, wxGBPosition (r, 1)); + _resolution = new wxChoice (_dcp_panel, wxID_ANY); + grid->Add (_resolution, wxGBPosition (r, 1)); ++r; { @@ -192,14 +192,14 @@ FilmEditor::make_dcp_panel () list<int> const dfr = Config::instance()->allowed_dcp_frame_rates (); for (list<int>::const_iterator i = dfr.begin(); i != dfr.end(); ++i) { - _dcp_frame_rate->Append (std_to_wx (boost::lexical_cast<string> (*i))); + _frame_rate->Append (std_to_wx (boost::lexical_cast<string> (*i))); } - _dcp_audio_channels->SetRange (0, MAX_AUDIO_CHANNELS); + _audio_channels->SetRange (0, MAX_AUDIO_CHANNELS); _j2k_bandwidth->SetRange (50, 250); - _dcp_resolution->Append (_("2K")); - _dcp_resolution->Append (_("4K")); + _resolution->Append (_("2K")); + _resolution->Append (_("4K")); } void @@ -217,13 +217,13 @@ FilmEditor::connect_to_widgets () _content_timeline->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_timeline_clicked), 0, this); _scaler->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::scaler_changed), 0, this); _dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_content_type_changed), 0, this); - _dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_frame_rate_changed), 0, this); - _best_dcp_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::best_dcp_frame_rate_clicked), 0, this); - _dcp_audio_channels->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::dcp_audio_channels_changed), 0, this); + _frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::frame_rate_changed), 0, this); + _best_frame_rate->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::best_frame_rate_clicked), 0, this); + _audio_channels->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_channels_changed), 0, this); _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this); - _dcp_resolution->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::dcp_resolution_changed), 0, this); + _resolution->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::resolution_changed), 0, this); _sequence_video->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::sequence_video_changed), 0, this); - _dcp_3d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::dcp_3d_changed, this)); + _three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&FilmEditor::three_d_changed, this)); } void @@ -293,37 +293,37 @@ FilmEditor::j2k_bandwidth_changed (wxCommandEvent &) } void -FilmEditor::dcp_frame_rate_changed (wxCommandEvent &) +FilmEditor::frame_rate_changed (wxCommandEvent &) { if (!_film) { return; } - _film->set_dcp_video_frame_rate ( + _film->set_video_frame_rate ( boost::lexical_cast<int> ( - wx_to_std (_dcp_frame_rate->GetString (_dcp_frame_rate->GetSelection ())) + wx_to_std (_frame_rate->GetString (_frame_rate->GetSelection ())) ) ); } void -FilmEditor::dcp_audio_channels_changed (wxCommandEvent &) +FilmEditor::audio_channels_changed (wxCommandEvent &) { if (!_film) { return; } - _film->set_dcp_audio_channels (_dcp_audio_channels->GetValue ()); + _film->set_audio_channels (_audio_channels->GetValue ()); } void -FilmEditor::dcp_resolution_changed (wxCommandEvent &) +FilmEditor::resolution_changed (wxCommandEvent &) { if (!_film) { return; } - _film->set_resolution (_dcp_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K); + _film->set_resolution (_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K); } @@ -370,7 +370,7 @@ FilmEditor::film_changed (Film::Property p) checked_set (_scaler, Scaler::as_index (_film->scaler ())); break; case Film::RESOLUTION: - checked_set (_dcp_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1); + checked_set (_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1); setup_dcp_name (); break; case Film::J2K_BANDWIDTH: @@ -383,33 +383,33 @@ FilmEditor::film_changed (Film::Property p) case Film::DCI_METADATA: setup_dcp_name (); break; - case Film::DCP_VIDEO_FRAME_RATE: + case Film::VIDEO_FRAME_RATE: { bool done = false; - for (unsigned int i = 0; i < _dcp_frame_rate->GetCount(); ++i) { - if (wx_to_std (_dcp_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->dcp_video_frame_rate())) { - checked_set (_dcp_frame_rate, i); + for (unsigned int i = 0; i < _frame_rate->GetCount(); ++i) { + if (wx_to_std (_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->video_frame_rate())) { + checked_set (_frame_rate, i); done = true; break; } } if (!done) { - checked_set (_dcp_frame_rate, -1); + checked_set (_frame_rate, -1); } - _best_dcp_frame_rate->Enable (_film->best_dcp_video_frame_rate () != _film->dcp_video_frame_rate ()); + _best_frame_rate->Enable (_film->best_video_frame_rate () != _film->video_frame_rate ()); break; } - case Film::DCP_AUDIO_CHANNELS: - _dcp_audio_channels->SetValue (_film->dcp_audio_channels ()); + case Film::AUDIO_CHANNELS: + _audio_channels->SetValue (_film->audio_channels ()); setup_dcp_name (); break; case Film::SEQUENCE_VIDEO: checked_set (_sequence_video, _film->sequence_video ()); break; - case Film::DCP_3D: - checked_set (_dcp_3d, _film->dcp_3d ()); + case Film::THREE_D: + checked_set (_three_d, _film->three_d ()); break; } } @@ -526,10 +526,10 @@ FilmEditor::set_film (shared_ptr<Film> f) film_changed (Film::WITH_SUBTITLES); film_changed (Film::J2K_BANDWIDTH); film_changed (Film::DCI_METADATA); - film_changed (Film::DCP_VIDEO_FRAME_RATE); - film_changed (Film::DCP_AUDIO_CHANNELS); + film_changed (Film::VIDEO_FRAME_RATE); + film_changed (Film::AUDIO_CHANNELS); film_changed (Film::SEQUENCE_VIDEO); - film_changed (Film::DCP_3D); + film_changed (Film::THREE_D); if (!_film->content().empty ()) { set_selection (_film->content().front ()); @@ -550,15 +550,15 @@ FilmEditor::set_general_sensitivity (bool s) _content_remove->Enable (s); _content_timeline->Enable (s); _dcp_content_type->Enable (s); - _dcp_frame_rate->Enable (s); - _dcp_audio_channels->Enable (s); + _frame_rate->Enable (s); + _audio_channels->Enable (s); _j2k_bandwidth->Enable (s); _container->Enable (s); - _best_dcp_frame_rate->Enable (s && _film && _film->best_dcp_video_frame_rate () != _film->dcp_video_frame_rate ()); + _best_frame_rate->Enable (s && _film && _film->best_video_frame_rate () != _film->video_frame_rate ()); _sequence_video->Enable (s); - _dcp_resolution->Enable (s); + _resolution->Enable (s); _scaler->Enable (s); - _dcp_3d->Enable (s); + _three_d->Enable (s); /* Set the panels in the content notebook */ for (list<FilmEditorPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) { @@ -622,13 +622,13 @@ FilmEditor::setup_dcp_name () } void -FilmEditor::best_dcp_frame_rate_clicked (wxCommandEvent &) +FilmEditor::best_frame_rate_clicked (wxCommandEvent &) { if (!_film) { return; } - _film->set_dcp_video_frame_rate (_film->best_dcp_video_frame_rate ()); + _film->set_video_frame_rate (_film->best_video_frame_rate ()); } void @@ -836,11 +836,11 @@ FilmEditor::content_right_click (wxListEvent& ev) } void -FilmEditor::dcp_3d_changed () +FilmEditor::three_d_changed () { if (!_film) { return; } - _film->set_dcp_3d (_dcp_3d->GetValue ()); + _film->set_three_d (_three_d->GetValue ()); } diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 9a9ba2906..49b091468 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -82,14 +82,14 @@ private: void dcp_content_type_changed (wxCommandEvent &); void scaler_changed (wxCommandEvent &); void j2k_bandwidth_changed (wxCommandEvent &); - void dcp_frame_rate_changed (wxCommandEvent &); - void best_dcp_frame_rate_clicked (wxCommandEvent &); + void frame_rate_changed (wxCommandEvent &); + void best_frame_rate_clicked (wxCommandEvent &); void content_timeline_clicked (wxCommandEvent &); - void dcp_audio_channels_changed (wxCommandEvent &); - void dcp_resolution_changed (wxCommandEvent &); + void audio_channels_changed (wxCommandEvent &); + void resolution_changed (wxCommandEvent &); void sequence_video_changed (wxCommandEvent &); void content_right_click (wxListEvent &); - void dcp_3d_changed (); + void three_d_changed (); /* Handle changes to the model */ void film_changed (Film::Property); @@ -133,11 +133,11 @@ private: wxChoice* _scaler; wxSpinCtrl* _j2k_bandwidth; wxChoice* _dcp_content_type; - wxChoice* _dcp_frame_rate; - wxSpinCtrl* _dcp_audio_channels; - wxButton* _best_dcp_frame_rate; - wxCheckBox* _dcp_3d; - wxChoice* _dcp_resolution; + wxChoice* _frame_rate; + wxSpinCtrl* _audio_channels; + wxButton* _best_frame_rate; + wxCheckBox* _three_d; + wxChoice* _resolution; ContentMenu _menu; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index b9d554c68..88b293397 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -268,12 +268,12 @@ FilmViewer::play_clicked (wxCommandEvent &) void FilmViewer::check_play_state () { - if (!_film || _film->dcp_video_frame_rate() == 0) { + if (!_film || _film->video_frame_rate() == 0) { return; } if (_play_button->GetValue()) { - _timer.Start (1000 / _film->dcp_video_frame_rate()); + _timer.Start (1000 / _film->video_frame_rate()); } else { _timer.Stop (); } @@ -307,7 +307,7 @@ FilmViewer::set_position_text (Time t) return; } - double const fps = _film->dcp_video_frame_rate (); + double const fps = _film->video_frame_rate (); /* Count frame number from 1 ... not sure if this is the best idea */ _frame_number->SetLabel (wxString::Format (wxT("%d"), int (rint (t * fps / TIME_HZ)) + 1)); diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index da62aabdf..ee62797e3 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -49,13 +49,13 @@ TimingPanel::film_content_changed (shared_ptr<Content> content, int property) { if (property == ContentProperty::START) { if (content) { - _start->set (content->start (), _editor->film()->dcp_video_frame_rate ()); + _start->set (content->start (), _editor->film()->video_frame_rate ()); } else { _start->set (0, 24); } } else if (property == ContentProperty::LENGTH) { if (content) { - _length->set (content->length (), _editor->film()->dcp_video_frame_rate ()); + _length->set (content->length (), _editor->film()->video_frame_rate ()); } else { _length->set (0, 24); } @@ -70,7 +70,7 @@ TimingPanel::start_changed () return; } - c->set_start (_start->get (_editor->film()->dcp_video_frame_rate ())); + c->set_start (_start->get (_editor->film()->video_frame_rate ())); } void @@ -83,6 +83,6 @@ TimingPanel::length_changed () shared_ptr<StillImageContent> ic = dynamic_pointer_cast<StillImageContent> (c); if (ic) { - ic->set_video_length (_length->get (_editor->film()->dcp_video_frame_rate()) * ic->video_frame_rate() / TIME_HZ); + ic->set_video_length (_length->get (_editor->film()->video_frame_rate()) * ic->video_frame_rate() / TIME_HZ); } } |
