+2014-03-07 Carl Hetherington <cth@carlh.net>
+
+ * Add subtitle view.
+
+ 2014-05-16 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.69.8 released.
+
+ 2014-05-16 Carl Hetherington <cth@carlh.net>
+
+ * Fix various confusions in translations of abbreviated
+ channel names (Lc, Rc etc.)
+
+ 2014-05-14 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.69.7 released.
+
+ 2014-05-14 Carl Hetherington <cth@carlh.net>
+
+ * Bump libdcp to remove checks on PCM MXF edit rates,
+ so we can generate strange ones in DCP-o-matic.
+
+ 2014-05-13 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.69.6 released.
+
+ 2014-05-13 Carl Hetherington <cth@carlh.net>
+
+ * Remove artificial 100fps limit when using
+ "any" DCP frame rate.
+
+ 2014-05-12 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.69.5 released.
+
+ 2014-05-12 Carl Hetherington <cth@carlh.net>
+
+ * Add option to use any DCP frame rate, rather than just
+ the "allowed" set.
+
+ * Version 1.69.4 released.
+
+ 2014-05-12 Carl Hetherington <cth@carlh.net>
+
+ * Version 1.69.3 released.
+
+ 2014-05-12 Carl Hetherington <cth@carlh.net>
+
+ * Use libdcp::raw_convert instead of boost::lexical_cast and
+ LocaleGuard, hopefully to fix large numbers being written with
+ thousands separators on some locales.
+
2014-05-10 Carl Hetherington <cth@carlh.net>
* Version 1.69.2 released.
*/
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "audio_content.h"
#include "analyse_audio_job.h"
#include "job_manager.h"
using std::string;
using std::vector;
using boost::shared_ptr;
- using boost::lexical_cast;
using boost::dynamic_pointer_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
int const AudioContentProperty::AUDIO_CHANNELS = 200;
int const AudioContentProperty::AUDIO_LENGTH = 201;
*/
- #include <boost/lexical_cast.hpp>
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "audio_mapping.h"
#include "util.h"
using std::string;
using std::min;
using boost::shared_ptr;
- using boost::lexical_cast;
using boost::dynamic_pointer_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
AudioMapping::AudioMapping ()
: _content_channels (0)
for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
set (
(*i)->number_attribute<int> ("Content"),
- static_cast<libdcp::Channel> ((*i)->number_attribute<int> ("DCP")),
+ static_cast<dcp::Channel> ((*i)->number_attribute<int> ("DCP")),
- lexical_cast<float> ((*i)->content ())
+ raw_convert<float> ((*i)->content ())
);
}
}
for (int c = 0; c < _content_channels; ++c) {
for (int d = 0; d < MAX_DCP_AUDIO_CHANNELS; ++d) {
xmlpp::Element* t = node->add_child ("Gain");
- t->set_attribute ("Content", lexical_cast<string> (c));
- t->set_attribute ("DCP", lexical_cast<string> (d));
- t->add_child_text (lexical_cast<string> (get (c, static_cast<dcp::Channel> (d))));
+ t->set_attribute ("Content", raw_convert<string> (c));
+ t->set_attribute ("DCP", raw_convert<string> (d));
- t->add_child_text (raw_convert<string> (get (c, static_cast<libdcp::Channel> (d))));
++ t->add_child_text (raw_convert<string> (get (c, static_cast<dcp::Channel> (d))));
}
}
}
*/
- #include <boost/lexical_cast.hpp>
#include <libxml++/libxml++.h>
-#include <libdcp/colour_matrix.h>
-#include <libdcp/raw_convert.h>
+#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include "config.h"
#include "colour_conversion.h"
using std::cout;
using std::vector;
using boost::shared_ptr;
- using boost::lexical_cast;
using boost::optional;
-using libdcp::raw_convert;
++using dcp::raw_convert;
ColourConversion::ColourConversion ()
: input_gamma (2.4)
#include <glib.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
-#include <libdcp/colour_matrix.h>
-#include <libdcp/raw_convert.h>
+#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include "config.h"
#include "server.h"
using boost::optional;
using boost::algorithm::is_any_of;
using boost::algorithm::split;
-using libdcp::raw_convert;
++using dcp::raw_convert;
Config* Config::_instance = 0;
#include <boost/thread/mutex.hpp>
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "content.h"
#include "util.h"
#include "content_factory.h"
using std::cout;
using std::vector;
using boost::shared_ptr;
- using boost::lexical_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
int const ContentProperty::PATH = 400;
int const ContentProperty::POSITION = 401;
node->add_child("Path")->add_child_text (i->string ());
}
node->add_child("Digest")->add_child_text (_digest);
- node->add_child("Position")->add_child_text (lexical_cast<string> (_position.get ()));
- node->add_child("TrimStart")->add_child_text (lexical_cast<string> (_trim_start.get ()));
- node->add_child("TrimEnd")->add_child_text (lexical_cast<string> (_trim_end.get ()));
- node->add_child("Position")->add_child_text (raw_convert<string> (_position));
- node->add_child("TrimStart")->add_child_text (raw_convert<string> (_trim_start));
- node->add_child("TrimEnd")->add_child_text (raw_convert<string> (_trim_end));
++ node->add_child("Position")->add_child_text (raw_convert<string> (_position.get ()));
++ node->add_child("TrimStart")->add_child_text (raw_convert<string> (_trim_start.get ()));
++ node->add_child("TrimEnd")->add_child_text (raw_convert<string> (_trim_end.get ()));
}
void
#include <iostream>
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "dci_metadata.h"
#include "i18n.h"
using std::string;
- using boost::lexical_cast;
using boost::shared_ptr;
-using libdcp::raw_convert;
++using dcp::raw_convert;
DCIMetadata::DCIMetadata (shared_ptr<const cxml::Node> node)
{
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/filesystem.hpp>
-#include <libdcp/rec709_linearised_gamma_lut.h>
-#include <libdcp/srgb_linearised_gamma_lut.h>
-#include <libdcp/gamma_lut.h>
-#include <libdcp/xyz_frame.h>
-#include <libdcp/rgb_xyz.h>
-#include <libdcp/colour_matrix.h>
-#include <libdcp/raw_convert.h>
+#include <boost/lexical_cast.hpp>
+#include <dcp/gamma_lut.h>
+#include <dcp/xyz_frame.h>
+#include <dcp/rgb_xyz.h>
+#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include "film.h"
#include "dcp_video_frame.h"
using std::stringstream;
using std::cout;
using boost::shared_ptr;
-using libdcp::Size;
-using libdcp::raw_convert;
+using boost::lexical_cast;
+using dcp::Size;
++using dcp::raw_convert;
#define DCI_COEFFICENT (48.0 / 52.37)
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "ffmpeg.h"
#include "ffmpeg_content.h"
#include "exceptions.h"
using std::cout;
using std::stringstream;
using boost::shared_ptr;
- using boost::lexical_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
boost::mutex FFmpeg::_mutex;
}
if (_first_video) {
- node->add_child("FirstVideo")->add_child_text (lexical_cast<string> (_first_video.get().get()));
- node->add_child("FirstVideo")->add_child_text (raw_convert<string> (_first_video.get ()));
++ node->add_child("FirstVideo")->add_child_text (raw_convert<string> (_first_video.get().get()));
}
}
FFmpegAudioStream::as_xml (xmlpp::Node* root) const
{
FFmpegStream::as_xml (root);
- root->add_child("FrameRate")->add_child_text (lexical_cast<string> (frame_rate));
- root->add_child("Channels")->add_child_text (lexical_cast<string> (channels));
+ root->add_child("FrameRate")->add_child_text (raw_convert<string> (frame_rate));
+ root->add_child("Channels")->add_child_text (raw_convert<string> (channels));
if (first_audio) {
- root->add_child("FirstAudio")->add_child_text (lexical_cast<string> (first_audio.get().get()));
- root->add_child("FirstAudio")->add_child_text (raw_convert<string> (first_audio.get ()));
++ root->add_child("FirstAudio")->add_child_text (raw_convert<string> (first_audio.get().get()));
}
mapping.as_xml (root->add_child("Mapping"));
}
#define DCPOMATIC_FFMPEG_CONTENT_H
#include <boost/enable_shared_from_this.hpp>
++#include <boost/lexical_cast.hpp>
#include "video_content.h"
#include "audio_content.h"
#include "subtitle_content.h"
#include <unistd.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/date_time.hpp>
+#include <boost/lexical_cast.hpp>
#include <libxml++/libxml++.h>
#include <libcxml/cxml.h>
-#include <libdcp/signer_chain.h>
-#include <libdcp/cpl.h>
-#include <libdcp/signer.h>
-#include <libdcp/util.h>
-#include <libdcp/kdm.h>
-#include <libdcp/raw_convert.h>
+#include <dcp/signer_chain.h>
+#include <dcp/cpl.h>
+#include <dcp/signer.h>
+#include <dcp/util.h>
+#include <dcp/local_time.h>
++#include <dcp/raw_convert.h>
#include "film.h"
#include "job.h"
#include "util.h"
using boost::ends_with;
using boost::starts_with;
using boost::optional;
-using libdcp::Size;
-using libdcp::Signer;
-using libdcp::raw_convert;
+using dcp::Size;
+using dcp::Signer;
++using dcp::raw_convert;
/* 5 -> 6
* AudioMapping XML changed.
#include <sstream>
#include <iostream>
#include <boost/algorithm/string.hpp>
- #include <boost/lexical_cast.hpp>
#include <boost/scoped_array.hpp>
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "server.h"
#include "util.h"
#include "scaler.h"
using boost::bind;
using boost::scoped_array;
using boost::optional;
- using boost::lexical_cast;
-using libdcp::Size;
-using libdcp::raw_convert;
+using dcp::Size;
++using dcp::raw_convert;
Server::Server (shared_ptr<Log> log, bool verbose)
: _log (log)
*/
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "server_finder.h"
#include "exceptions.h"
#include "util.h"
using std::cout;
using boost::shared_ptr;
using boost::scoped_array;
- using boost::lexical_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
ServerFinder* ServerFinder::_instance = 0;
*/
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "sndfile_content.h"
#include "sndfile_decoder.h"
#include "film.h"
using std::stringstream;
using std::cout;
using boost::shared_ptr;
- using boost::lexical_cast;
-using libdcp::raw_convert;
-
-int const SndfileContentProperty::VIDEO_FRAME_RATE = 600;
++using dcp::raw_convert;
SndfileContent::SndfileContent (shared_ptr<const Film> f, boost::filesystem::path p)
: Content (f, p)
Content::as_xml (node);
AudioContent::as_xml (node);
- node->add_child("AudioChannels")->add_child_text (lexical_cast<string> (audio_channels ()));
- node->add_child("AudioLength")->add_child_text (lexical_cast<string> (audio_length().get ()));
- node->add_child("AudioFrameRate")->add_child_text (lexical_cast<string> (audio_frame_rate ()));
+ node->add_child("AudioChannels")->add_child_text (raw_convert<string> (audio_channels ()));
- node->add_child("AudioLength")->add_child_text (raw_convert<string> (audio_length ()));
- node->add_child("AudioFrameRate")->add_child_text (raw_convert<string> (content_audio_frame_rate ()));
++ node->add_child("AudioLength")->add_child_text (raw_convert<string> (audio_length().get ()));
++ node->add_child("AudioFrameRate")->add_child_text (raw_convert<string> (audio_frame_rate ()));
_audio_mapping.as_xml (node->add_child("AudioMapping"));
}
--- /dev/null
- LocaleGuard lg;
-
+/*
+ Copyright (C) 2014 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.
+
+*/
+
+#include "subrip_content.h"
+#include "util.h"
+#include "subrip.h"
+#include "film.h"
++#include <dcp/raw_convert.h>
+
+#include "i18n.h"
+
+using std::stringstream;
+using std::string;
+using std::cout;
++using dcp::raw_convert;
+using boost::shared_ptr;
+using boost::lexical_cast;
+
+SubRipContent::SubRipContent (shared_ptr<const Film> film, boost::filesystem::path path)
+ : Content (film, path)
+ , SubtitleContent (film, path)
+{
+
+}
+
+SubRipContent::SubRipContent (shared_ptr<const Film> film, shared_ptr<const cxml::Node> node, int version)
+ : Content (film, node)
+ , SubtitleContent (film, node, version)
+ , _length (node->number_child<int64_t> ("Length"))
+{
+
+}
+
+void
+SubRipContent::examine (boost::shared_ptr<Job> job)
+{
+ Content::examine (job);
+ SubRip s (shared_from_this ());
+
+ shared_ptr<const Film> film = _film.lock ();
+ assert (film);
+
+ DCPTime len (s.length (), film->active_frame_rate_change (position ()));
+
+ boost::mutex::scoped_lock lm (_mutex);
+ _length = len;
+}
+
+string
+SubRipContent::summary () const
+{
+ return path_summary() + " " + _("[subtitles]");
+}
+
+string
+SubRipContent::technical_summary () const
+{
+ return Content::technical_summary() + " - " + _("SubRip subtitles");
+}
+
+string
+SubRipContent::information () const
+{
+
+}
+
+void
+SubRipContent::as_xml (xmlpp::Node* node) const
+{
- node->add_child("Length")->add_child_text (lexical_cast<string> (_length.get ()));
+ node->add_child("Type")->add_child_text ("SubRip");
+ Content::as_xml (node);
+ SubtitleContent::as_xml (node);
- LocaleGuard lg;
-
++ node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));
+}
+
+DCPTime
+SubRipContent::full_length () const
+{
+ /* XXX: this assumes that the timing of the SubRip file is appropriate
+ for the DCP's frame rate.
+ */
+ return _length;
+}
+
+string
+SubRipContent::identifier () const
+{
- << "_" << subtitle_scale()
- << "_" << subtitle_x_offset()
- << "_" << subtitle_y_offset();
+ stringstream s;
+ s << Content::identifier()
++ << "_" << raw_convert<string> (subtitle_scale())
++ << "_" << raw_convert<string> (subtitle_x_offset())
++ << "_" << raw_convert<string> (subtitle_y_offset());
+
+ return s.str ();
+}
*/
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "subtitle_content.h"
#include "util.h"
#include "exceptions.h"
using std::string;
using std::vector;
+using std::cout;
using boost::shared_ptr;
- using boost::lexical_cast;
using boost::dynamic_pointer_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
int const SubtitleContentProperty::SUBTITLE_X_OFFSET = 500;
int const SubtitleContentProperty::SUBTITLE_Y_OFFSET = 501;
#include <boost/algorithm/string.hpp>
#include <curl/curl.h>
#include <libcxml/cxml.h>
-#include <libdcp/raw_convert.h>
++#include <dcp/raw_convert.h>
#include "update.h"
#include "version.h"
#include "ui_signaller.h"
using std::min;
using std::string;
using std::stringstream;
- using boost::lexical_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
+/** Singleton instance */
UpdateChecker* UpdateChecker::_instance = 0;
static size_t
#include <glib.h>
#include <openjpeg.h>
#include <openssl/md5.h>
+#include <pangomm/init.h>
#include <magick/MagickCore.h>
#include <magick/version.h>
-#include <libdcp/version.h>
-#include <libdcp/util.h>
-#include <libdcp/signer_chain.h>
-#include <libdcp/signer.h>
-#include <libdcp/raw_convert.h>
+#include <dcp/version.h>
+#include <dcp/util.h>
+#include <dcp/signer_chain.h>
+#include <dcp/signer.h>
++#include <dcp/raw_convert.h>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
using std::set_terminate;
using boost::shared_ptr;
using boost::thread;
- using boost::lexical_cast;
using boost::optional;
-using libdcp::Size;
-using libdcp::raw_convert;
+using dcp::Size;
++using dcp::raw_convert;
static boost::thread::id ui_thread;
static boost::filesystem::path backtrace_file;
return channels[c];
}
- LocaleGuard::LocaleGuard ()
- : _old (0)
-FrameRateConversion::FrameRateConversion (float source, int dcp)
- : skip (false)
- , repeat (1)
- , change_speed (false)
--{
- char const * old = setlocale (LC_NUMERIC, 0);
- if (fabs (source / 2.0 - dcp) < fabs (source - dcp)) {
- /* The difference between source and DCP frame rate will be lower
- (i.e. better) if we skip.
- */
- skip = true;
- } else if (fabs (source * 2 - dcp) < fabs (source - dcp)) {
- /* The difference between source and DCP frame rate would be better
- if we repeated each frame once; it may be better still if we
- repeated more than once. Work out the required repeat.
- */
- repeat = round (dcp / source);
- }
--
- if (old) {
- _old = strdup (old);
- if (strcmp (_old, "C")) {
- setlocale (LC_NUMERIC, "C");
- change_speed = !about_equal (source * factor(), dcp);
-
- if (!skip && repeat == 1 && !change_speed) {
- description = _("Content and DCP have the same rate.\n");
- } else {
- if (skip) {
- description = _("DCP will use every other frame of the content.\n");
- } else if (repeat == 2) {
- description = _("Each content frame will be doubled in the DCP.\n");
- } else if (repeat > 2) {
- description = String::compose (_("Each content frame will be repeated %1 more times in the DCP.\n"), repeat - 1);
-- }
- }
- }
--
- LocaleGuard::~LocaleGuard ()
- {
- setlocale (LC_NUMERIC, _old);
- free (_old);
- if (change_speed) {
- float const pc = dcp * 100 / (source * factor());
- description += String::compose (_("DCP will run at %1%% of the content speed.\n"), pc);
- }
- }
--}
--
bool
valid_image_file (boost::filesystem::path f)
{
int _timeout;
};
- class LocaleGuard
- {
- public:
- LocaleGuard ();
- ~LocaleGuard ();
-
- private:
- char* _old;
- };
+ extern int64_t video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, float frames_per_second);
+/** @class ScopedTemporary
+ * @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope.
+ */
class ScopedTemporary
{
public:
#include <iomanip>
#include <libcxml/cxml.h>
-#include <libdcp/colour_matrix.h>
-#include <libdcp/raw_convert.h>
+#include <dcp/colour_matrix.h>
++#include <dcp/raw_convert.h>
#include "video_content.h"
#include "video_examiner.h"
#include "compose.hpp"
using std::cout;
using std::vector;
using boost::shared_ptr;
- using boost::lexical_cast;
using boost::optional;
using boost::dynamic_pointer_cast;
-using libdcp::raw_convert;
++using dcp::raw_convert;
vector<VideoContentScale> VideoContentScale::_scales;
VideoContent::as_xml (xmlpp::Node* node) const
{
boost::mutex::scoped_lock lm (_mutex);
- node->add_child("VideoLength")->add_child_text (lexical_cast<string> (_video_length.get ()));
- node->add_child("VideoWidth")->add_child_text (lexical_cast<string> (_video_size.width));
- node->add_child("VideoHeight")->add_child_text (lexical_cast<string> (_video_size.height));
- node->add_child("VideoFrameRate")->add_child_text (lexical_cast<string> (_video_frame_rate));
- node->add_child("VideoFrameType")->add_child_text (lexical_cast<string> (static_cast<int> (_video_frame_type)));
- node->add_child("LeftCrop")->add_child_text (boost::lexical_cast<string> (_crop.left));
- node->add_child("RightCrop")->add_child_text (boost::lexical_cast<string> (_crop.right));
- node->add_child("TopCrop")->add_child_text (boost::lexical_cast<string> (_crop.top));
- node->add_child("BottomCrop")->add_child_text (boost::lexical_cast<string> (_crop.bottom));
- node->add_child("VideoLength")->add_child_text (raw_convert<string> (_video_length));
++ node->add_child("VideoLength")->add_child_text (raw_convert<string> (_video_length.get ()));
+ node->add_child("VideoWidth")->add_child_text (raw_convert<string> (_video_size.width));
+ node->add_child("VideoHeight")->add_child_text (raw_convert<string> (_video_size.height));
+ node->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate));
+ node->add_child("VideoFrameType")->add_child_text (raw_convert<string> (static_cast<int> (_video_frame_type)));
+ node->add_child("LeftCrop")->add_child_text (raw_convert<string> (_crop.left));
+ node->add_child("RightCrop")->add_child_text (raw_convert<string> (_crop.right));
+ node->add_child("TopCrop")->add_child_text (raw_convert<string> (_crop.top));
+ node->add_child("BottomCrop")->add_child_text (raw_convert<string> (_crop.bottom));
_scale.as_xml (node->add_child("Scale"));
_colour_conversion.as_xml (node->add_child("ColourConversion"));
}
#include "audio_mapping_view.h"
#include "wx_util.h"
#include "audio_gain_dialog.h"
++#include <boost/lexical_cast.hpp>
using std::cout;
using std::list;
using std::ostream;
--namespace libdcp {
++namespace dcp {
ostream&
-operator<< (ostream& s, libdcp::Size const & t)
+operator<< (ostream& s, dcp::Size const & t)
{
s << t.width << "x" << t.height;
return s;