Merge master branch.
authorCarl Hetherington <cth@carlh.net>
Wed, 23 Jan 2013 20:15:13 +0000 (20:15 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 23 Jan 2013 20:15:13 +0000 (20:15 +0000)
20 files changed:
ChangeLog
src/lib/dcp_video_frame.h
src/lib/ffmpeg_decoder.cc
src/lib/film.cc
src/lib/film.h
src/lib/filter_graph.cc
src/lib/format.cc
src/lib/format.h
src/lib/image.cc
src/lib/imagemagick_decoder.cc
src/lib/make_dcp_job.cc [new file with mode: 0644]
src/lib/make_dcp_job.h [new file with mode: 0644]
src/lib/server.cc
src/lib/subtitle.cc
src/lib/util.cc
src/wx/film_editor.cc
src/wx/film_editor.h
src/wx/film_viewer.cc
src/wx/film_viewer.h
wscript

index c82fe2ec791eff1125291a4f40d510466318e229..36bda83b42a7474b84b6f101ea1483b81939290a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-23  Carl Hetherington  <cth@carlh.net>
+
+       * Remove multi-reel support (for now); needs more thinking about
+       and testing.
+
 2013-01-12  Carl Hetherington  <cth@carlh.net>
 
        * Version 0.71beta2 released.
index 1d434505abef04a1c7efee3d8e946ca2d07b7a26..e988b663a80493158b552a959d8b8ec09010fea3 100644 (file)
@@ -39,8 +39,7 @@ class Subtitle;
 class EncodedData
 {
 public:
-       /** @param s Size of data, in bytes.
-        */
+       /** @param s Size of data, in bytes */
        EncodedData (int s);
 
        EncodedData (std::string f);
index e7dfc206be2dfe6c105e374e65472f293cb38a5e..81f40564460a035856332ae46f25cacf14d1a9dd 100644 (file)
@@ -469,10 +469,10 @@ FFmpegDecoder::audio_sample_format () const
        return _audio_codec_context->sample_fmt;
 }
 
-Size
+libdcp::Size
 FFmpegDecoder::native_size () const
 {
-       return Size (_video_codec_context->width, _video_codec_context->height);
+       return libdcp::Size (_video_codec_context->width, _video_codec_context->height);
 }
 
 PixelFormat
@@ -559,12 +559,12 @@ FFmpegDecoder::filter_and_emit_video (AVFrame* frame)
        shared_ptr<FilterGraph> graph;
 
        list<shared_ptr<FilterGraph> >::iterator i = _filter_graphs.begin();
-       while (i != _filter_graphs.end() && !(*i)->can_process (Size (frame->width, frame->height), (AVPixelFormat) frame->format)) {
+       while (i != _filter_graphs.end() && !(*i)->can_process (libdcp::Size (frame->width, frame->height), (AVPixelFormat) frame->format)) {
                ++i;
        }
 
        if (i == _filter_graphs.end ()) {
-               graph.reset (new FilterGraph (_film, this, Size (frame->width, frame->height), (AVPixelFormat) frame->format));
+               graph.reset (new FilterGraph (_film, this, libdcp::Size (frame->width, frame->height), (AVPixelFormat) frame->format));
                _filter_graphs.push_back (graph);
                _film->log()->log (String::compose ("New graph for %1x%2, pixel format %3", frame->width, frame->height, frame->format));
        } else {
index c91a8047133dc0e14a1ff0cc47f0a946ada72e9e..ae9edbfdb0a93a954a6e7c13bc967738598430e4 100644 (file)
@@ -157,7 +157,6 @@ Film::Film (Film const & o)
        , _scaler            (o._scaler)
        , _trim_start        (o._trim_start)
        , _trim_end          (o._trim_end)
-       , _reel_size         (o._reel_size)
        , _dcp_ab            (o._dcp_ab)
        , _content_audio_stream (o._content_audio_stream)
        , _external_audio    (o._external_audio)
@@ -390,9 +389,6 @@ Film::write_metadata () const
        f << "scaler " << _scaler->id () << "\n";
        f << "trim_start " << _trim_start << "\n";
        f << "trim_end " << _trim_end << "\n";
-       if (_reel_size) {
-               f << "reel_size " << _reel_size.get() << "\n";
-       }
        f << "dcp_ab " << (_dcp_ab ? "1" : "0") << "\n";
        if (_content_audio_stream) {
                f << "selected_content_audio_stream " << _content_audio_stream->to_string() << "\n";
@@ -508,8 +504,6 @@ Film::read_metadata ()
                        _trim_start = atoi (v.c_str ());
                } else if ( ((!version || version < 2) && k == "trim_end") || k == "trim_end") {
                        _trim_end = atoi (v.c_str ());
-               } else if (k == "reel_size") {
-                       _reel_size = boost::lexical_cast<uint64_t> (v);
                } else if (k == "dcp_ab") {
                        _dcp_ab = (v == "1");
                } else if (k == "selected_content_audio_stream" || (!version && k == "selected_audio_stream")) {
@@ -610,8 +604,8 @@ Film::read_metadata ()
        _dirty = false;
 }
 
-Size
-Film::cropped_size (Size s) const
+libdcp::Size
+Film::cropped_size (libdcp::Size s) const
 {
        boost::mutex::scoped_lock lm (_state_mutex);
        s.width -= _crop.left + _crop.right;
@@ -1070,26 +1064,6 @@ Film::set_trim_end (int t)
        signal_changed (TRIM_END);
 }
 
-void
-Film::set_reel_size (uint64_t s)
-{
-       {
-               boost::mutex::scoped_lock lm (_state_mutex);
-               _reel_size = s;
-       }
-       signal_changed (REEL_SIZE);
-}
-
-void
-Film::unset_reel_size ()
-{
-       {
-               boost::mutex::scoped_lock lm (_state_mutex);
-               _reel_size = boost::optional<uint64_t> ();
-       }
-       signal_changed (REEL_SIZE);
-}
-
 void
 Film::set_dcp_ab (bool a)
 {
@@ -1298,7 +1272,7 @@ Film::set_package_type (string p)
 }
 
 void
-Film::set_size (Size s)
+Film::set_size (libdcp::Size s)
 {
        {
                boost::mutex::scoped_lock lm (_state_mutex);
index e10abfa4bbed2127e14627a4282786b1c9e3dc3f..60646b0c8d78adc52f6fa8da0740d704926ac1c9 100644 (file)
@@ -123,7 +123,6 @@ public:
                SCALER,
                TRIM_START,
                TRIM_END,
-               REEL_SIZE,
                DCP_AB,
                CONTENT_AUDIO_STREAM,
                EXTERNAL_AUDIO,
@@ -209,11 +208,6 @@ public:
                return _trim_end;
        }
 
-       boost::optional<uint64_t> reel_size () const {
-               boost::mutex::scoped_lock lm (_state_mutex);
-               return _reel_size;
-       }
-       
        bool dcp_ab () const {
                boost::mutex::scoped_lock lm (_state_mutex);
                return _dcp_ab;
@@ -371,8 +365,6 @@ public:
        void set_scaler (Scaler const *);
        void set_trim_start (int);
        void set_trim_end (int);
-       void set_reel_size (uint64_t);
-       void unset_reel_size ();
        void set_dcp_ab (bool);
        void set_content_audio_stream (boost::shared_ptr<AudioStream>);
        void set_external_audio (std::vector<std::string>);
@@ -456,8 +448,6 @@ private:
        int _trim_start;
        /** Frames to trim off the end of the DCP */
        int _trim_end;
-       /** Approximate target reel size in bytes; if not set, use a single reel */
-       boost::optional<uint64_t> _reel_size;
        /** 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.
index 86864a762295c93c4d22085570d45feb5b7f6640..3a13d93d069c5f7b0bd84545e4a560089056092f 100644 (file)
@@ -55,7 +55,7 @@ using libdcp::Size;
  *  @param s Size of the images to process.
  *  @param p Pixel format of the images to process.
  */
-FilterGraph::FilterGraph (shared_ptr<Film> film, FFmpegDecoder* decoder, Size s, AVPixelFormat p)
+FilterGraph::FilterGraph (shared_ptr<Film> film, FFmpegDecoder* decoder, libdcp::Size s, AVPixelFormat p)
        : _buffer_src_context (0)
        , _buffer_sink_context (0)
        , _size (s)
@@ -206,7 +206,7 @@ FilterGraph::process (AVFrame const * frame)
  *  @return true if this chain can process images with `s' and `p', otherwise false.
  */
 bool
-FilterGraph::can_process (Size s, AVPixelFormat p) const
+FilterGraph::can_process (libdcp::Size s, AVPixelFormat p) const
 {
        return (_size == s && _pixel_format == p);
 }
index a80fab6193d0998fa320f8b745de70631a00105e..4583dd0e58602840c95cb5b1724c5ab557a3fb6a 100644 (file)
@@ -68,19 +68,19 @@ Format::as_metadata () const
 void
 Format::setup_formats ()
 {
-       _formats.push_back (new FixedFormat (119, Size (1285, 1080), "119", "1.19", "F"));
-       _formats.push_back (new FixedFormat (133, Size (1436, 1080), "133", "1.33", "F"));
-       _formats.push_back (new FixedFormat (138, Size (1485, 1080), "138", "1.375", "F"));
-       _formats.push_back (new FixedFormat (133, Size (1998, 1080), "133-in-flat", "4:3 within Flat", "F"));
-       _formats.push_back (new FixedFormat (137, Size (1480, 1080), "137", "Academy", "F"));
-       _formats.push_back (new FixedFormat (166, Size (1793, 1080), "166", "1.66", "F"));
-       _formats.push_back (new FixedFormat (166, Size (1998, 1080), "166-in-flat", "1.66 within Flat", "F"));
-       _formats.push_back (new FixedFormat (178, Size (1998, 1080), "178-in-flat", "16:9 within Flat", "F"));
-       _formats.push_back (new FixedFormat (178, Size (1920, 1080), "178", "16:9", "F"));
-       _formats.push_back (new FixedFormat (185, Size (1998, 1080), "185", "Flat", "F"));
-       _formats.push_back (new FixedFormat (239, Size (2048, 858), "239", "Scope", "S"));
-       _formats.push_back (new VariableFormat (Size (1998, 1080), "var-185", "Flat", "F"));
-       _formats.push_back (new VariableFormat (Size (2048, 858), "var-239", "Scope", "S"));
+       _formats.push_back (new FixedFormat (119, libdcp::Size (1285, 1080), "119", "1.19", "F"));
+       _formats.push_back (new FixedFormat (133, libdcp::Size (1436, 1080), "133", "1.33", "F"));
+       _formats.push_back (new FixedFormat (138, libdcp::Size (1485, 1080), "138", "1.375", "F"));
+       _formats.push_back (new FixedFormat (133, libdcp::Size (1998, 1080), "133-in-flat", "4:3 within Flat", "F"));
+       _formats.push_back (new FixedFormat (137, libdcp::Size (1480, 1080), "137", "Academy", "F"));
+       _formats.push_back (new FixedFormat (166, libdcp::Size (1793, 1080), "166", "1.66", "F"));
+       _formats.push_back (new FixedFormat (166, libdcp::Size (1998, 1080), "166-in-flat", "1.66 within Flat", "F"));
+       _formats.push_back (new FixedFormat (178, libdcp::Size (1998, 1080), "178-in-flat", "16:9 within Flat", "F"));
+       _formats.push_back (new FixedFormat (178, libdcp::Size (1920, 1080), "178", "16:9", "F"));
+       _formats.push_back (new FixedFormat (185, libdcp::Size (1998, 1080), "185", "Flat", "F"));
+       _formats.push_back (new FixedFormat (239, libdcp::Size (2048, 858), "239", "Scope", "S"));
+       _formats.push_back (new VariableFormat (libdcp::Size (1998, 1080), "var-185", "Flat", "F"));
+       _formats.push_back (new VariableFormat (libdcp::Size (2048, 858), "var-239", "Scope", "S"));
 }
 
 /** @param n Nickname.
@@ -141,7 +141,7 @@ Format::all ()
  *  @param id ID (e.g. 185)
  *  @param n Nick name (e.g. Flat)
  */
-FixedFormat::FixedFormat (int r, Size dcp, string id, string n, string d)
+FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d)
        : Format (dcp, id, n, d)
        , _ratio (r)
 {
@@ -161,7 +161,7 @@ Format::dcp_padding (shared_ptr<const Film> f) const
        return p;
 }
 
-VariableFormat::VariableFormat (Size dcp, string id, string n, string d)
+VariableFormat::VariableFormat (libdcp::Size dcp, string id, string n, string d)
        : Format (dcp, id, n, d)
 {
 
index 48a000480fcbacec36189b062431780817f6c419..b4c691e56fea19e45b023782d4b255feb77b53dd 100644 (file)
@@ -81,7 +81,7 @@ public:
        static void setup_formats ();
 
 protected:     
-       /** Size in pixels of the images that we should
+       /** libdcp::Size in pixels of the images that we should
         *  put in a DCP for this ratio.  This size will not correspond
         *  to the ratio when we are doing things like 16:9 in a Flat frame.
         */
index 0a51add002cf7787c919a9c29a03e36237a72200..9223fdc5d0019cdfecbe2a2e20930c8546a7c426 100644 (file)
@@ -96,7 +96,7 @@ Image::components () const
 }
 
 shared_ptr<Image>
-Image::scale (Size out_size, Scaler const * scaler, bool result_aligned) const
+Image::scale (libdcp::Size out_size, Scaler const * scaler, bool result_aligned) const
 {
        assert (scaler);
        /* Empirical testing suggests that sws_scale() will crash if
@@ -129,7 +129,7 @@ Image::scale (Size out_size, Scaler const * scaler, bool result_aligned) const
  *  @param scaler Scaler to use.
  */
 shared_ptr<Image>
-Image::scale_and_convert_to_rgb (Size out_size, int padding, Scaler const * scaler, bool result_aligned) const
+Image::scale_and_convert_to_rgb (libdcp::Size out_size, int padding, Scaler const * scaler, bool result_aligned) const
 {
        assert (scaler);
        /* Empirical testing suggests that sws_scale() will crash if
@@ -137,7 +137,7 @@ Image::scale_and_convert_to_rgb (Size out_size, int padding, Scaler const * scal
        */
        assert (aligned ());
 
-       Size content_size = out_size;
+       libdcp::Size content_size = out_size;
        content_size.width -= (padding * 2);
 
        shared_ptr<Image> rgb (new SimpleImage (PIX_FMT_RGB24, content_size, result_aligned));
@@ -224,7 +224,7 @@ Image::post_process (string pp, bool aligned) const
 shared_ptr<Image>
 Image::crop (Crop crop, bool aligned) const
 {
-       Size cropped_size = size ();
+       libdcp::Size cropped_size = size ();
        cropped_size.width -= crop.left + crop.right;
        cropped_size.height -= crop.top + crop.bottom;
 
@@ -389,7 +389,7 @@ Image::bytes_per_pixel (int c) const
  *  @param p Pixel format.
  *  @param s Size in pixels.
  */
-SimpleImage::SimpleImage (AVPixelFormat p, Size s, bool aligned)
+SimpleImage::SimpleImage (AVPixelFormat p, libdcp::Size s, bool aligned)
        : Image (p)
        , _size (s)
        , _aligned (aligned)
@@ -487,7 +487,7 @@ SimpleImage::stride () const
        return _stride;
 }
 
-Size
+libdcp::Size
 SimpleImage::size () const
 {
        return _size;
@@ -530,10 +530,10 @@ FilterBufferImage::stride () const
        return _buffer->linesize;
 }
 
-Size
+libdcp::Size
 FilterBufferImage::size () const
 {
-       return Size (_buffer->video->w, _buffer->video->h);
+       return libdcp::Size (_buffer->video->w, _buffer->video->h);
 }
 
 bool
index a623fd226eaaf0c6544c772862d530d047b11a5a..99b9e1d340c47e5bfe8784b568ec486da754bb87 100644 (file)
@@ -51,7 +51,7 @@ ImageMagickDecoder::ImageMagickDecoder (
        _iter = _files.begin ();
 }
 
-Size
+libdcp::Size
 ImageMagickDecoder::native_size () const
 {
        if (_files.empty ()) {
@@ -61,7 +61,7 @@ ImageMagickDecoder::native_size () const
        /* Look at the first file and assume its size holds for all */
        using namespace MagickCore;
        Magick::Image* image = new Magick::Image (_film->content_path ());
-       Size const s = Size (image->columns(), image->rows());
+       libdcp::Size const s = libdcp::Size (image->columns(), image->rows());
        delete image;
 
        return s;
@@ -81,7 +81,7 @@ ImageMagickDecoder::pass ()
        
        Magick::Image* magick_image = new Magick::Image (_film->content_path ());
        
-       Size size = native_size ();
+       libdcp::Size size = native_size ();
        shared_ptr<Image> image (new SimpleImage (PIX_FMT_RGB24, size, false));
 
        using namespace MagickCore;
diff --git a/src/lib/make_dcp_job.cc b/src/lib/make_dcp_job.cc
new file mode 100644 (file)
index 0000000..7055216
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+    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/make_dcp_job.cc
+ *  @brief A job to create DCPs.
+ */
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+#include <libdcp/dcp.h>
+#include <libdcp/picture_asset.h>
+#include <libdcp/sound_asset.h>
+#include <libdcp/reel.h>
+extern "C" {
+#include <libavutil/pixdesc.h>
+}
+#include "make_dcp_job.h"
+#include "dcp_content_type.h"
+#include "exceptions.h"
+#include "options.h"
+#include "imagemagick_decoder.h"
+#include "film.h"
+
+using std::string;
+using std::cout;
+using boost::shared_ptr;
+
+/** @param f Film we are making the DCP for.
+ *  @param o Options.
+ */
+MakeDCPJob::MakeDCPJob (shared_ptr<Film> f, shared_ptr<const EncodeOptions> o, shared_ptr<Job> req)
+       : Job (f, req)
+       , _opt (o)
+{
+       
+}
+
+string
+MakeDCPJob::name () const
+{
+       return String::compose ("Make DCP for %1", _film->name());
+}
+
+/** @param f DCP frame index */
+string
+MakeDCPJob::j2c_path (int f) const
+{
+       SourceFrame const s = (f * dcp_frame_rate(_film->frames_per_second()).skip) + _film->dcp_trim_start();
+       return _opt->frame_out_path (s, false);
+}
+
+string
+MakeDCPJob::wav_path (libdcp::Channel c) const
+{
+       return _opt->multichannel_audio_out_path (int (c), false);
+}
+
+void
+MakeDCPJob::run ()
+{
+       if (!_film->dcp_length()) {
+               throw EncodeError ("cannot make a DCP when the source length is not known");
+       }
+
+       descend (0.9);
+       
+       string const dcp_path = _film->dir (_film->dcp_name());
+
+       /* Remove any old DCP */
+       boost::filesystem::remove_all (dcp_path);
+
+       DCPFrameRate const dfr = dcp_frame_rate (_film->frames_per_second ());
+
+       int frames = 0;
+       switch (_film->content_type ()) {
+       case VIDEO:
+               /* Source frames -> DCP frames */
+               frames = _film->dcp_length().get() / dfr.skip;
+               break;
+       case STILL:
+               frames = _film->still_duration() * 24;
+               break;
+       }
+
+       libdcp::DCP dcp (_film->dir (_film->dcp_name()));
+       dcp.Progress.connect (boost::bind (&MakeDCPJob::dcp_progress, this, _1));
+
+       shared_ptr<libdcp::CPL> cpl (
+               new libdcp::CPL (_film->dir (_film->dcp_name()), _film->dcp_name(), _film->dcp_content_type()->libdcp_kind (), frames, dfr.frames_per_second)
+               );
+       
+       dcp.add_cpl (cpl);
+
+       descend (0.8);
+
+       shared_ptr<libdcp::MonoPictureAsset> pa (
+               new libdcp::MonoPictureAsset (
+                       boost::bind (&MakeDCPJob::j2c_path, this, _1),
+                       _film->dir (_film->dcp_name()),
+                       "video.mxf",
+                       &dcp.Progress,
+                       dfr.frames_per_second,
+                       frames,
+                       _opt->out_size
+                       )
+               );
+       
+       ascend ();
+       
+       shared_ptr<libdcp::SoundAsset> sa;
+       
+       if (_film->audio_channels() > 0) {
+               descend (0.1);
+               sa.reset (
+                       new libdcp::SoundAsset (
+                               boost::bind (&MakeDCPJob::wav_path, this, _1),
+                               _film->dir (_film->dcp_name()),
+                               "audio.mxf",
+                               &dcp.Progress,
+                               dfr.frames_per_second,
+                               frames,
+                               dcp_audio_channels (_film->audio_channels())
+                               )
+                       );
+               ascend ();
+       }
+
+       descend (0.05);
+       cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (pa, sa, shared_ptr<libdcp::SubtitleAsset> ())));
+       ascend ();
+               
+       descend (0.05);
+       dcp.write_xml ();
+       ascend ();
+               
+       set_progress (1);
+       set_state (FINISHED_OK);
+}
+
+void
+MakeDCPJob::dcp_progress (float p)
+{
+       set_progress (p);
+}
diff --git a/src/lib/make_dcp_job.h b/src/lib/make_dcp_job.h
new file mode 100644 (file)
index 0000000..1aa906b
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+    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/make_dcp_job.h
+ *  @brief A job to create DCPs.
+ */
+
+#include "job.h"
+
+class EncodeOptions;
+
+/** @class MakeDCPJob
+ *  @brief A job to create DCPs
+ */
+class MakeDCPJob : public Job
+{
+public:
+       MakeDCPJob (boost::shared_ptr<Film>, boost::shared_ptr<const EncodeOptions>, boost::shared_ptr<Job> req);
+
+       std::string name () const;
+       void run ();
+
+private:
+       void dcp_progress (float);
+       std::string j2c_path (int) const;
+       std::string wav_path (libdcp::Channel) const;
+
+       boost::shared_ptr<const EncodeOptions> _opt;
+};
+
index 134cb65a0140a217ccd4b9a10d3d8a0b7094627d..d75ab0fb679d05f894638158c8ec16db79d63153 100644 (file)
@@ -93,9 +93,9 @@ Server::process (shared_ptr<Socket> socket)
                return -1;
        }
 
-       Size in_size (get_required_int (kv, "input_width"), get_required_int (kv, "input_height"));
+       libdcp::Size in_size (get_required_int (kv, "input_width"), get_required_int (kv, "input_height"));
        int pixel_format_int = get_required_int (kv, "input_pixel_format");
-       Size out_size (get_required_int (kv, "output_width"), get_required_int (kv, "output_height"));
+       libdcp::Size out_size (get_required_int (kv, "output_width"), get_required_int (kv, "output_height"));
        int padding = get_required_int (kv, "padding");
        int subtitle_offset = get_required_int (kv, "subtitle_offset");
        float subtitle_scale = get_required_float (kv, "subtitle_scale");
@@ -106,7 +106,7 @@ Server::process (shared_ptr<Socket> socket)
        int colour_lut_index = get_required_int (kv, "colour_lut");
        int j2k_bandwidth = get_required_int (kv, "j2k_bandwidth");
        Position subtitle_position (get_optional_int (kv, "subtitle_x"), get_optional_int (kv, "subtitle_y"));
-       Size subtitle_size (get_optional_int (kv, "subtitle_width"), get_optional_int (kv, "subtitle_height"));
+       libdcp::Size subtitle_size (get_optional_int (kv, "subtitle_width"), get_optional_int (kv, "subtitle_height"));
 
        /* This checks that colour_lut_index is within range */
        colour_lut_index_to_name (colour_lut_index);
index a7aa7cd21789a772edf04be8edd296362140b776..3754e5acf012c9a8dfe921fab46bb02440f397ef 100644 (file)
@@ -56,7 +56,7 @@ TimedSubtitle::TimedSubtitle (AVSubtitle const & sub)
                throw DecodeError ("non-bitmap subtitles not yet supported");
        }
        
-       shared_ptr<Image> image (new SimpleImage (PIX_FMT_RGBA, Size (rect->w, rect->h), true));
+       shared_ptr<Image> image (new SimpleImage (PIX_FMT_RGBA, libdcp::Size (rect->w, rect->h), true));
 
        /* Start of the first line in the subtitle */
        uint8_t* sub_p = rect->pict.data[0];
index 0e250bb0885bfecde170a8fa5dd97a3690c906fe..872985024ac9a5779bfab4f9fa6fdd4988984047 100644 (file)
@@ -247,7 +247,7 @@ dvdomatic_setup ()
  *  @return FFmpeg crop filter string.
  */
 string
-crop_string (Position start, Size size)
+crop_string (Position start, libdcp::Size size)
 {
        stringstream s;
        s << "crop=" << size.width << ":" << size.height << ":" << start.x << ":" << start.y;
@@ -455,7 +455,6 @@ dcp_audio_channels (int f)
        return f;
 }
 
-
 bool operator== (Crop const & a, Crop const & b)
 {
        return (a.left == b.left && a.right == b.right && a.top == b.top && a.bottom == b.bottom);
index bbaeb17c467d22d20010bd140dbb630406eb7326..4e99bcd960da73a6ce9fe99b40c065ab7c98baf4 100644 (file)
@@ -149,17 +149,6 @@ FilmEditor::make_film_panel ()
                _film_sizer->Add (s);
        }
 
-       _multiple_reels = new wxCheckBox (_film_panel, wxID_ANY, wxT ("Make multiple reels"));
-       _film_sizer->Add (_multiple_reels);
-
-       {
-               wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
-               _reel_size = new wxSpinCtrl (_film_panel, wxID_ANY);
-               s->Add (_reel_size);
-               add_label_to_sizer (s, _film_panel, "Gb each");
-               _film_sizer->Add (s);
-       }
-
        _dcp_ab = new wxCheckBox (_film_panel, wxID_ANY, wxT ("A/B"));
        video_control (_dcp_ab);
        _film_sizer->Add (_dcp_ab, 1);
@@ -180,8 +169,6 @@ FilmEditor::make_film_panel ()
        for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
                _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
        }
-
-       _reel_size->SetRange(1, 1000);
 }
 
 void
@@ -204,8 +191,6 @@ FilmEditor::connect_to_widgets ()
        _still_duration->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::still_duration_changed), 0, this);
        _trim_start->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::trim_start_changed), 0, this);
        _trim_end->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::trim_end_changed), 0, this);
-       _multiple_reels->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::multiple_reels_toggled), 0, this);
-       _reel_size->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::reel_size_changed), 0, this);
        _with_subtitles->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::with_subtitles_toggled), 0, this);
        _subtitle_offset->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_offset_changed), 0, this);
        _subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this);
@@ -478,32 +463,6 @@ FilmEditor::trust_content_header_changed (wxCommandEvent &)
        _film->set_trust_content_header (_trust_content_header->GetValue ());
 }
 
-void
-FilmEditor::multiple_reels_toggled (wxCommandEvent &)
-{
-       if (!_film) {
-               return;
-       }
-
-       if (_multiple_reels->GetValue()) {
-               _film->set_reel_size (_reel_size->GetValue() * 1e9);
-       } else {
-               _film->unset_reel_size ();
-       }
-
-       setup_reel_control_sensitivity ();
-}
-
-void
-FilmEditor::reel_size_changed (wxCommandEvent &)
-{
-       if (!_film) {
-               return;
-       }
-
-       _film->set_reel_size (static_cast<uint64_t> (_reel_size->GetValue()) * 1e9);
-}
-
 /** Called when the DCP A/B switch has been toggled */
 void
 FilmEditor::dcp_ab_toggled (wxCommandEvent &)
@@ -683,15 +642,6 @@ FilmEditor::film_changed (Film::Property p)
        case Film::TRIM_END:
                checked_set (_trim_end, _film->trim_end());
                break;
-       case Film::REEL_SIZE:
-               if (_film->reel_size()) {
-                       checked_set (_multiple_reels, true);
-                       checked_set (_reel_size, _film->reel_size().get() / 1e9);
-               } else {
-                       checked_set (_multiple_reels, false);
-               }
-               setup_reel_control_sensitivity ();
-               break;
        case Film::AUDIO_GAIN:
                checked_set (_audio_gain, _film->audio_gain ());
                break;
@@ -815,7 +765,6 @@ FilmEditor::set_film (shared_ptr<Film> f)
        film_changed (Film::SCALER);
        film_changed (Film::TRIM_START);
        film_changed (Film::TRIM_END);
-       film_changed (Film::REEL_SIZE);
        film_changed (Film::DCP_AB);
        film_changed (Film::CONTENT_AUDIO_STREAM);
        film_changed (Film::EXTERNAL_AUDIO);
@@ -860,8 +809,6 @@ FilmEditor::set_things_sensitive (bool s)
        _dcp_content_type->Enable (s);
        _trim_start->Enable (s);
        _trim_end->Enable (s);
-       _multiple_reels->Enable (s);
-       _reel_size->Enable (s);
        _dcp_ab->Enable (s);
        _colour_lut->Enable (s);
        _j2k_bandwidth->Enable (s);
@@ -872,7 +819,6 @@ FilmEditor::set_things_sensitive (bool s)
 
        setup_subtitle_control_sensitivity ();
        setup_audio_control_sensitivity ();
-       setup_reel_control_sensitivity ();
 }
 
 /** Called when the `Edit filters' button has been clicked */
@@ -1213,9 +1159,3 @@ FilmEditor::external_audio_changed (wxCommandEvent &)
 
        _film->set_external_audio (a);
 }
-
-void
-FilmEditor::setup_reel_control_sensitivity ()
-{
-       _reel_size->Enable (_multiple_reels->GetValue ());
-}
index 323aead95fb3affef35e62385b66e7facd28a09a..7272315fcfedc88af94bf8bc9b9f3f977057652e 100644 (file)
@@ -65,8 +65,6 @@ private:
        void format_changed (wxCommandEvent &);
        void trim_start_changed (wxCommandEvent &);
        void trim_end_changed (wxCommandEvent &);
-       void multiple_reels_toggled (wxCommandEvent &);
-       void reel_size_changed (wxCommandEvent &);
        void dcp_content_type_changed (wxCommandEvent &);
        void dcp_ab_toggled (wxCommandEvent &);
        void scaler_changed (wxCommandEvent &);
@@ -94,7 +92,6 @@ private:
        void setup_formats ();
        void setup_subtitle_control_sensitivity ();
        void setup_audio_control_sensitivity ();
-       void setup_reel_control_sensitivity ();
        void setup_streams ();
        void setup_audio_details ();
        
@@ -170,8 +167,6 @@ private:
 
        wxSpinCtrl* _trim_start;
        wxSpinCtrl* _trim_end;
-       wxCheckBox* _multiple_reels;
-       wxSpinCtrl* _reel_size;
        /** Selector to generate an A/B comparison DCP */
        wxCheckBox* _dcp_ab;
 
index e5da41d5e80f30c9959a43854f235d29b8d4682a..4176f4f426e8287f1dffc16b335542ed132a0e05 100644 (file)
@@ -258,13 +258,13 @@ FilmViewer::raw_to_display ()
                return;
        }
 
-       Size old_size;
+       libdcp::Size old_size;
        if (_display_frame) {
                old_size = _display_frame->size();
        }
 
        /* Get a compacted image as we have to feed it to wxWidgets */
-       _display_frame = _raw_frame->scale_and_convert_to_rgb (Size (_out_width, _out_height), 0, _film->scaler(), false);
+       _display_frame = _raw_frame->scale_and_convert_to_rgb (libdcp::Size (_out_width, _out_height), 0, _film->scaler(), false);
 
        if (old_size != _display_frame->size()) {
                _clear_required = true;
index 6029c04f32a7c02769f715248ae4a25bce774bb6..c6b5e7c0c5530ec871f4b04df919a48b97b83de8 100644 (file)
@@ -59,7 +59,7 @@ private:
 
        boost::shared_ptr<Film> _film;
 
-       wxBoxSizer* _v_sizer;
+       wxSizer* _v_sizer;
        wxPanel* _panel;
        wxSlider* _slider;
        wxToggleButton* _play_button;
diff --git a/wscript b/wscript
index 321a15a82aa9479bfc9e8e87d8c5592d4ab6cc39..d8ec37667545a1ede15152237ef1a7a41e9b7a8e 100644 (file)
--- a/wscript
+++ b/wscript
@@ -103,7 +103,7 @@ def configure(conf):
     if conf.options.static:
         conf.check_cc(fragment = openjpeg_fragment, msg = 'Checking for library openjpeg', stlib = 'openjpeg', uselib_store = 'OPENJPEG')
     else:
-        conf.check_cc(fragment = openjpeg_fragment, msg = 'Checking for library openjpeg', lib = 'openjpeg', uselib_store = 'OPENJPEG')
+        conf.check_cfg(package = 'libopenjpeg', args = '--cflags --libs', uselib_store = 'OPENJPEG', mandatory = True)
 
     conf.check_cc(fragment  = """
                               #include <libssh/libssh.h>\n