Rename SafeStringStream -> locked_stringstream. Bump deps for removal of stringstream.
[dcpomatic.git] / src / lib / film.cc
index 3378b2042818a4f716f589c3aef2655c310f3120..0138211cf0c49d823f3357fbdca62108a68dbe2c 100644 (file)
@@ -38,7 +38,6 @@
 #include "dcp_content_type.h"
 #include "ratio.h"
 #include "cross.h"
-#include "safe_stringstream.h"
 #include "environment_info.h"
 #include "raw_convert.h"
 #include "audio_processor.h"
@@ -52,6 +51,7 @@
 #include "dcp_content.h"
 #include "screen_kdm.h"
 #include "cinema.h"
+#include <locked_sstream.h>
 #include <libcxml/cxml.h>
 #include <dcp/cpl.h>
 #include <dcp/certificate_chain.h>
@@ -62,7 +62,6 @@
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/foreach.hpp>
-#include <boost/make_shared.hpp>
 #include <boost/regex.hpp>
 #include <unistd.h>
 #include <stdexcept>
@@ -90,7 +89,6 @@ using boost::weak_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
 using boost::is_any_of;
-using boost::make_shared;
 
 #define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
 #define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
@@ -116,8 +114,10 @@ using boost::make_shared;
  * are present.
  * 34 -> 35
  * VideoFrameType in VideoContent is a string rather than an integer.
+ * 35 -> 36
+ * EffectColour rather than OutlineColour in Subtitle.
  */
-int const Film::current_state_version = 35;
+int const Film::current_state_version = 36;
 
 /** Construct a Film object in a given directory.
  *
@@ -197,7 +197,7 @@ Film::video_identifier () const
 {
        DCPOMATIC_ASSERT (container ());
 
-       SafeStringStream s;
+       locked_stringstream s;
        s.imbue (std::locale::classic ());
 
        s << container()->id()
@@ -320,21 +320,21 @@ Film::make_dcp ()
                throw MissingSettingError (_("name"));
        }
 
-       JobManager::instance()->add (make_shared<TranscodeJob> (shared_from_this()));
+       JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
 }
 
 /** Start a job to send our DCP to the configured TMS */
 void
 Film::send_dcp_to_tms ()
 {
-       shared_ptr<Job> j = make_shared<UploadJob> (shared_from_this());
+       shared_ptr<Job> j (new UploadJob (shared_from_this()));
        JobManager::instance()->add (j);
 }
 
 shared_ptr<xmlpp::Document>
 Film::metadata () const
 {
-       shared_ptr<xmlpp::Document> doc = make_shared<xmlpp::Document> ();
+       shared_ptr<xmlpp::Document> doc (new xmlpp::Document);
        xmlpp::Element* root = doc->create_root_node ("Metadata");
 
        root->add_child("Version")->add_child_text (raw_convert<string> (current_state_version));
@@ -530,7 +530,7 @@ Film::mapped_audio_channels () const
 string
 Film::isdcf_name (bool if_created_now) const
 {
-       SafeStringStream d;
+       locked_stringstream d;
 
        string raw_name = name ();
 
@@ -922,7 +922,7 @@ Film::j2c_path (int reel, Frame frame, Eyes eyes, bool tmp) const
        p /= "j2c";
        p /= video_identifier ();
 
-       SafeStringStream s;
+       locked_stringstream s;
        s.width (8);
        s << setfill('0') << reel << "_" << frame;
 
@@ -1005,7 +1005,7 @@ Film::content () const
 void
 Film::examine_content (shared_ptr<Content> c)
 {
-       shared_ptr<Job> j = make_shared<ExamineContentJob> (shared_from_this(), c);
+       shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
        JobManager::instance()->add (j);
 }
 
@@ -1016,7 +1016,7 @@ Film::examine_and_add_content (shared_ptr<Content> c)
                run_ffprobe (c->path(0), file ("ffprobe.log"), _log);
        }
 
-       shared_ptr<Job> j = make_shared<ExamineContentJob> (shared_from_this(), c);
+       shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
 
        _job_connections.push_back (
                j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr<Job> (j), weak_ptr<Content> (c)))
@@ -1040,7 +1040,7 @@ Film::maybe_add_content (weak_ptr<Job> j, weak_ptr<Content> c)
 
        add_content (content);
        if (Config::instance()->automatic_audio_analysis() && content->audio) {
-               shared_ptr<Playlist> playlist = make_shared<Playlist> ();
+               shared_ptr<Playlist> playlist (new Playlist);
                playlist->add (content);
                boost::signals2::connection c;
                JobManager::instance()->analyse_audio (
@@ -1182,7 +1182,7 @@ Film::make_kdm (
        dcp::Formulation formulation
        ) const
 {
-       shared_ptr<const dcp::CPL> cpl = make_shared<dcp::CPL> (cpl_file);
+       shared_ptr<const dcp::CPL> cpl (new dcp::CPL (cpl_file));
        shared_ptr<const dcp::CertificateChain> signer = Config::instance()->signer_chain ();
        if (!signer->valid ()) {
                throw InvalidSignerError ();
@@ -1407,7 +1407,6 @@ Film::reels () const
        {
                optional<DCPTime> last_split;
                shared_ptr<Content> last_video;
-               ContentList cl = content ();
                BOOST_FOREACH (shared_ptr<Content> c, content ()) {
                        if (c->video) {
                                BOOST_FOREACH (DCPTime t, c->reel_split_points()) {