diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-21 12:36:17 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-21 12:36:17 +0000 |
| commit | e6f28e7cda23c1ba3c49cc1bf2dc1491c2f87160 (patch) | |
| tree | ab7de2b131c3543d170b167c8b93ea2113ac112e /src | |
| parent | 76f601f5edbdfceec91ff6f6ce4b310e0d3a6ce9 (diff) | |
| parent | 4ec7a8070dfcda1fa327df6378eaab754f119f1b (diff) | |
Mostly-merge master.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/ffmpeg.cc | 1 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 14 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.h | 1 | ||||
| -rw-r--r-- | src/lib/image.cc | 1 | ||||
| -rw-r--r-- | src/lib/image_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/scaler.h | 2 | ||||
| -rw-r--r-- | src/lib/types.h | 3 | ||||
| -rw-r--r-- | src/lib/util.cc | 2 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 3 | ||||
| -rw-r--r-- | src/lib/video_content.h | 9 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 3 | ||||
| -rw-r--r-- | src/wx/about_dialog.cc | 2 | ||||
| -rw-r--r-- | src/wx/timecode.cc | 20 | ||||
| -rw-r--r-- | src/wx/timing_panel.cc | 6 | ||||
| -rw-r--r-- | src/wx/video_panel.cc | 1 |
15 files changed, 43 insertions, 27 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 5fc333489..a98aa9828 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -21,7 +21,6 @@ extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h> -#include <libpostproc/postprocess.h> } #include "ffmpeg.h" #include "ffmpeg_content.h" diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 90c00283d..86ce7503c 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -237,7 +237,7 @@ FFmpegContent::information () const stringstream s; - s << String::compose (_("%1 frames; %2 frames per second"), video_length().frames (video_frame_rate()), video_frame_rate()) << "\n"; + s << String::compose (_("%1 frames; %2 frames per second"), video_length_after_3d_combine().frames (video_frame_rate()), video_frame_rate()) << "\n"; s << VideoContent::information (); return s.str (); @@ -268,14 +268,12 @@ FFmpegContent::set_audio_stream (shared_ptr<FFmpegAudioStream> s) ContentTime FFmpegContent::audio_length () const { - { - boost::mutex::scoped_lock lm (_mutex); - if (!_audio_stream) { - return ContentTime (); - } + boost::mutex::scoped_lock lm (_mutex); + if (!_audio_stream) { + return ContentTime (); } - return video_length(); + return video_length (); } int @@ -422,7 +420,7 @@ FFmpegContent::full_length () const { shared_ptr<const Film> film = _film.lock (); assert (film); - return DCPTime (video_length(), FrameRateChange (video_frame_rate (), film->video_frame_rate ())); + return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate (), film->video_frame_rate ())); } AudioMapping diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index fbf802bb0..15fe5d9a4 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -29,7 +29,6 @@ #include <boost/thread/mutex.hpp> extern "C" { #include <libavcodec/avcodec.h> -#include <libpostproc/postprocess.h> } #include "util.h" #include "decoder.h" diff --git a/src/lib/image.cc b/src/lib/image.cc index c3b1ca77a..926aefd36 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -26,7 +26,6 @@ extern "C" { #include <libswscale/swscale.h> #include <libavutil/pixfmt.h> #include <libavutil/pixdesc.h> -#include <libpostproc/postprocess.h> } #include "image.h" #include "exceptions.h" diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 6a37f3067..d7b37a835 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -125,7 +125,7 @@ ImageContent::full_length () const { shared_ptr<const Film> film = _film.lock (); assert (film); - return DCPTime (video_length(), FrameRateChange (video_frame_rate(), film->video_frame_rate())); + return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate(), film->video_frame_rate())); } string diff --git a/src/lib/scaler.h b/src/lib/scaler.h index 6a039edd8..14077ff1d 100644 --- a/src/lib/scaler.h +++ b/src/lib/scaler.h @@ -36,7 +36,7 @@ class Scaler : public boost::noncopyable public: Scaler (int f, std::string i, std::string n); - /** @return id used for calls to FFmpeg's pp_postprocess */ + /** @return id used for calls to FFmpeg's sws_getContext */ int ffmpeg_id () const { return _ffmpeg_id; } diff --git a/src/lib/types.h b/src/lib/types.h index dafea92f8..4e1f59ca8 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -64,7 +64,8 @@ enum VideoFrameType { VIDEO_FRAME_TYPE_2D, VIDEO_FRAME_TYPE_3D_LEFT_RIGHT, - VIDEO_FRAME_TYPE_3D_TOP_BOTTOM + VIDEO_FRAME_TYPE_3D_TOP_BOTTOM, + VIDEO_FRAME_TYPE_3D_ALTERNATE }; enum Eyes diff --git a/src/lib/util.cc b/src/lib/util.cc index 15109eee0..5b3bd76ba 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -58,7 +58,6 @@ extern "C" { #include <libavformat/avformat.h> #include <libswscale/swscale.h> #include <libavfilter/avfiltergraph.h> -#include <libpostproc/postprocess.h> #include <libavutil/pixfmt.h> } #include "util.h" @@ -249,7 +248,6 @@ dependency_version_summary () << N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ") << N_("libavformat ") << ffmpeg_version_to_string (avformat_version()) << N_(", ") << N_("libavutil ") << ffmpeg_version_to_string (avutil_version()) << N_(", ") - << N_("libpostproc ") << ffmpeg_version_to_string (postproc_version()) << N_(", ") << N_("libswscale ") << ffmpeg_version_to_string (swscale_version()) << N_(", ") << MagickVersion << N_(", ") << N_("libssh ") << ssh_version (0) << N_(", ") diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index b6a2d0318..5864342a2 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -319,7 +319,7 @@ VideoContent::technical_summary () const { return String::compose ( "video: length %1, size %2x%3, rate %4", - video_length().seconds(), + video_length_after_3d_combine().seconds(), video_size().width, video_size().height, video_frame_rate() @@ -332,6 +332,7 @@ VideoContent::video_size_after_3d_split () const dcp::Size const s = video_size (); switch (video_frame_type ()) { case VIDEO_FRAME_TYPE_2D: + case VIDEO_FRAME_TYPE_3D_ALTERNATE: return s; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: return dcp::Size (s.width / 2, s.height); diff --git a/src/lib/video_content.h b/src/lib/video_content.h index d2b19480f..eeb49cfa5 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -96,6 +96,15 @@ public: return _video_length; } + ContentTime video_length_after_3d_combine () const { + boost::mutex::scoped_lock lm (_mutex); + if (_video_frame_type == VIDEO_FRAME_TYPE_3D_ALTERNATE) { + return ContentTime (_video_length.get() / 2); + } + + return _video_length; + } + dcp::Size video_size () const { boost::mutex::scoped_lock lm (_mutex); return _video_size; diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 15f91b892..144a494dc 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -40,6 +40,9 @@ VideoDecoder::video (shared_ptr<const Image> image, bool same, ContentTime time) case VIDEO_FRAME_TYPE_2D: _pending.push_back (shared_ptr<DecodedVideo> (new DecodedVideo (time, image, EYES_BOTH, same))); break; + case VIDEO_FRAME_TYPE_3D_ALTERNATE: + Video (image, (frame % 2) ? EYES_RIGHT : EYES_LEFT, same); + break; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: { int const half = image->size().width / 2; diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index 01332dfcc..812772f10 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -115,7 +115,7 @@ AboutDialog::AboutDialog (wxWindow* parent) supported_by.Add (wxT ("Adam Colt")); supported_by.Add (wxT ("Andres Fink")); supported_by.Add (wxT ("Evan Freeze")); - supported_by.Add (wxT ("Rodolfo Giuliano")); + supported_by.Add (wxT ("Silvio Giuliano")); supported_by.Add (wxT ("Flor Guillaume")); supported_by.Add (wxT ("Jonathan Jensen")); supported_by.Add (wxT ("Adam Klotblixt")); diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index 045327254..634a15625 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -85,20 +85,24 @@ Timecode::Timecode (wxWindow* parent) void Timecode::set (DCPTime t, int fps) { - int const h = t.seconds() / 3600; - t -= DCPTime::from_seconds (h * 3600); - int const m = t.seconds() / 60; - t -= DCPTime::from_seconds (m * 60); - int const s = t.seconds(); - t -= DCPTime::from_seconds (s); - int const f = rint (t.seconds() * fps); + /* Do this calculation with frames so that we can round + to a frame boundary at the start rather than the end. + */ + int64_t f = rint (t.seconds() * fps); + + int const h = f / (3600 * fps); + f -= h * 3600 * fps; + int const m = f / (60 * fps); + f -= m * 60 * fps; + int const s = f / fps; + f -= s * fps; checked_set (_hours, lexical_cast<string> (h)); checked_set (_minutes, lexical_cast<string> (m)); checked_set (_seconds, lexical_cast<string> (s)); checked_set (_frames, lexical_cast<string> (f)); - _fixed->SetLabel (wxString::Format ("%02d:%02d:%02d.%02d", h, m, s, f)); + _fixed->SetLabel (wxString::Format ("%02d:%02d:%02d.%02ld", h, m, s, f)); } DCPTime diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index b8b923a6b..3fcb9b175 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -87,7 +87,11 @@ TimingPanel::film_content_changed (int property) } else { _position->set (DCPTime () , 24); } - } else if (property == ContentProperty::LENGTH || property == VideoContentProperty::VIDEO_FRAME_RATE) { + } else if ( + property == ContentProperty::LENGTH || + property == VideoContentProperty::VIDEO_FRAME_RATE || + property == VideoContentProperty::VIDEO_FRAME_TYPE + ) { if (content) { _full_length->set (content->full_length (), _editor->film()->video_frame_rate ()); _play_length->set (content->length_after_trim (), _editor->film()->video_frame_rate ()); diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 533545f64..fad824727 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -196,6 +196,7 @@ VideoPanel::VideoPanel (FilmEditor* e) _frame_type->wrapped()->Append (_("2D")); _frame_type->wrapped()->Append (_("3D left/right")); _frame_type->wrapped()->Append (_("3D top/bottom")); + _frame_type->wrapped()->Append (_("3D alternate")); _filters_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_filters_clicked, this)); _colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this)); |
