Mostly-merge master.
authorCarl Hetherington <cth@carlh.net>
Fri, 21 Mar 2014 12:36:17 +0000 (12:36 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 21 Mar 2014 12:36:17 +0000 (12:36 +0000)
21 files changed:
ChangeLog
cscript
debian/changelog
platform/osx/make_dmg.sh
platform/windows/wscript
src/lib/ffmpeg.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_decoder.h
src/lib/image.cc
src/lib/image_content.cc
src/lib/scaler.h
src/lib/types.h
src/lib/util.cc
src/lib/video_content.cc
src/lib/video_content.h
src/lib/video_decoder.cc
src/wx/about_dialog.cc
src/wx/timecode.cc
src/wx/timing_panel.cc
src/wx/video_panel.cc
test/play_test.cc

index 2edfe0e121e482b7af60bd004a583fe869787501..065a10ae324ca38809de65a83408ab822f3367df 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
 
        * Add subtitle view.
 
+2014-03-18  Carl Hetherington  <cth@carlh.net>
+
+       * Version 1.66.3 released.
+
+2014-03-18  Carl Hetherington  <cth@carlh.net>
+
+       * Fix bad rounding of timecodes.
+
+       * Tentative support for 3D from alternate frames of the source.
+
 2014-03-17  Carl Hetherington  <cth@carlh.net>
 
        * Improve behaviour of the position slider at the end of films.
diff --git a/cscript b/cscript
index b8b0580063ee0490652cd2c8e0b0132360bcf349..c07c430310a41ad3f430e1bc60ba8d0123fefe50 100644 (file)
--- a/cscript
+++ b/cscript
@@ -129,7 +129,7 @@ def make_control(debian_version, bits, filename, debug):
         print >>f,''
 
 def dependencies(target):
-    return (('ffmpeg-cdist', '08827fa4e1d483511e6135c424d2ca9c56a9ed50'),
+    return (('ffmpeg-cdist', 'a0db025'),
             ('libdcp', '1.0'))
 
 def build(target, options):
index c7b6fbebc0b949a10dab1dc1f2ccf1ba0da77577..48e48f1d72bd75bad22aa6beb590a4c868489f06 100644 (file)
@@ -1,4 +1,4 @@
-dcpomatic (1.66.2-1) UNRELEASED; urgency=low
+dcpomatic (1.66.3-1) UNRELEASED; urgency=low
 
   * New upstream release.
   * New upstream release.
@@ -106,8 +106,9 @@ dcpomatic (1.66.2-1) UNRELEASED; urgency=low
   * New upstream release.
   * New upstream release.
   * New upstream release.
+  * New upstream release.
 
- -- Carl Hetherington <carl@d1stkfactory>  Mon, 17 Mar 2014 09:20:12 +0000
+ -- Carl Hetherington <carl@d1stkfactory>  Tue, 18 Mar 2014 16:20:29 +0000
 
 dcpomatic (0.87-1) UNRELEASED; urgency=low
 
index cabc47741e3fcde6572cc89c7b03238e7eff15f5..bf7512b9317b77f27bf472b0a1841b020289db04 100644 (file)
@@ -55,7 +55,6 @@ universal_copy $ROOT lib/libavfilter*.dylib $WORK/$libs
 universal_copy $ROOT lib/libavutil*.dylib $WORK/$libs
 universal_copy $ROOT lib/libavcodec*.dylib $WORK/$libs
 universal_copy $ROOT lib/libswscale*.dylib $WORK/$libs
-universal_copy $ROOT lib/libpostproc*.dylib $WORK/$libs
 universal_copy $ROOT lib/libswresample*.dylib $WORK/$libs
 universal_copy $ROOT bin/ffprobe $WORK/$macos
 universal_copy $ENV lib/libboost_system.dylib $WORK/$libs
@@ -103,6 +102,11 @@ done
 
 cp build/platform/osx/Info.plist $WORK/$approot
 cp icons/dcpomatic.icns $WORK/$resources/DCP-o-matic.icns
+cp icons/colour_conversions.png $WORK/$resources
+cp icons/defaults.png $WORK/$resources
+cp icons/kdm_email.png $WORK/$resources
+cp icons/servers.png $WORK/$resources
+cp icons/tms.png $WORK/$resources
 
 # i18n: .mo files
 for lang in de_DE es_ES fr_FR it_IT sv_SE; do
index 2c16858c29849be1bd92ee9629dc58287fb4f61c..7efa7d0caf012bdefa5403918d15c56421eea78d 100644 (file)
@@ -112,7 +112,6 @@ File "%cdist_deps%/bin/avutil-52.dll"
 File "%cdist_deps%/bin/avdevice-55.dll"
 File "%cdist_deps%/bin/dcp.dll"
 File "%cdist_deps%/bin/libopenjpeg-1.dll"
-File "%cdist_deps%/bin/postproc-52.dll"
 File "%cdist_deps%/bin/swresample-0.dll"
 File "%cdist_deps%/bin/swscale-2.dll"
 File "%cdist_deps%/bin/cxml.dll"
index 5fc33348923c85d584af16fb980c6f5f50ad2dd1..a98aa98289e6839dedf04ccc557c33b68d1e9c71 100644 (file)
@@ -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"
index 90c00283d940fc79c43f1e0cc3131ae92507e01b..86ce7503c9483c192e78c1655c99391f0ba68d36 100644 (file)
@@ -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
index fbf802bb01004cf9c7d3f27f12e65a0f962af888..15fe5d9a48966cbb42d6ec66e9a676f46646757a 100644 (file)
@@ -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"
index c3b1ca77afded0cc70270fb097d40a6b989a2bfa..926aefd3662659583f0116abcd76abb9e16439c1 100644 (file)
@@ -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"
index 6a37f30676472c51ec24866179ce5209cc5c2ec8..d7b37a8353fa5f04b63c58006a2a6c8eade95a1f 100644 (file)
@@ -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
index 6a039edd8d037878503ea79fdf971c5e2d1eb782..14077ff1dc803349c75b4faf3452f411531e007b 100644 (file)
@@ -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;
        }
index dafea92f83948faba000c4391be42b169aaecf7a..4e1f59ca87fb122baea9acad6c63b71f5e83061d 100644 (file)
@@ -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
index 15109eee05c442f0dab35982703e20e788148f79..5b3bd76ba0292607bcbdd8b10024a05e0d4b4718 100644 (file)
@@ -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_(", ")
index b6a2d031857ad2e9f644ebfa06b5479dcc743989..5864342a265c0fc873c302490acb3191f8f251bd 100644 (file)
@@ -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);
index d2b19480f056f1895ab722d1ee50a96ee1989d37..eeb49cfa543a3ed4a746ae7c01093d7e65eb6f79 100644 (file)
@@ -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;
index 15f91b8923b99ea0a8eff66f3bfc69eb005b4158..144a494dcd48fc5a6cd9916d4d9a7d40c90fd2e5 100644 (file)
@@ -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;
index 01332dfcc131d6b4834ba09ed65ea919d00f6b0a..812772f10f46dfbd1ab6e511c8824f9c4008eeb5 100644 (file)
@@ -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"));
index 0453272547a65a800eef18b2bc61db41ee1b6654..634a15625c7d1b7ed79f52255f33758f15b4a721 100644 (file)
@@ -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
index b8b923a6b941752c80962fc6088430d4b715a12f..3fcb9b1753eeecc41d808ef2d27f7777196d1bbe 100644 (file)
@@ -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 ());
index 533545f64406932be8cc00737646f1d8f9c7d2cf..fad824727074574ad0ef9f71f23c94f6237de415 100644 (file)
@@ -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));
index 690b042d8c32722f78e1c75e5c800e22cc685251..ed3e497ed6e3c4fc6248537ad1e98f7d22ce1241 100644 (file)
@@ -89,13 +89,13 @@ BOOST_AUTO_TEST_CASE (play_test)
        film->examine_and_add_content (A);
        wait_for_jobs ();
 
-       BOOST_CHECK_EQUAL (A->video_length().frames (24), 16);
+       BOOST_CHECK_EQUAL (A->video_length_after_3d_combine().frames (24), 16);
 
        shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/red_30.mp4"));
        film->examine_and_add_content (B);
        wait_for_jobs ();
 
-       BOOST_CHECK_EQUAL (B->video_length().frames (30), 16);
+       BOOST_CHECK_EQUAL (B->video_length_after_3d_combine().frames (30), 16);
        
        /* Film should have been set to 25fps */
        BOOST_CHECK_EQUAL (film->video_frame_rate(), 25);