From a8a0dfd1b21de6c0facf965ab119833ff6f790bf Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Jun 2016 23:08:53 +0100 Subject: [PATCH] Revert "Use make_shared<>." Support for this seems to vary wildly across DoM's build targets. Stuff that builds on 16.04 won't build on 14.04, for example. Seems to not be worth the hassle now. This reverts commit 5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f. --- src/lib/analyse_audio_job.cc | 4 +--- src/lib/atmos_mxf_content.cc | 6 ++---- src/lib/audio_analysis.cc | 4 +--- src/lib/audio_buffers.cc | 6 ++---- src/lib/audio_content.cc | 1 - src/lib/audio_decoder.cc | 4 +--- src/lib/audio_decoder_stream.cc | 10 ++++------ src/lib/audio_delay.cc | 4 +--- src/lib/audio_filter.cc | 4 +--- src/lib/audio_filter_graph.cc | 4 +--- src/lib/cinema.cc | 4 +--- src/lib/cinema_kdms.cc | 4 +--- src/lib/config.cc | 8 +++----- src/lib/dcp_content.cc | 4 +--- src/lib/dcp_decoder.cc | 10 ++++------ src/lib/dcp_subtitle_content.cc | 4 +--- src/lib/dcp_video.cc | 4 +--- src/lib/decoder_factory.cc | 14 ++++++------- src/lib/encode_server.cc | 8 +++----- src/lib/encode_server_finder.cc | 6 ++---- src/lib/ffmpeg_content.cc | 8 +++----- src/lib/ffmpeg_decoder.cc | 8 +++----- src/lib/ffmpeg_examiner.cc | 4 +--- src/lib/film.cc | 16 +++++++-------- src/lib/image.cc | 8 +++----- src/lib/image_content.cc | 4 +--- src/lib/image_proxy.cc | 8 +++----- src/lib/j2k_image_proxy.cc | 4 +--- src/lib/json_server.cc | 4 +--- src/lib/log.cc | 10 ++++------ src/lib/mid_side_decoder.cc | 6 ++---- src/lib/player.cc | 12 +++++------- src/lib/reel_writer.cc | 10 ++++------ src/lib/render_subtitles.cc | 4 +--- src/lib/resampler.cc | 6 ++---- src/lib/server.cc | 4 +--- src/lib/subtitle_content.cc | 5 +---- src/lib/text_subtitle_content.cc | 4 +--- src/lib/transcode_job.cc | 4 +--- src/lib/upmixer_a.cc | 6 ++---- src/lib/upmixer_b.cc | 8 +++----- src/lib/video_content.cc | 1 - src/lib/video_decoder.cc | 8 +++----- src/lib/video_filter_graph.cc | 7 +++---- src/lib/video_mxf_content.cc | 8 +++----- src/lib/video_mxf_decoder.cc | 8 +++----- src/tools/dcpomatic.cc | 22 ++++++++++----------- src/tools/dcpomatic_batch.cc | 4 +--- src/tools/dcpomatic_create.cc | 4 +--- src/tools/dcpomatic_kdm.cc | 16 +++++++-------- src/tools/server_test.cc | 10 ++++------ src/wx/audio_panel.cc | 6 ++---- src/wx/colour_conversion_editor.cc | 20 ++++++++++--------- src/wx/content_menu.cc | 6 ++---- src/wx/hints_dialog.cc | 4 +--- src/wx/job_manager_view.cc | 6 ++---- src/wx/report_problem_dialog.cc | 4 +--- src/wx/screens_panel.cc | 6 ++---- src/wx/timeline.cc | 10 ++++------ test/4k_test.cc | 6 ++---- test/audio_analysis_test.cc | 18 ++++++++--------- test/audio_decoder_test.cc | 4 +--- test/audio_delay_test.cc | 18 ++++++++--------- test/audio_filter_test.cc | 8 +++----- test/audio_processor_delay_test.cc | 8 +++----- test/audio_processor_test.cc | 6 ++---- test/black_fill_test.cc | 8 +++----- test/burnt_subtitle_test.cc | 4 ++-- test/client_server_test.cc | 27 ++++++++++++-------------- test/colour_conversion_test.cc | 4 +--- test/dcp_subtitle_test.cc | 10 ++++------ test/ffmpeg_audio_only_test.cc | 6 ++---- test/ffmpeg_audio_test.cc | 4 +--- test/ffmpeg_dcp_test.cc | 12 +++++------- test/ffmpeg_decoder_seek_test.cc | 8 +++----- test/ffmpeg_decoder_sequential_test.cc | 8 +++----- test/ffmpeg_examiner_test.cc | 8 +++----- test/ffmpeg_pts_offset_test.cc | 7 ++----- test/film_metadata_test.cc | 10 ++++------ test/frame_rate_test.cc | 14 ++++++------- test/image_test.cc | 14 ++++++------- test/import_dcp_test.cc | 8 +++----- test/interrupt_encoder_test.cc | 4 +--- test/isdcf_name_test.cc | 6 ++---- test/job_test.cc | 6 ++---- test/make_black_test.cc | 6 ++---- test/play_test.cc | 6 +++--- test/player_test.cc | 18 ++++++++--------- test/recover_test.cc | 14 ++++++------- test/reels_test.cc | 20 +++++++++---------- test/repeat_frame_test.cc | 6 ++---- test/resampler_test.cc | 6 ++---- test/scaling_test.cc | 6 ++---- test/seek_zero_test.cc | 6 ++---- test/silence_padding_test.cc | 4 +--- test/skip_frame_test.cc | 6 ++---- test/srt_subtitle_test.cc | 12 +++++------- test/ssa_subtitle_test.cc | 4 +--- test/test.cc | 4 +--- test/threed_test.cc | 4 +--- test/time_calculation_test.cc | 24 +++++++++++------------ test/upmixer_a_test.cc | 10 ++++------ test/vf_test.cc | 6 ++---- test/video_content_scale_test.cc | 8 +++----- test/video_decoder_fill_test.cc | 8 +++----- test/video_mxf_content_test.cc | 6 ++---- test/xml_subtitle_test.cc | 8 +++----- 107 files changed, 314 insertions(+), 520 deletions(-) diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index ffe7c0fc7..8d0accf0f 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -36,7 +36,6 @@ extern "C" { #endif } #include -#include #include #include "i18n.h" @@ -47,7 +46,6 @@ using std::min; using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; -using boost::make_shared; int const AnalyseAudioJob::_num_points = 1024; @@ -92,7 +90,7 @@ AnalyseAudioJob::json_name () const void AnalyseAudioJob::run () { - shared_ptr player = make_shared (_film, _playlist); + shared_ptr player (new Player (_film, _playlist)); player->set_ignore_video (); player->set_fast (); player->set_play_referenced (); diff --git a/src/lib/atmos_mxf_content.cc b/src/lib/atmos_mxf_content.cc index 870fca56e..f8cc05178 100644 --- a/src/lib/atmos_mxf_content.cc +++ b/src/lib/atmos_mxf_content.cc @@ -25,14 +25,12 @@ #include #include #include -#include #include "i18n.h" using std::list; using std::string; using boost::shared_ptr; -using boost::make_shared; AtmosMXFContent::AtmosMXFContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) @@ -50,7 +48,7 @@ bool AtmosMXFContent::valid_mxf (boost::filesystem::path path) { try { - shared_ptr a = make_shared (path); + shared_ptr a (new dcp::AtmosAsset (path)); return true; } catch (dcp::MXFFileError& e) { @@ -66,7 +64,7 @@ AtmosMXFContent::examine (shared_ptr job) { job->set_progress_unknown (); Content::examine (job); - shared_ptr a = make_shared (path(0)); + shared_ptr a (new dcp::AtmosAsset (path(0))); { boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc index b133dec3d..1863e38ee 100644 --- a/src/lib/audio_analysis.cc +++ b/src/lib/audio_analysis.cc @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -42,7 +41,6 @@ using std::cout; using std::max; using std::list; using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; AudioAnalysis::AudioAnalysis (int channels) @@ -114,7 +112,7 @@ AudioAnalysis::points (int c) const void AudioAnalysis::write (boost::filesystem::path filename) { - shared_ptr doc = make_shared (); + shared_ptr doc (new xmlpp::Document); xmlpp::Element* root = doc->create_root_node ("AudioAnalysis"); BOOST_FOREACH (vector& i, _data) { diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc index 4c3c2d4a7..2ab8e187e 100644 --- a/src/lib/audio_buffers.cc +++ b/src/lib/audio_buffers.cc @@ -20,7 +20,6 @@ #include "audio_buffers.h" #include "dcpomatic_assert.h" -#include #include #include #include @@ -28,7 +27,6 @@ using std::bad_alloc; using boost::shared_ptr; -using boost::make_shared; /** Construct an AudioBuffers. Audio data is undefined after this constructor. * @param channels Number of channels. @@ -307,7 +305,7 @@ AudioBuffers::apply_gain (float dB) shared_ptr AudioBuffers::channel (int c) const { - shared_ptr o = make_shared (1, frames ()); + shared_ptr o (new AudioBuffers (1, frames ())); o->copy_channel_from (this, c, 0); return o; } @@ -322,7 +320,7 @@ AudioBuffers::copy_channel_from (AudioBuffers const * from, int from_channel, in shared_ptr AudioBuffers::clone () const { - shared_ptr b = make_shared (channels (), frames ()); + shared_ptr b (new AudioBuffers (channels (), frames ())); b->copy_from (this, frames (), 0, 0); return b; } diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 57f878b71..7a4ca63a9 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -75,7 +75,6 @@ AudioContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) return shared_ptr (); } - /* Can't use make_shared here as the constructor is private */ return shared_ptr (new AudioContent (parent, node)); } diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index fa9fe9711..8c395cb89 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -23,7 +23,6 @@ #include "audio_decoder_stream.h" #include "audio_content.h" #include -#include #include #include "i18n.h" @@ -31,14 +30,13 @@ using std::cout; using std::map; using boost::shared_ptr; -using boost::make_shared; AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr content, bool fast, shared_ptr log) : _ignore (false) , _fast (fast) { BOOST_FOREACH (AudioStreamPtr i, content->streams ()) { - _streams[i] = make_shared (content, i, parent, fast, log); + _streams[i] = shared_ptr (new AudioDecoderStream (content, i, parent, fast, log)); } } diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index 527610cdf..1bfc65871 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -28,7 +28,6 @@ #include "log.h" #include "audio_content.h" #include "compose.hpp" -#include #include #include "i18n.h" @@ -40,7 +39,6 @@ using std::min; using std::max; using boost::optional; using boost::shared_ptr; -using boost::make_shared; AudioDecoderStream::AudioDecoderStream (shared_ptr content, AudioStreamPtr stream, Decoder* decoder, bool fast, shared_ptr log) : _content (content) @@ -58,7 +56,7 @@ AudioDecoderStream::AudioDecoderStream (shared_ptr content, void AudioDecoderStream::reset_decoded () { - _decoded = ContentAudio (make_shared (_stream->channels(), 0), 0); + _decoded = ContentAudio (shared_ptr (new AudioBuffers (_stream->channels(), 0)), 0); } ContentAudio @@ -120,7 +118,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate) Frame const to_return = max ((Frame) 0, min (available, length)); /* Copy our data to the output */ - shared_ptr out = make_shared (_decoded.audio->channels(), to_return); + shared_ptr out (new AudioBuffers (_decoded.audio->channels(), to_return)); out->copy_from (_decoded.audio.get(), to_return, decoded_offset, 0); Frame const remaining = max ((Frame) 0, available - to_return); @@ -159,7 +157,7 @@ AudioDecoderStream::audio (shared_ptr data, ContentTime time Frame const delta_frames = delta.frames_round (frame_rate); if (delta_frames > 0) { /* This data comes after the seek time. Pad the data with some silence. */ - shared_ptr padded = make_shared (data->channels(), data->frames() + delta_frames); + shared_ptr padded (new AudioBuffers (data->channels(), data->frames() + delta_frames)); padded->make_silent (); padded->copy_from (data.get(), data->frames(), 0, delta_frames); data = padded; @@ -174,7 +172,7 @@ AudioDecoderStream::audio (shared_ptr data, ContentTime time */ return; } - shared_ptr trimmed = make_shared (data->channels(), to_keep); + shared_ptr trimmed (new AudioBuffers (data->channels(), to_keep)); trimmed->copy_from (data.get(), to_keep, to_discard, 0); data = trimmed; time += ContentTime::from_frames (to_discard, frame_rate); diff --git a/src/lib/audio_delay.cc b/src/lib/audio_delay.cc index e33d9879b..893773ddd 100644 --- a/src/lib/audio_delay.cc +++ b/src/lib/audio_delay.cc @@ -21,12 +21,10 @@ #include "audio_delay.h" #include "audio_buffers.h" #include "dcpomatic_assert.h" -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; AudioDelay::AudioDelay (int samples) : _samples (samples) @@ -40,7 +38,7 @@ AudioDelay::run (shared_ptr in) /* You can't call this with varying channel counts */ DCPOMATIC_ASSERT (!_tail || in->channels() == _tail->channels()); - shared_ptr out = make_shared (in->channels(), in->frames()); + shared_ptr out (new AudioBuffers (in->channels(), in->frames())); if (in->frames() > _samples) { diff --git a/src/lib/audio_filter.cc b/src/lib/audio_filter.cc index 4203d074c..44345fc9d 100644 --- a/src/lib/audio_filter.cc +++ b/src/lib/audio_filter.cc @@ -20,12 +20,10 @@ #include "audio_filter.h" #include "audio_buffers.h" -#include #include using std::min; using boost::shared_ptr; -using boost::make_shared; /** @return array of floats which the caller must destroy with delete[] */ float * @@ -77,7 +75,7 @@ AudioFilter::~AudioFilter () shared_ptr AudioFilter::run (shared_ptr in) { - shared_ptr out = make_shared (in->channels(), in->frames()); + shared_ptr out (new AudioBuffers (in->channels(), in->frames())); if (!_tail) { _tail.reset (new AudioBuffers (in->channels(), _M + 1)); diff --git a/src/lib/audio_filter_graph.cc b/src/lib/audio_filter_graph.cc index f27befb03..87a158a4e 100644 --- a/src/lib/audio_filter_graph.cc +++ b/src/lib/audio_filter_graph.cc @@ -25,14 +25,12 @@ extern "C" { #include #include } -#include #include "i18n.h" using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; AudioFilterGraph::AudioFilterGraph (int sample_rate, int channels) : _sample_rate (sample_rate) @@ -115,7 +113,7 @@ AudioFilterGraph::process (shared_ptr buffers) the constructor) so we need to create new buffers with some extra silent channels. */ - shared_ptr extended_buffers = make_shared (process_channels, buffers->frames()); + shared_ptr extended_buffers (new AudioBuffers (process_channels, buffers->frames())); for (int i = 0; i < buffers->channels(); ++i) { extended_buffers->copy_channel_from (buffers.get(), i, i); } diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index 3f1750621..469cf2e6b 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -25,13 +25,11 @@ #include #include #include -#include #include using std::list; using std::string; using boost::shared_ptr; -using boost::make_shared; Cinema::Cinema (cxml::ConstNodePtr node) : name (node->string_child ("Name")) @@ -58,7 +56,7 @@ Cinema::read_screens (cxml::ConstNodePtr node) { list s = node->node_children ("Screen"); for (list::iterator i = s.begin(); i != s.end(); ++i) { - add_screen (make_shared (*i)); + add_screen (shared_ptr (new Screen (*i))); } } diff --git a/src/lib/cinema_kdms.cc b/src/lib/cinema_kdms.cc index b32da4d6e..84cd9c18f 100644 --- a/src/lib/cinema_kdms.cc +++ b/src/lib/cinema_kdms.cc @@ -29,7 +29,6 @@ #include "log.h" #include #include -#include #include "i18n.h" @@ -38,7 +37,6 @@ using std::cout; using std::string; using std::runtime_error; using boost::shared_ptr; -using boost::make_shared; void CinemaKDMs::make_zip_file (string film_name, boost::filesystem::path zip_file) const @@ -55,7 +53,7 @@ CinemaKDMs::make_zip_file (string film_name, boost::filesystem::path zip_file) c list > kdm_strings; BOOST_FOREACH (ScreenKDM const & i, screen_kdms) { - shared_ptr kdm = boost::make_shared (i.kdm.as_xml ()); + shared_ptr kdm (new string (i.kdm.as_xml ())); kdm_strings.push_back (kdm); struct zip_source* source = zip_source_buffer (zip, kdm->c_str(), kdm->length(), 0); diff --git a/src/lib/config.cc b/src/lib/config.cc index 8e1997325..891d832a2 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -56,7 +55,6 @@ using std::remove; using std::exception; using std::cerr; using boost::shared_ptr; -using boost::make_shared; using boost::optional; using boost::algorithm::trim; @@ -269,7 +267,7 @@ Config::read () cxml::NodePtr signer = f.optional_node_child ("Signer"); if (signer) { - shared_ptr c = make_shared (); + shared_ptr c (new dcp::CertificateChain ()); /* Read the signing certificates and private key in from the config file */ BOOST_FOREACH (cxml::NodePtr i, signer->node_children ("Certificate")) { c->add (dcp::Certificate (i->content ())); @@ -283,7 +281,7 @@ Config::read () cxml::NodePtr decryption = f.optional_node_child ("Decryption"); if (decryption) { - shared_ptr c = make_shared (); + shared_ptr c (new dcp::CertificateChain ()); BOOST_FOREACH (cxml::NodePtr i, decryption->node_children ("Certificate")) { c->add (dcp::Certificate (i->content ())); } @@ -561,7 +559,7 @@ Config::read_cinemas (cxml::Document const & f) /* Slightly grotty two-part construction of Cinema here so that we can use shared_from_this. */ - shared_ptr cinema = make_shared (*i); + shared_ptr cinema (new Cinema (*i)); cinema->read_screens (*i); _cinemas.push_back (cinema); } diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index dbbd65077..295f33b3c 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -48,7 +47,6 @@ using std::pair; using std::vector; using std::list; using boost::shared_ptr; -using boost::make_shared; using boost::scoped_ptr; using boost::optional; using boost::function; @@ -134,7 +132,7 @@ DCPContent::examine (shared_ptr job) job->set_progress_unknown (); Content::examine (job); - shared_ptr examiner = make_shared (shared_from_this ()); + shared_ptr examiner (new DCPExaminer (shared_from_this ())); video->take_from_examiner (examiner); set_default_colour_conversion (); diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 3bf7c1464..e7e88d319 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -43,14 +43,12 @@ #include #include #include -#include #include using std::list; using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; -using boost::make_shared; DCPDecoder::DCPDecoder (shared_ptr c, shared_ptr log, bool fast) : _dcp_content (c) @@ -96,15 +94,15 @@ DCPDecoder::pass (PassReason reason, bool) shared_ptr asset = (*_reel)->main_picture()->asset (); int64_t const entry_point = (*_reel)->main_picture()->entry_point (); if (_mono_reader) { - video->give (make_shared (_mono_reader->get_frame (entry_point + frame), asset->size()), _offset + frame); + video->give (shared_ptr (new J2KImageProxy (_mono_reader->get_frame (entry_point + frame), asset->size())), _offset + frame); } else { video->give ( - make_shared (_stereo_reader->get_frame (entry_point + frame), asset->size(), dcp::EYE_LEFT), + shared_ptr (new J2KImageProxy (_stereo_reader->get_frame (entry_point + frame), asset->size(), dcp::EYE_LEFT)), _offset + frame ); video->give ( - make_shared (_stereo_reader->get_frame (entry_point + frame), asset->size(), dcp::EYE_RIGHT), + shared_ptr (new J2KImageProxy (_stereo_reader->get_frame (entry_point + frame), asset->size(), dcp::EYE_RIGHT)), _offset + frame ); } @@ -117,7 +115,7 @@ DCPDecoder::pass (PassReason reason, bool) int const channels = _dcp_content->audio->stream()->channels (); int const frames = sf->size() / (3 * channels); - shared_ptr data = make_shared (channels, frames); + shared_ptr data (new AudioBuffers (channels, frames)); for (int i = 0; i < frames; ++i) { for (int j = 0; j < channels; ++j) { data->data()[j][i] = static_cast ((from[0] << 8) | (from[1] << 16) | (from[2] << 24)) / static_cast (INT_MAX - 256); diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index b361b9419..e7057efc4 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include "i18n.h" @@ -36,7 +35,6 @@ using std::string; using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; -using boost::make_shared; DCPSubtitleContent::DCPSubtitleContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) @@ -78,7 +76,7 @@ DCPSubtitleContent::examine (shared_ptr job) _length = ContentTime::from_seconds (sc->latest_subtitle_out().as_seconds ()); BOOST_FOREACH (shared_ptr i, sc->load_font_nodes ()) { - subtitle->add_font (boost::make_shared (i->id)); + subtitle->add_font (shared_ptr (new Font (i->id))); } } diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index 6d270dab2..be69f3eed 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -61,7 +60,6 @@ using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; using dcp::Size; using dcp::Data; @@ -160,7 +158,7 @@ DCPVideo::encode_remotely (EncodeServerDescription serv, int timeout) boost::asio::ip::tcp::resolver::query query (serv.host_name(), raw_convert (Config::instance()->server_port_base ())); boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query); - shared_ptr socket = make_shared (timeout); + shared_ptr socket (new Socket (timeout)); socket->connect (*endpoint_iterator); diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index ec0140b0c..dc01a043a 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -31,44 +31,42 @@ #include "video_mxf_content.h" #include "video_mxf_decoder.h" #include -#include using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; -using boost::make_shared; shared_ptr decoder_factory (shared_ptr content, shared_ptr log, bool fast) { shared_ptr fc = dynamic_pointer_cast (content); if (fc) { - return make_shared (fc, log, fast); + return shared_ptr (new FFmpegDecoder (fc, log, fast)); } shared_ptr dc = dynamic_pointer_cast (content); if (dc) { - return make_shared (dc, log, fast); + return shared_ptr (new DCPDecoder (dc, log, fast)); } shared_ptr ic = dynamic_pointer_cast (content); if (ic) { - return make_shared (ic, log); + return shared_ptr (new ImageDecoder (ic, log)); } shared_ptr rc = dynamic_pointer_cast (content); if (rc) { - return make_shared (rc); + return shared_ptr (new TextSubtitleDecoder (rc)); } shared_ptr dsc = dynamic_pointer_cast (content); if (dsc) { - return make_shared (dsc); + return shared_ptr (new DCPSubtitleDecoder (dsc)); } shared_ptr vmc = dynamic_pointer_cast (content); if (vmc) { - return make_shared (vmc, log); + return shared_ptr (new VideoMXFDecoder (vmc, log)); } return shared_ptr (); diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index 635913cc2..f318da03b 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -64,7 +63,6 @@ using boost::thread; using boost::bind; using boost::scoped_array; using boost::optional; -using boost::make_shared; using dcp::Size; using dcp::Data; @@ -110,7 +108,7 @@ EncodeServer::process (shared_ptr socket, struct timeval& after_read, st socket->read (reinterpret_cast (buffer.get()), length); string s (buffer.get()); - shared_ptr xml = make_shared ("EncodingRequest"); + shared_ptr xml (new cxml::Document ("EncodingRequest")); xml->read_string (s); /* This is a double-check; the server shouldn't even be on the candidate list if it is the wrong version, but it doesn't hurt to make sure here. @@ -121,7 +119,7 @@ EncodeServer::process (shared_ptr socket, struct timeval& after_read, st return -1; } - shared_ptr pvf = make_shared (xml, socket); + shared_ptr pvf (new PlayerVideo (xml, socket)); DCPVideo dcp_video_frame (pvf, xml, _log); @@ -266,7 +264,7 @@ EncodeServer::broadcast_received () if (_verbose) { cout << "Offering services to master " << _broadcast.send_endpoint.address().to_string () << "\n"; } - shared_ptr socket = make_shared (); + shared_ptr socket (new Socket); try { socket->connect (boost::asio::ip::tcp::endpoint (_broadcast.send_endpoint.address(), Config::instance()->server_port_base() + 1)); socket->write (xml.length() + 1); diff --git a/src/lib/encode_server_finder.cc b/src/lib/encode_server_finder.cc index a017a0af1..7491d9ef7 100644 --- a/src/lib/encode_server_finder.cc +++ b/src/lib/encode_server_finder.cc @@ -28,7 +28,6 @@ #include "raw_convert.h" #include #include -#include #include #include "i18n.h" @@ -40,7 +39,6 @@ using std::cout; using boost::shared_ptr; using boost::scoped_array; using boost::weak_ptr; -using boost::make_shared; EncodeServerFinder* EncodeServerFinder::_instance = 0; @@ -153,7 +151,7 @@ catch (...) void EncodeServerFinder::start_accept () { - shared_ptr socket = make_shared (); + shared_ptr socket (new Socket ()); _listen_acceptor->async_accept ( socket->socket(), boost::bind (&EncodeServerFinder::handle_accept, this, boost::asio::placeholders::error, socket) @@ -176,7 +174,7 @@ EncodeServerFinder::handle_accept (boost::system::error_code ec, shared_ptrread (reinterpret_cast (buffer.get()), length); string s (buffer.get()); - shared_ptr xml = make_shared ("ServerAvailable"); + shared_ptr xml (new cxml::Document ("ServerAvailable")); xml->read_string (s); string const ip = socket->socket().remote_endpoint().address().to_string (); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index f3a4c4c4f..b34fdf6aa 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -42,7 +42,6 @@ extern "C" { } #include #include -#include #include #include "i18n.h" @@ -57,7 +56,6 @@ using std::pair; using std::make_pair; using std::max; using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; using boost::optional; @@ -80,7 +78,7 @@ FFmpegContent::FFmpegContent (shared_ptr film, cxml::ConstNodePtr no list c = node->node_children ("SubtitleStream"); for (list::const_iterator i = c.begin(); i != c.end(); ++i) { - _subtitle_streams.push_back (make_shared (*i, version)); + _subtitle_streams.push_back (shared_ptr (new FFmpegSubtitleStream (*i, version))); if ((*i)->optional_number_child ("Selected")) { _subtitle_stream = _subtitle_streams.back (); } @@ -88,7 +86,7 @@ FFmpegContent::FFmpegContent (shared_ptr film, cxml::ConstNodePtr no c = node->node_children ("AudioStream"); for (list::const_iterator i = c.begin(); i != c.end(); ++i) { - shared_ptr as = make_shared (*i, version); + shared_ptr as (new FFmpegAudioStream (*i, version)); audio->add_stream (as); if (version < 11 && !(*i)->optional_node_child ("Selected")) { /* This is an old file and this stream is not selected, so un-map it */ @@ -212,7 +210,7 @@ FFmpegContent::examine (shared_ptr job) Content::examine (job); - shared_ptr examiner = make_shared (shared_from_this (), job); + shared_ptr examiner (new FFmpegExaminer (shared_from_this (), job)); if (examiner->has_video ()) { video.reset (new VideoContent (this)); diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 69ed7ac12..df6b7416b 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -50,7 +50,6 @@ extern "C" { } #include #include -#include #include #include #include @@ -72,7 +71,6 @@ using std::pair; using std::max; using std::map; using boost::shared_ptr; -using boost::make_shared; using boost::is_any_of; using boost::split; using dcp::Size; @@ -177,7 +175,7 @@ FFmpegDecoder::deinterleave_audio (shared_ptr stream) const */ int const total_samples = size / bytes_per_audio_sample (stream); int const frames = total_samples / stream->channels(); - shared_ptr audio = make_shared (stream->channels(), frames); + shared_ptr audio (new AudioBuffers (stream->channels(), frames)); switch (audio_sample_format (stream)) { case AV_SAMPLE_FMT_U8: @@ -454,7 +452,7 @@ FFmpegDecoder::decode_video_packet () if (i->second != AV_NOPTS_VALUE) { double const pts = i->second * av_q2d (_format_context->streams[_video_stream.get()]->time_base) + _pts_offset.seconds (); video->give ( - make_shared (image), + shared_ptr (new RawImageProxy (image)), llrint (pts * _ffmpeg_content->active_video_frame_rate ()) ); } else { @@ -534,7 +532,7 @@ FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTimeP /* Note RGBA is expressed little-endian, so the first byte in the word is R, second G, third B, fourth A. */ - shared_ptr image = make_shared (AV_PIX_FMT_RGBA, dcp::Size (rect->w, rect->h), true); + shared_ptr image (new Image (AV_PIX_FMT_RGBA, dcp::Size (rect->w, rect->h), true)); #ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT /* Start of the first line in the subtitle */ diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 2e48810b1..18a87f40e 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -32,7 +32,6 @@ extern "C" { #include "util.h" #include "safe_stringstream.h" #include -#include #include #include "i18n.h" @@ -41,7 +40,6 @@ using std::string; using std::cout; using std::max; using boost::shared_ptr; -using boost::make_shared; using boost::optional; /** @param job job that the examiner is operating in, or 0 */ @@ -82,7 +80,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptrcodec->codec_type == AVMEDIA_TYPE_SUBTITLE) { - _subtitle_streams.push_back (boost::make_shared (subtitle_stream_name (s), s->id)); + _subtitle_streams.push_back (shared_ptr (new FFmpegSubtitleStream (subtitle_stream_name (s), s->id))); } } diff --git a/src/lib/film.cc b/src/lib/film.cc index 3378b2042..3cd3f0f21 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -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); @@ -320,21 +318,21 @@ Film::make_dcp () throw MissingSettingError (_("name")); } - JobManager::instance()->add (make_shared (shared_from_this())); + JobManager::instance()->add (shared_ptr (new TranscodeJob (shared_from_this()))); } /** Start a job to send our DCP to the configured TMS */ void Film::send_dcp_to_tms () { - shared_ptr j = make_shared (shared_from_this()); + shared_ptr j (new UploadJob (shared_from_this())); JobManager::instance()->add (j); } shared_ptr Film::metadata () const { - shared_ptr doc = make_shared (); + shared_ptr doc (new xmlpp::Document); xmlpp::Element* root = doc->create_root_node ("Metadata"); root->add_child("Version")->add_child_text (raw_convert (current_state_version)); @@ -1005,7 +1003,7 @@ Film::content () const void Film::examine_content (shared_ptr c) { - shared_ptr j = make_shared (shared_from_this(), c); + shared_ptr j (new ExamineContentJob (shared_from_this(), c)); JobManager::instance()->add (j); } @@ -1016,7 +1014,7 @@ Film::examine_and_add_content (shared_ptr c) run_ffprobe (c->path(0), file ("ffprobe.log"), _log); } - shared_ptr j = make_shared (shared_from_this(), c); + shared_ptr j (new ExamineContentJob (shared_from_this(), c)); _job_connections.push_back ( j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr (j), weak_ptr (c))) @@ -1040,7 +1038,7 @@ Film::maybe_add_content (weak_ptr j, weak_ptr c) add_content (content); if (Config::instance()->automatic_audio_analysis() && content->audio) { - shared_ptr playlist = make_shared (); + shared_ptr playlist (new Playlist); playlist->add (content); boost::signals2::connection c; JobManager::instance()->analyse_audio ( @@ -1182,7 +1180,7 @@ Film::make_kdm ( dcp::Formulation formulation ) const { - shared_ptr cpl = make_shared (cpl_file); + shared_ptr cpl (new dcp::CPL (cpl_file)); shared_ptr signer = Config::instance()->signer_chain (); if (!signer->valid ()) { throw InvalidSignerError (); diff --git a/src/lib/image.cc b/src/lib/image.cc index 1107f0a40..71a3a5bcc 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -34,7 +34,6 @@ extern "C" { #include #include } -#include #include #include "i18n.h" @@ -46,7 +45,6 @@ using std::cerr; using std::list; using std::runtime_error; using boost::shared_ptr; -using boost::make_shared; using dcp::Size; int @@ -151,7 +149,7 @@ Image::crop_scale_window ( To get around this, we ask Image to overallocate its buffers by the overrun. */ - shared_ptr out = make_shared (out_format, out_size, out_aligned, (out_size.width - inter_size.width) / 2); + shared_ptr out (new Image (out_format, out_size, out_aligned, (out_size.width - inter_size.width) / 2)); out->make_black (); /* Size of the image after any crop */ @@ -229,7 +227,7 @@ Image::scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_fo */ DCPOMATIC_ASSERT (aligned ()); - shared_ptr scaled = make_shared (out_format, out_size, out_aligned); + shared_ptr scaled (new Image (out_format, out_size, out_aligned)); struct SwsContext* scale_context = sws_getContext ( size().width, size().height, pixel_format(), @@ -821,7 +819,7 @@ merge (list images) all.extend (dcpomatic::Rect (i->position, i->image->size().width, i->image->size().height)); } - shared_ptr merged = make_shared (images.front().image->pixel_format (), dcp::Size (all.width, all.height), true); + shared_ptr merged (new Image (images.front().image->pixel_format (), dcp::Size (all.width, all.height), true)); merged->make_transparent (); for (list::const_iterator i = images.begin(); i != images.end(); ++i) { merged->alpha_blend (i->image, i->position - all.position()); diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index ca8bd380f..d4e736771 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -40,7 +39,6 @@ using std::string; using std::cout; using std::list; using boost::shared_ptr; -using boost::make_shared; ImageContent::ImageContent (shared_ptr film, boost::filesystem::path p) : Content (film) @@ -121,7 +119,7 @@ ImageContent::examine (shared_ptr job) shared_ptr film = _film.lock (); DCPOMATIC_ASSERT (film); - shared_ptr examiner = make_shared (film, shared_from_this(), job); + shared_ptr examiner (new ImageExaminer (film, shared_from_this(), job)); video->take_from_examiner (examiner); set_default_colour_conversion (); } diff --git a/src/lib/image_proxy.cc b/src/lib/image_proxy.cc index 69c296605..3a09cb8e8 100644 --- a/src/lib/image_proxy.cc +++ b/src/lib/image_proxy.cc @@ -27,7 +27,6 @@ #include "cross.h" #include #include -#include #include #include "i18n.h" @@ -35,17 +34,16 @@ using std::cout; using std::string; using boost::shared_ptr; -using boost::make_shared; shared_ptr image_proxy_factory (shared_ptr xml, shared_ptr socket) { if (xml->string_child("Type") == N_("Raw")) { - return make_shared (xml, socket); + return shared_ptr (new RawImageProxy (xml, socket)); } else if (xml->string_child("Type") == N_("Magick")) { - return make_shared (xml, socket); + return shared_ptr (new MagickImageProxy (xml, socket)); } else if (xml->string_child("Type") == N_("J2K")) { - return make_shared (xml, socket); + return shared_ptr (new J2KImageProxy (xml, socket)); } throw NetworkError (_("Unexpected image type received by server")); diff --git a/src/lib/j2k_image_proxy.cc b/src/lib/j2k_image_proxy.cc index 35d70162c..44b5ebea7 100644 --- a/src/lib/j2k_image_proxy.cc +++ b/src/lib/j2k_image_proxy.cc @@ -30,7 +30,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -40,7 +39,6 @@ using std::cout; using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; -using boost::make_shared; using dcp::Data; /** Construct a J2KImageProxy from a JPEG2000 file */ @@ -109,7 +107,7 @@ J2KImageProxy::image (optional) const } } - shared_ptr image = make_shared (pixel_format(), _size, true); + shared_ptr image (new Image (pixel_format(), _size, true)); /* Copy data in whatever format (sRGB or XYZ) into our Image; I'm assuming the data is 12-bit either way. diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc index 6e53f9819..0006201e6 100644 --- a/src/lib/json_server.cc +++ b/src/lib/json_server.cc @@ -27,7 +27,6 @@ #include "util.h" #include "film.h" #include "transcode_job.h" -#include #include using std::string; @@ -36,7 +35,6 @@ using std::map; using std::list; using boost::thread; using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; using boost::asio::ip::tcp; @@ -63,7 +61,7 @@ try tcp::acceptor a (io_service, tcp::endpoint (tcp::v4 (), port)); while (true) { try { - shared_ptr s = make_shared (io_service); + shared_ptr s (new tcp::socket (io_service)); a.accept (*s); handle (s); } diff --git a/src/lib/log.cc b/src/lib/log.cc index 769852044..b7edd4e29 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -27,7 +27,6 @@ #include "config.h" #include "safe_stringstream.h" #include "string_log_entry.h" -#include #include #include @@ -36,7 +35,6 @@ using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; Log::Log () : _types (0) @@ -73,7 +71,7 @@ Log::log (string message, int type) return; } - shared_ptr e = boost::make_shared (type, message); + shared_ptr e (new StringLogEntry (type, message)); do_log (e); } @@ -83,13 +81,13 @@ Log::dcp_log (dcp::NoteType type, string m) { switch (type) { case dcp::DCP_PROGRESS: - do_log (boost::make_shared (LogEntry::TYPE_GENERAL, m)); + do_log (shared_ptr (new StringLogEntry (LogEntry::TYPE_GENERAL, m))); break; case dcp::DCP_ERROR: - do_log (boost::make_shared (LogEntry::TYPE_ERROR, m)); + do_log (shared_ptr (new StringLogEntry (LogEntry::TYPE_ERROR, m))); break; case dcp::DCP_NOTE: - do_log (boost::make_shared (LogEntry::TYPE_WARNING, m)); + do_log (shared_ptr (new StringLogEntry (LogEntry::TYPE_WARNING, m))); break; } } diff --git a/src/lib/mid_side_decoder.cc b/src/lib/mid_side_decoder.cc index 8d5dc1875..b9b8dd098 100644 --- a/src/lib/mid_side_decoder.cc +++ b/src/lib/mid_side_decoder.cc @@ -21,7 +21,6 @@ #include "mid_side_decoder.h" #include "audio_buffers.h" #include "audio_mapping.h" -#include #include "i18n.h" @@ -29,7 +28,6 @@ using std::string; using std::min; using std::vector; using boost::shared_ptr; -using boost::make_shared; string MidSideDecoder::name () const @@ -52,14 +50,14 @@ MidSideDecoder::out_channels () const shared_ptr MidSideDecoder::clone (int) const { - return make_shared (); + return shared_ptr (new MidSideDecoder ()); } shared_ptr MidSideDecoder::run (shared_ptr in, int channels) { int const N = min (channels, 3); - shared_ptr out = make_shared (channels, in->frames ()); + shared_ptr out (new AudioBuffers (channels, in->frames ())); for (int i = 0; i < in->frames(); ++i) { float const left = in->data()[0][i]; float const right = in->data()[1][i]; diff --git a/src/lib/player.cc b/src/lib/player.cc index 1d3e22e20..30313d39d 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -72,7 +71,6 @@ using std::map; using std::make_pair; using std::copy; using boost::shared_ptr; -using boost::make_shared; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; @@ -141,7 +139,7 @@ Player::setup_pieces () decoder->audio->set_ignore (); } - _pieces.push_back (make_shared (i, decoder, frc)); + _pieces.push_back (shared_ptr (new Piece (i, decoder, frc))); } _have_valid_pieces = true; @@ -280,7 +278,7 @@ Player::black_player_video_frame (DCPTime time) const { return shared_ptr ( new PlayerVideo ( - make_shared (_black_image), + shared_ptr (new RawImageProxy (_black_image)), time, Crop (), optional (), @@ -415,7 +413,7 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) Frame const length_frames = length.frames_round (_film->audio_frame_rate ()); - shared_ptr audio = make_shared (_film->audio_channels(), length_frames); + shared_ptr audio (new AudioBuffers (_film->audio_channels(), length_frames)); audio->make_silent (); list > ov = overlaps (time, time + length, has_audio); @@ -472,13 +470,13 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) /* Gain */ if (i->content->audio->gain() != 0) { - shared_ptr gain = make_shared (all.audio); + shared_ptr gain (new AudioBuffers (all.audio)); gain->apply_gain (i->content->audio->gain ()); all.audio = gain; } /* Remap channels */ - shared_ptr dcp_mapped = make_shared (_film->audio_channels(), all.audio->frames()); + shared_ptr dcp_mapped (new AudioBuffers (_film->audio_channels(), all.audio->frames())); dcp_mapped->make_silent (); AudioMapping map = j->mapping (); for (int i = 0; i < map.input_channels(); ++i) { diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index eff5c48ee..e6533d2cc 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -42,7 +42,6 @@ #include #include #include -#include #include "i18n.h" @@ -55,7 +54,6 @@ using std::list; using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; using boost::optional; using boost::dynamic_pointer_cast; using dcp::Data; @@ -305,7 +303,7 @@ ReelWriter::finish () shared_ptr ReelWriter::create_reel (list const & refs, list > const & fonts) { - shared_ptr reel = make_shared (); + shared_ptr reel (new dcp::Reel ()); shared_ptr reel_picture_asset; @@ -338,7 +336,7 @@ ReelWriter::create_reel (list const & refs, listadd (make_shared (_sound_asset, 0)); + reel->add (shared_ptr (new dcp::ReelSoundAsset (_sound_asset, 0))); } else { /* We don't have a sound asset of our own; hopefully we have one to reference */ BOOST_FOREACH (ReferencedReelAsset j, refs) { @@ -462,13 +460,13 @@ ReelWriter::write (PlayerSubtitles subs) lang = "Unknown"; } if (_film->interop ()) { - shared_ptr s = make_shared (); + shared_ptr s (new dcp::InteropSubtitleAsset ()); s->set_movie_title (_film->name ()); s->set_language (lang); s->set_reel_number ("1"); _subtitle_asset = s; } else { - shared_ptr s = make_shared (); + shared_ptr s (new dcp::SMPTESubtitleAsset ()); s->set_content_title_text (_film->name ()); s->set_language (lang); s->set_edit_rate (dcp::Fraction (_film->video_frame_rate (), 1)); diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc index 94a6b837b..76aa09229 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_subtitles.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include using std::list; @@ -40,7 +39,6 @@ using std::pair; using std::cerr; using std::make_pair; using boost::shared_ptr; -using boost::make_shared; using boost::optional; static FcConfig* fc_config = 0; @@ -82,7 +80,7 @@ render_line (list subtitles, list > fonts, /* ...and add a bit more for luck */ height += target.height / 11; - shared_ptr image = make_shared (AV_PIX_FMT_RGBA, dcp::Size (target.width, height), false); + shared_ptr image (new Image (AV_PIX_FMT_RGBA, dcp::Size (target.width, height), false)); image->make_black (); #ifdef DCPOMATIC_HAVE_FORMAT_STRIDE_FOR_WIDTH diff --git a/src/lib/resampler.cc b/src/lib/resampler.cc index 4476d9f1f..db5552d15 100644 --- a/src/lib/resampler.cc +++ b/src/lib/resampler.cc @@ -24,7 +24,6 @@ #include "compose.hpp" #include "dcpomatic_assert.h" #include -#include #include #include "i18n.h" @@ -34,7 +33,6 @@ using std::pair; using std::make_pair; using std::runtime_error; using boost::shared_ptr; -using boost::make_shared; /** @param in Input sampling rate (Hz) * @param out Output sampling rate (Hz) @@ -64,7 +62,7 @@ Resampler::run (shared_ptr in) int in_frames = in->frames (); int in_offset = 0; int out_offset = 0; - shared_ptr resampled = make_shared (_channels, 0); + shared_ptr resampled (new AudioBuffers (_channels, 0)); while (in_frames > 0) { @@ -138,7 +136,7 @@ Resampler::run (shared_ptr in) shared_ptr Resampler::flush () { - shared_ptr out = make_shared (_channels, 0); + shared_ptr out (new AudioBuffers (_channels, 0)); int out_offset = 0; int64_t const output_size = 65536; diff --git a/src/lib/server.cc b/src/lib/server.cc index d90ec9116..09e0a4bd0 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -20,12 +20,10 @@ #include "server.h" #include "dcpomatic_socket.h" -#include #include "i18n.h" using boost::shared_ptr; -using boost::make_shared; Server::Server (int port) : _terminate (false) @@ -58,7 +56,7 @@ Server::start_accept () } } - shared_ptr socket = make_shared (); + shared_ptr socket (new Socket); _acceptor.async_accept (socket->socket (), boost::bind (&Server::handle_accept, this, socket, boost::asio::placeholders::error)); } diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc index 9fd49831f..5b3b453b6 100644 --- a/src/lib/subtitle_content.cc +++ b/src/lib/subtitle_content.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -38,7 +37,6 @@ using std::vector; using std::cout; using std::list; using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; int const SubtitleContentProperty::X_OFFSET = 500; @@ -86,7 +84,6 @@ SubtitleContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version return shared_ptr (); } - /* Can't use make_shared here as the constructor is private */ return shared_ptr (new SubtitleContent (parent, node, version)); } @@ -133,7 +130,7 @@ SubtitleContent::SubtitleContent (Content* parent, cxml::ConstNodePtr node, int list fonts = node->node_children ("Font"); for (list::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { - _fonts.push_back (make_shared (*i)); + _fonts.push_back (shared_ptr (new Font (*i))); } connect_to_fonts (); diff --git a/src/lib/text_subtitle_content.cc b/src/lib/text_subtitle_content.cc index ea56ac7bb..24a328d08 100644 --- a/src/lib/text_subtitle_content.cc +++ b/src/lib/text_subtitle_content.cc @@ -26,7 +26,6 @@ #include "raw_convert.h" #include "subtitle_content.h" #include -#include #include #include "i18n.h" @@ -34,7 +33,6 @@ using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; TextSubtitleContent::TextSubtitleContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) @@ -60,7 +58,7 @@ TextSubtitleContent::examine (boost::shared_ptr job) boost::mutex::scoped_lock lm (_mutex); _length = s.length (); - subtitle->add_font (make_shared (TEXT_FONT_ID)); + subtitle->add_font (shared_ptr (new Font (TEXT_FONT_ID))); } string diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index 5e41253b8..7144f70d5 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -30,7 +30,6 @@ #include "log.h" #include "safe_stringstream.h" #include "compose.hpp" -#include #include #include @@ -45,7 +44,6 @@ using std::fixed; using std::setprecision; using std::cout; using boost::shared_ptr; -using boost::make_shared; /** @param s Film to use. */ @@ -92,7 +90,7 @@ TranscodeJob::run () _transcoder.reset (); if (_film->upload_after_make_dcp ()) { - shared_ptr job = make_shared (_film); + shared_ptr job (new UploadJob (_film)); JobManager::instance()->add (job); } diff --git a/src/lib/upmixer_a.cc b/src/lib/upmixer_a.cc index e390487d4..a1221e5ac 100644 --- a/src/lib/upmixer_a.cc +++ b/src/lib/upmixer_a.cc @@ -21,7 +21,6 @@ #include "upmixer_a.h" #include "audio_buffers.h" #include "audio_mapping.h" -#include #include "i18n.h" @@ -29,7 +28,6 @@ using std::string; using std::min; using std::vector; using boost::shared_ptr; -using boost::make_shared; UpmixerA::UpmixerA (int sampling_rate) : _left (0.02, 1900.0 / sampling_rate, 4800.0 / sampling_rate) @@ -63,7 +61,7 @@ UpmixerA::out_channels () const shared_ptr UpmixerA::clone (int sampling_rate) const { - return make_shared (sampling_rate); + return shared_ptr (new UpmixerA (sampling_rate)); } shared_ptr @@ -87,7 +85,7 @@ UpmixerA::run (shared_ptr in, int channels) all_out.push_back (_ls.run (in_L)); all_out.push_back (_rs.run (in_R)); - shared_ptr out = make_shared (channels, in->frames ()); + shared_ptr out (new AudioBuffers (channels, in->frames ())); int const N = min (channels, 6); for (int i = 0; i < N; ++i) { diff --git a/src/lib/upmixer_b.cc b/src/lib/upmixer_b.cc index 65452424a..90e1267cd 100644 --- a/src/lib/upmixer_b.cc +++ b/src/lib/upmixer_b.cc @@ -21,7 +21,6 @@ #include "upmixer_b.h" #include "audio_buffers.h" #include "audio_mapping.h" -#include #include "i18n.h" @@ -29,7 +28,6 @@ using std::string; using std::min; using std::vector; using boost::shared_ptr; -using boost::make_shared; UpmixerB::UpmixerB (int sampling_rate) : _lfe (0.01, 150.0 / sampling_rate) @@ -60,13 +58,13 @@ UpmixerB::out_channels () const shared_ptr UpmixerB::clone (int sampling_rate) const { - return make_shared (sampling_rate); + return shared_ptr (new UpmixerB (sampling_rate)); } shared_ptr UpmixerB::run (shared_ptr in, int channels) { - shared_ptr out = make_shared (channels, in->frames()); + shared_ptr out (new AudioBuffers (channels, in->frames())); /* L + R minus 6dB (in terms of amplitude) */ shared_ptr in_LR = in->channel(0); @@ -96,7 +94,7 @@ UpmixerB::run (shared_ptr in, int channels) shared_ptr S; if (channels > 4) { /* Ls is L - R with some delay */ - shared_ptr sub = make_shared (1, in->frames()); + shared_ptr sub (new AudioBuffers (1, in->frames())); sub->copy_channel_from (in.get(), 0, 0); float* p = sub->data (0); float const * q = in->data (1); diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index ae6cb64dd..a59e9669d 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -83,7 +83,6 @@ VideoContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) return shared_ptr (); } - /* Can't use make_shared here as the constructor is private */ return shared_ptr (new VideoContent (parent, node, version)); } diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index fbc8de9ae..edc746010 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -25,7 +25,6 @@ #include "log.h" #include "compose.hpp" #include -#include #include #include "i18n.h" @@ -35,7 +34,6 @@ using std::list; using std::max; using std::back_inserter; using boost::shared_ptr; -using boost::make_shared; using boost::optional; VideoDecoder::VideoDecoder (Decoder* parent, shared_ptr c, shared_ptr log) @@ -168,7 +166,7 @@ VideoDecoder::fill_one_eye (Frame from, Frame to, Eyes eye) } /* Fill with black... */ - shared_ptr filler_image = make_shared (_black_image); + shared_ptr filler_image (new RawImageProxy (_black_image)); Part filler_part = PART_WHOLE; /* ...unless there's some video we can fill with */ @@ -194,8 +192,8 @@ void VideoDecoder::fill_both_eyes (VideoFrame from, VideoFrame to) { /* Fill with black... */ - shared_ptr filler_left_image = make_shared (_black_image); - shared_ptr filler_right_image = make_shared (_black_image); + shared_ptr filler_left_image (new RawImageProxy (_black_image)); + shared_ptr filler_right_image (new RawImageProxy (_black_image)); Part filler_left_part = PART_WHOLE; Part filler_right_part = PART_WHOLE; diff --git a/src/lib/video_filter_graph.cc b/src/lib/video_filter_graph.cc index b6b3c2668..201150560 100644 --- a/src/lib/video_filter_graph.cc +++ b/src/lib/video_filter_graph.cc @@ -25,7 +25,6 @@ extern "C" { #include #include } -#include #include "i18n.h" @@ -35,7 +34,6 @@ using std::vector; using std::string; using std::make_pair; using boost::shared_ptr; -using boost::make_shared; VideoFilterGraph::VideoFilterGraph (dcp::Size s, AVPixelFormat p) : _size (s) @@ -53,7 +51,7 @@ VideoFilterGraph::process (AVFrame* frame) list, int64_t> > images; if (_copy) { - images.push_back (make_pair (make_shared (frame), av_frame_get_best_effort_timestamp (frame))); + images.push_back (make_pair (shared_ptr (new Image (frame)), av_frame_get_best_effort_timestamp (frame))); } else { int r = av_buffersrc_write_frame (_buffer_src_context, frame); if (r < 0) { @@ -65,7 +63,7 @@ VideoFilterGraph::process (AVFrame* frame) break; } - images.push_back (make_pair (make_shared (_frame), av_frame_get_best_effort_timestamp (_frame))); + images.push_back (make_pair (shared_ptr (new Image (_frame)), av_frame_get_best_effort_timestamp (_frame))); av_frame_unref (_frame); } } @@ -119,3 +117,4 @@ VideoFilterGraph::sink_name () const { return "buffersink"; } + diff --git a/src/lib/video_mxf_content.cc b/src/lib/video_mxf_content.cc index f5fab485e..d86fc4cf6 100644 --- a/src/lib/video_mxf_content.cc +++ b/src/lib/video_mxf_content.cc @@ -28,14 +28,12 @@ #include #include #include -#include #include "i18n.h" using std::list; using std::string; using boost::shared_ptr; -using boost::make_shared; VideoMXFContent::VideoMXFContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) @@ -53,7 +51,7 @@ bool VideoMXFContent::valid_mxf (boost::filesystem::path path) { try { - shared_ptr mp = make_shared (path); + shared_ptr mp (new dcp::MonoPictureAsset (path)); return true; } catch (dcp::MXFFileError& e) { @@ -62,7 +60,7 @@ VideoMXFContent::valid_mxf (boost::filesystem::path path) } try { - shared_ptr sp = make_shared (path); + shared_ptr sp (new dcp::StereoPictureAsset (path)); return true; } catch (dcp::MXFFileError& e) { @@ -81,7 +79,7 @@ VideoMXFContent::examine (shared_ptr job) Content::examine (job); video.reset (new VideoContent (this)); - shared_ptr examiner = make_shared (shared_from_this ()); + shared_ptr examiner (new VideoMXFExaminer (shared_from_this ())); video->take_from_examiner (examiner); } diff --git a/src/lib/video_mxf_decoder.cc b/src/lib/video_mxf_decoder.cc index 24f5c31ea..938d7deaf 100644 --- a/src/lib/video_mxf_decoder.cc +++ b/src/lib/video_mxf_decoder.cc @@ -27,10 +27,8 @@ #include #include #include -#include using boost::shared_ptr; -using boost::make_shared; VideoMXFDecoder::VideoMXFDecoder (shared_ptr content, shared_ptr log) : _content (content) @@ -79,10 +77,10 @@ VideoMXFDecoder::pass (PassReason, bool) } if (_mono_reader) { - video->give (make_shared (_mono_reader->get_frame(frame), _size), frame); + video->give (shared_ptr (new J2KImageProxy (_mono_reader->get_frame(frame), _size)), frame); } else { - video->give (make_shared (_stereo_reader->get_frame(frame), _size, dcp::EYE_LEFT), frame); - video->give (make_shared (_stereo_reader->get_frame(frame), _size, dcp::EYE_RIGHT), frame); + video->give (shared_ptr (new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_LEFT)), frame); + video->give (shared_ptr (new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::EYE_RIGHT)), frame); } _next += ContentTime::from_frames (1, vfr); diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 6c789632a..6b1d4d260 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -72,7 +72,6 @@ #endif #include #include -#include #include #include #include @@ -94,7 +93,6 @@ using std::exception; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; -using boost::make_shared; class FilmChangedDialog : public boost::noncopyable { @@ -277,7 +275,7 @@ public: void new_film (boost::filesystem::path path) { - shared_ptr film = make_shared (path); + shared_ptr film (new Film (path)); film->write_metadata (); film->set_name (path.filename().generic_string()); set_film (film); @@ -286,7 +284,7 @@ public: void load_film (boost::filesystem::path file) try { - shared_ptr film = make_shared (file); + shared_ptr film (new Film (file)); list const notes = film->read_metadata (); if (film->state_version() == 4) { @@ -492,14 +490,14 @@ private: ); } else { JobManager::instance()->add ( - boost::make_shared ( - _film->name(), - _film->dcp_name(), - d->from(), - d->until(), - CinemaKDMs::collect (screen_kdms), - _film->log() - ) + shared_ptr (new SendKDMEmailJob ( + _film->name(), + _film->dcp_name(), + d->from(), + d->until(), + CinemaKDMs::collect (screen_kdms), + _film->log() + )) ); } } catch (dcp::NotEncryptedError& e) { diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 3570dda08..a112e457a 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -36,14 +36,12 @@ #include #include #include -#include #include using std::exception; using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; using boost::thread; using boost::scoped_array; @@ -130,7 +128,7 @@ public: void start_job (boost::filesystem::path path) { try { - shared_ptr film = make_shared (path); + shared_ptr film (new Film (path)); film->read_metadata (); film->make_dcp (); } catch (std::exception& e) { diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 3697b4e8b..fd950807c 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -31,7 +31,6 @@ #include "lib/video_content.h" #include #include -#include #include #include #include @@ -44,7 +43,6 @@ using std::cerr; using std::list; using std::exception; using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; static void @@ -208,7 +206,7 @@ main (int argc, char* argv[]) } try { - shared_ptr film = make_shared (output, false); + shared_ptr film (new Film (output, false)); film->set_name (name); film->set_container (container_ratio); diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index eb44b4997..c686a974d 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -51,7 +51,6 @@ #endif #include #include -#include #ifdef check #undef check @@ -62,7 +61,6 @@ using std::list; using std::string; using std::vector; using boost::shared_ptr; -using boost::make_shared; using boost::bind; enum { @@ -303,13 +301,13 @@ private: if (film_name.empty ()) { film_name = decrypted.content_title_text (); } - shared_ptr job = boost::make_shared ( - film_name, - decrypted.content_title_text(), - _timing->from(), _timing->until(), - CinemaKDMs::collect (screen_kdms), - shared_ptr () - ); + shared_ptr job (new SendKDMEmailJob ( + film_name, + decrypted.content_title_text(), + _timing->from(), _timing->until(), + CinemaKDMs::collect (screen_kdms), + shared_ptr () + )); JobManager::instance()->add (job); if (_job_view) { diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc index 0de05c342..5e50df227 100644 --- a/src/tools/server_test.cc +++ b/src/tools/server_test.cc @@ -31,7 +31,6 @@ #include "lib/player.h" #include "lib/player_video.h" #include "lib/encode_server_description.h" -#include #include #include #include @@ -42,19 +41,18 @@ using std::cerr; using std::string; using std::pair; using boost::shared_ptr; -using boost::make_shared; using dcp::Data; static shared_ptr film; static EncodeServerDescription* server; -static shared_ptr log_ = make_shared ("servomatictest.log"); +static shared_ptr log_ (new FileLog ("servomatictest.log")); static int frame_count = 0; void process_video (shared_ptr pvf) { - shared_ptr local = make_shared (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_); - shared_ptr remote = make_shared (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_); + shared_ptr local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_)); + shared_ptr remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_)); cout << "Frame " << frame_count << ": "; cout.flush (); @@ -146,7 +144,7 @@ main (int argc, char* argv[]) film.reset (new Film (film_dir)); film->read_metadata (); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); DCPTime const frame = DCPTime::from_frames (1, film->video_frame_rate ()); for (DCPTime t; t < film->length(); t += frame) { diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 8ffe8b7a4..ab26329a4 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -33,7 +33,6 @@ #include "lib/audio_content.h" #include #include -#include #include using std::vector; @@ -43,7 +42,6 @@ using std::list; using std::pair; using boost::dynamic_pointer_cast; using boost::shared_ptr; -using boost::make_shared; using boost::optional; AudioPanel::AudioPanel (ContentPanel* p) @@ -314,10 +312,10 @@ AudioPanel::setup_peak () if (sel.size() != 1) { _peak->SetLabel (wxT ("")); } else { - shared_ptr playlist = make_shared (); + shared_ptr playlist (new Playlist); playlist->add (sel.front ()); try { - shared_ptr analysis = make_shared (_parent->film()->audio_analysis_path (playlist)); + shared_ptr analysis (new AudioAnalysis (_parent->film()->audio_analysis_path (playlist))); if (analysis->sample_peak ()) { float const peak_dB = 20 * log10 (analysis->sample_peak().get()) + analysis->gain_correction (playlist); if (peak_dB > -3) { diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc index 19ebc90d5..01b1ca056 100644 --- a/src/wx/colour_conversion_editor.cc +++ b/src/wx/colour_conversion_editor.cc @@ -27,13 +27,11 @@ #include #include #include -#include #include using std::string; using std::cout; using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; ColourConversionEditor::ColourConversionEditor (wxWindow* parent, bool yuv) @@ -310,15 +308,19 @@ ColourConversionEditor::get () const if (_input_gamma_linearised->GetValue ()) { conversion.set_in ( - make_shared ( - _input_power->GetValue (), - raw_convert (wx_to_std (_input_threshold->GetValue ())), - raw_convert (wx_to_std (_input_A->GetValue ())), - raw_convert (wx_to_std (_input_B->GetValue ())) + shared_ptr ( + new dcp::ModifiedGammaTransferFunction ( + _input_power->GetValue (), + raw_convert (wx_to_std (_input_threshold->GetValue ())), + raw_convert (wx_to_std (_input_A->GetValue ())), + raw_convert (wx_to_std (_input_B->GetValue ())) + ) ) ); } else { - conversion.set_in (make_shared (_input_gamma->GetValue ())); + conversion.set_in ( + shared_ptr (new dcp::GammaTransferFunction (_input_gamma->GetValue ())) + ); } conversion.set_yuv_to_rgb (static_cast (_yuv_to_rgb->GetSelection ())); @@ -347,7 +349,7 @@ ColourConversionEditor::get () const conversion.unset_adjusted_white (); } - conversion.set_out (make_shared (2.6)); + conversion.set_out (shared_ptr (new dcp::GammaTransferFunction (2.6))); return conversion; } diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 99b942174..3d5b00279 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -37,14 +37,12 @@ #include #include #include -#include #include using std::cout; using std::vector; using std::exception; using boost::shared_ptr; -using boost::make_shared; using boost::weak_ptr; using boost::dynamic_pointer_cast; @@ -161,7 +159,7 @@ ContentMenu::join () } try { - shared_ptr joined = boost::make_shared (film, fc); + shared_ptr joined (new FFmpegContent (film, fc)); BOOST_FOREACH (shared_ptr i, _content) { film->remove_content (i); } @@ -266,7 +264,7 @@ ContentMenu::find_missing () return; } - shared_ptr j = make_shared (film, content); + shared_ptr j (new ExamineContentJob (film, content)); _job_connection = j->Finished.connect ( bind ( diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 2150d4576..72ab0eef4 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -29,11 +29,9 @@ #include #include #include -#include using std::max; using boost::shared_ptr; -using boost::make_shared; using boost::optional; using boost::dynamic_pointer_cast; @@ -178,7 +176,7 @@ HintsDialog::film_changed () boost::filesystem::path path = film->audio_analysis_path (film->playlist ()); if (boost::filesystem::exists (path)) { - shared_ptr an = make_shared (path); + shared_ptr an (new AudioAnalysis (path)); if (an->sample_peak() || an->true_peak()) { float const peak = max (an->sample_peak().get_value_or(0), an->true_peak().get_value_or(0)); float const peak_dB = 20 * log10 (peak) + an->gain_correction (film->playlist ()); diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index cba221784..cd6918b72 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -19,7 +19,7 @@ */ /** @file src/job_manager_view.cc - * @brief Class generating a widget to show the progress of jobs. + * @brief Class generating a GTK widget to show the progress of jobs. */ #include "job_manager_view.h" @@ -30,7 +30,6 @@ #include "lib/util.h" #include "lib/exceptions.h" #include "lib/compose.hpp" -#include #include using std::string; @@ -39,7 +38,6 @@ using std::map; using std::min; using std::cout; using boost::shared_ptr; -using boost::make_shared; using boost::weak_ptr; /** Must be called in the GUI thread */ @@ -70,7 +68,7 @@ JobManagerView::job_added (weak_ptr j) { shared_ptr job = j.lock (); if (job) { - _job_records.push_back (make_shared (job, this, _panel, _table)); + _job_records.push_back (shared_ptr (new JobView (job, this, _panel, _table))); } } diff --git a/src/wx/report_problem_dialog.cc b/src/wx/report_problem_dialog.cc index 1a32e8fad..68411ee91 100644 --- a/src/wx/report_problem_dialog.cc +++ b/src/wx/report_problem_dialog.cc @@ -24,11 +24,9 @@ #include "lib/job_manager.h" #include "lib/send_problem_report_job.h" #include -#include using std::string; using boost::shared_ptr; -using boost::make_shared; /** @param film Film that we are working on, or 0 */ ReportProblemDialog::ReportProblemDialog (wxWindow* parent, shared_ptr film) @@ -105,5 +103,5 @@ ReportProblemDialog::report () return; } - JobManager::instance()->add (boost::make_shared (_film, wx_to_std (_email->GetValue ()), wx_to_std (_summary->GetValue ()))); + JobManager::instance()->add (shared_ptr (new SendProblemReportJob (_film, wx_to_std (_email->GetValue ()), wx_to_std (_summary->GetValue ())))); } diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index df07a08c4..0638763fe 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -26,7 +26,6 @@ #include "cinema_dialog.h" #include "screen_dialog.h" #include -#include using std::list; using std::pair; @@ -35,7 +34,6 @@ using std::map; using std::string; using std::make_pair; using boost::shared_ptr; -using boost::make_shared; using boost::optional; ScreensPanel::ScreensPanel (wxWindow* parent) @@ -151,7 +149,7 @@ ScreensPanel::add_cinema_clicked () { CinemaDialog* d = new CinemaDialog (this, _("Add Cinema")); if (d->ShowModal () == wxID_OK) { - shared_ptr c = boost::make_shared (d->name(), d->emails(), d->notes(), d->utc_offset_hour(), d->utc_offset_minute()); + shared_ptr c (new Cinema (d->name(), d->emails(), d->notes(), d->utc_offset_hour(), d->utc_offset_minute())); Config::instance()->add_cinema (c); add_cinema (c); } @@ -210,7 +208,7 @@ ScreensPanel::add_screen_clicked () return; } - shared_ptr s = boost::make_shared (d->name(), d->recipient(), d->trusted_devices()); + shared_ptr s (new Screen (d->name(), d->recipient(), d->trusted_devices())); c->add_screen (s); optional id = add_screen (c, s); if (id) { diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index ef8549d42..6bb216df8 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -48,7 +47,6 @@ using std::list; using std::cout; using std::max; using boost::shared_ptr; -using boost::make_shared; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::bind; @@ -152,19 +150,19 @@ Timeline::recreate_views () BOOST_FOREACH (shared_ptr i, film->content ()) { if (i->video) { - _views.push_back (make_shared (*this, i)); + _views.push_back (shared_ptr (new TimelineVideoContentView (*this, i))); } if (i->audio && !i->audio->mapping().mapped_output_channels().empty ()) { - _views.push_back (make_shared (*this, i)); + _views.push_back (shared_ptr (new TimelineAudioContentView (*this, i))); } if (i->subtitle) { - _views.push_back (make_shared (*this, i)); + _views.push_back (shared_ptr (new TimelineSubtitleContentView (*this, i))); } if (dynamic_pointer_cast (i)) { - _views.push_back (make_shared (*this, i)); + _views.push_back (shared_ptr (new TimelineAtmosContentView (*this, i))); } } diff --git a/test/4k_test.cc b/test/4k_test.cc index c5418e9dd..033796ab2 100644 --- a/test/4k_test.cc +++ b/test/4k_test.cc @@ -24,23 +24,21 @@ * The output is checked against test/data/4k_test. */ +#include #include "lib/film.h" #include "lib/ffmpeg_content.h" #include "lib/dcp_content_type.h" #include "lib/video_content.h" #include "lib/ratio.h" #include "test.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (fourk_test) { shared_ptr film = new_test_film ("4k_test"); film->set_name ("4k_test"); - shared_ptr c = make_shared (film, "test/data/test.mp4"); + shared_ptr c (new FFmpegContent (film, "test/data/test.mp4")); film->set_resolution (RESOLUTION_4K); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); film->set_container (Ratio::from_id ("185")); diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index 9fd928281..5923e0698 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -22,6 +22,7 @@ * @brief Check audio analysis code. */ +#include #include "lib/audio_analysis.h" #include "lib/analyse_audio_job.h" #include "lib/film.h" @@ -32,11 +33,8 @@ #include "lib/job_manager.h" #include "lib/audio_content.h" #include "test.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; static float random_float () @@ -99,11 +97,11 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test) film->set_name ("audio_analysis_test"); boost::filesystem::path p = private_data / "betty_L.wav"; - shared_ptr c = make_shared (film, p); + shared_ptr c (new FFmpegContent (film, p)); film->examine_and_add_content (c); wait_for_jobs (); - shared_ptr job = make_shared (film, film->playlist ()); + shared_ptr job (new AnalyseAudioJob (film, film->playlist ())); job->Finished.connect (boost::bind (&finished)); JobManager::instance()->add (job); wait_for_jobs (); @@ -114,13 +112,13 @@ BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test) { shared_ptr film = new_test_film ("audio_analysis_negative_delay_test"); film->set_name ("audio_analysis_negative_delay_test"); - shared_ptr c = make_shared (film, private_data / "boon_telly.mkv"); + shared_ptr c (new FFmpegContent (film, private_data / "boon_telly.mkv")); film->examine_and_add_content (c); wait_for_jobs (); c->audio->set_delay (-250); - shared_ptr job = make_shared (film, film->playlist ()); + shared_ptr job (new AnalyseAudioJob (film, film->playlist ())); job->Finished.connect (boost::bind (&finished)); JobManager::instance()->add (job); wait_for_jobs (); @@ -131,11 +129,11 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test2) { shared_ptr film = new_test_film ("audio_analysis_test2"); film->set_name ("audio_analysis_test2"); - shared_ptr c = make_shared (film, private_data / "3d_thx_broadway_2010_lossless.m2ts"); + shared_ptr c (new FFmpegContent (film, private_data / "3d_thx_broadway_2010_lossless.m2ts")); film->examine_and_add_content (c); wait_for_jobs (); - shared_ptr job = make_shared (film, film->playlist ()); + shared_ptr job (new AnalyseAudioJob (film, film->playlist ())); job->Finished.connect (boost::bind (&finished)); JobManager::instance()->add (job); wait_for_jobs (); @@ -160,7 +158,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_test3) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, "test/data/white.wav"); + shared_ptr content (new FFmpegContent (film, "test/data/white.wav")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/audio_decoder_test.cc b/test/audio_decoder_test.cc index 92c99a378..945773d12 100644 --- a/test/audio_decoder_test.cc +++ b/test/audio_decoder_test.cc @@ -28,7 +28,6 @@ #include "lib/audio_content.h" #include "lib/film.h" #include -#include #include #include @@ -36,7 +35,6 @@ using std::string; using std::cout; using std::min; using boost::shared_ptr; -using boost::make_shared; class TestAudioContent : public Content { @@ -78,7 +76,7 @@ public: _test_audio_content->audio_length() - _position ); - shared_ptr buffers = make_shared (_test_audio_content->audio->stream()->channels(), N); + shared_ptr buffers (new AudioBuffers (_test_audio_content->audio->stream()->channels(), N)); for (int i = 0; i < _test_audio_content->audio->stream()->channels(); ++i) { for (int j = 0; j < N; ++j) { buffers->data(i)[j] = j + _position; diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc index a87c3016e..1d2d171db 100644 --- a/test/audio_delay_test.cc +++ b/test/audio_delay_test.cc @@ -24,27 +24,25 @@ * The output is checked algorithmically using knowledge of the input. */ -#include "lib/ffmpeg_content.h" -#include "lib/dcp_content_type.h" -#include "lib/ratio.h" -#include "lib/film.h" -#include "lib/audio_content.h" -#include "test.h" +#include #include #include #include #include #include #include -#include -#include +#include "lib/ffmpeg_content.h" +#include "lib/dcp_content_type.h" +#include "lib/ratio.h" +#include "lib/film.h" +#include "lib/audio_content.h" +#include "test.h" #include using std::string; using std::cout; using boost::lexical_cast; using boost::shared_ptr; -using boost::make_shared; static void test_audio_delay (int delay_in_ms) @@ -57,7 +55,7 @@ void test_audio_delay (int delay_in_ms) film->set_container (Ratio::from_id ("185")); film->set_name (film_name); - shared_ptr content = make_shared (film, "test/data/staircase.wav"); + shared_ptr content (new FFmpegContent (film, "test/data/staircase.wav")); film->examine_and_add_content (content); wait_for_jobs (); content->audio->set_delay (delay_in_ms); diff --git a/test/audio_filter_test.cc b/test/audio_filter_test.cc index 0ad91ddde..b92d005a5 100644 --- a/test/audio_filter_test.cc +++ b/test/audio_filter_test.cc @@ -22,13 +22,11 @@ * @brief Basic tests of audio filters. */ +#include #include "lib/audio_filter.h" #include "lib/audio_buffers.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; static void audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks) @@ -37,7 +35,7 @@ audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks) for (int i = 0; i < num_blocks; ++i) { - shared_ptr in = make_shared (1, block_size); + shared_ptr in (new AudioBuffers (1, block_size)); for (int j = 0; j < block_size; ++j) { in->data()[0][j] = c + j; } @@ -78,7 +76,7 @@ BOOST_AUTO_TEST_CASE (audio_filter_impulse_input_test) { LowPassAudioFilter lpf (0.02, 0.3); - shared_ptr in = make_shared (1, 1751); + shared_ptr in (new AudioBuffers (1, 1751)); in->make_silent (); in->data(0)[0] = 1; diff --git a/test/audio_processor_delay_test.cc b/test/audio_processor_delay_test.cc index 9fc2d7242..78f8e6895 100644 --- a/test/audio_processor_delay_test.cc +++ b/test/audio_processor_delay_test.cc @@ -21,14 +21,12 @@ #include "lib/audio_delay.h" #include "lib/audio_buffers.h" #include -#include #include #include using std::cerr; using std::cout; using boost::shared_ptr; -using boost::make_shared; #define CHECK_SAMPLE(c,f,r) \ if (fabs(out->data(c)[f] - (r)) > 0.1) { \ @@ -43,7 +41,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test1) int const C = 2; - shared_ptr in = make_shared (C, 256); + shared_ptr in (new AudioBuffers (C, 256)); for (int i = 0; i < C; ++i) { for (int j = 0; j < 256; ++j) { in->data(i)[j] = j; @@ -93,7 +91,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test2) /* Feeding 4 blocks of 64 should give silence each time */ for (int i = 0; i < 4; ++i) { - shared_ptr in = make_shared (C, 64); + shared_ptr in (new AudioBuffers (C, 64)); for (int j = 0; j < C; ++j) { for (int k = 0; k < 64; ++k) { in->data(j)[k] = k + i * 64; @@ -114,7 +112,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test2) /* Now feed 4 blocks of silence and we should see the data */ for (int i = 0; i < 4; ++i) { /* Feed some silence */ - shared_ptr in = make_shared (C, 64); + shared_ptr in (new AudioBuffers (C, 64)); in->make_silent (); shared_ptr out = delay.run (in); diff --git a/test/audio_processor_test.cc b/test/audio_processor_test.cc index 97d2cd759..8357cff78 100644 --- a/test/audio_processor_test.cc +++ b/test/audio_processor_test.cc @@ -26,17 +26,15 @@ #include "lib/film.h" #include "test.h" #include -#include using boost::shared_ptr; -using boost::make_shared; /** Test the mid-side decoder for analysis and DCP-making */ BOOST_AUTO_TEST_CASE (audio_processor_test) { shared_ptr film = new_test_film ("audio_processor_test"); film->set_name ("audio_processor_test"); - shared_ptr c = make_shared (film, "test/data/white.wav"); + shared_ptr c (new FFmpegContent (film, "test/data/white.wav")); film->examine_and_add_content (c); wait_for_jobs (); @@ -45,7 +43,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_test) film->set_audio_processor (AudioProcessor::from_id ("mid-side-decoder")); /* Analyse the audio and check it doesn't crash */ - shared_ptr job = make_shared (film, film->playlist ()); + shared_ptr job (new AnalyseAudioJob (film, film->playlist ())); JobManager::instance()->add (job); wait_for_jobs (); diff --git a/test/black_fill_test.cc b/test/black_fill_test.cc index 77ee90848..79b97ad77 100644 --- a/test/black_fill_test.cc +++ b/test/black_fill_test.cc @@ -18,21 +18,19 @@ */ +#include #include "lib/image_content.h" #include "lib/dcp_content_type.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/video_content.h" #include "test.h" -#include -#include /** @file test/black_fill_test.cc * @brief Test insertion of black frames between separate bits of video content. */ using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (black_fill_test) { @@ -41,8 +39,8 @@ BOOST_AUTO_TEST_CASE (black_fill_test) film->set_name ("black_fill_test"); film->set_container (Ratio::from_id ("185")); film->set_sequence (false); - shared_ptr contentA = make_shared (film, "test/data/simple_testcard_640x480.png"); - shared_ptr contentB = make_shared (film, "test/data/simple_testcard_640x480.png"); + shared_ptr contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png")); + shared_ptr contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png")); film->examine_and_add_content (contentA); film->examine_and_add_content (contentB); diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index 71758e012..d7ccbc659 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, "test/data/subrip2.srt"); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); content->set_use_subtitles (true); content->set_burn_subtitles (true); film->examine_and_add_content (content, true); @@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_dcp) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_burn_subtitles (true); - shared_ptr content = make_shared (film, "test/data/dcp_sub.xml"); + shared_ptr content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); content->set_use_subtitles (true); film->examine_and_add_content (content, true); wait_for_jobs (); diff --git a/test/client_server_test.cc b/test/client_server_test.cc index 68ef336a1..1f77f7f90 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -37,11 +37,9 @@ #include "lib/file_log.h" #include #include -#include using std::list; using boost::shared_ptr; -using boost::make_shared; using boost::thread; using boost::optional; using dcp::Data; @@ -58,7 +56,7 @@ do_remote_encode (shared_ptr frame, EncodeServerDescription descriptio BOOST_AUTO_TEST_CASE (client_server_test_rgb) { - shared_ptr image = make_shared (AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true); + shared_ptr image (new Image (AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true)); uint8_t* p = image->data()[0]; for (int y = 0; y < 1080; ++y) { @@ -71,7 +69,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb) p += image->stride()[0]; } - shared_ptr sub_image = make_shared (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true); + shared_ptr sub_image (new Image (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true)); p = sub_image->data()[0]; for (int y = 0; y < 200; ++y) { uint8_t* q = p; @@ -84,11 +82,11 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb) p += sub_image->stride()[0]; } - shared_ptr log = make_shared ("build/test/client_server_test_rgb.log"); + shared_ptr log (new FileLog ("build/test/client_server_test_rgb.log")); shared_ptr pvf ( new PlayerVideo ( - make_shared (image), + shared_ptr (new RawImageProxy (image)), DCPTime (), Crop (), optional (), @@ -142,7 +140,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb) BOOST_AUTO_TEST_CASE (client_server_test_yuv) { - shared_ptr image = make_shared (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true); + shared_ptr image (new Image (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true)); for (int i = 0; i < image->planes(); ++i) { uint8_t* p = image->data()[i]; @@ -151,7 +149,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv) } } - shared_ptr sub_image = make_shared (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true); + shared_ptr sub_image (new Image (AV_PIX_FMT_RGBA, dcp::Size (100, 200), true)); uint8_t* p = sub_image->data()[0]; for (int y = 0; y < 200; ++y) { uint8_t* q = p; @@ -164,11 +162,11 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv) p += sub_image->stride()[0]; } - shared_ptr log = make_shared ("build/test/client_server_test_yuv.log"); + shared_ptr log (new FileLog ("build/test/client_server_test_yuv.log")); shared_ptr pvf ( new PlayerVideo ( - make_shared (image), + shared_ptr (new RawImageProxy (image)), DCPTime (), Crop (), optional (), @@ -222,7 +220,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv) BOOST_AUTO_TEST_CASE (client_server_test_j2k) { - shared_ptr image = make_shared (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true); + shared_ptr image (new Image (AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true)); for (int i = 0; i < image->planes(); ++i) { uint8_t* p = image->data()[i]; @@ -231,11 +229,11 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k) } } - shared_ptr log = make_shared ("build/test/client_server_test_j2k.log"); + shared_ptr log (new FileLog ("build/test/client_server_test_j2k.log")); shared_ptr raw_pvf ( new PlayerVideo ( - make_shared (image), + shared_ptr (new RawImageProxy (image)), DCPTime (), Crop (), optional (), @@ -262,8 +260,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k) shared_ptr j2k_pvf ( new PlayerVideo ( - /* This J2KImageProxy constructor is private, so no make_shared */ - shared_ptr (new J2KImageProxy (raw_locally_encoded, dcp::Size (1998, 1080))), + shared_ptr (new J2KImageProxy (raw_locally_encoded, dcp::Size (1998, 1080))), DCPTime (), Crop (), optional (), diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc index 00e830dad..6c25e8ae3 100644 --- a/test/colour_conversion_test.cc +++ b/test/colour_conversion_test.cc @@ -29,12 +29,10 @@ #include #include #include -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (colour_conversion_test1) { @@ -111,7 +109,7 @@ BOOST_AUTO_TEST_CASE (colour_conversion_test4) xmlpp::Document out; xmlpp::Element* out_root = out.create_root_node ("Test"); i.conversion.as_xml (out_root); - shared_ptr in = make_shared ("Test"); + shared_ptr in (new cxml::Document ("Test")); in->read_string (out.write_to_string ("UTF-8")); BOOST_CHECK (ColourConversion::from_xml (in, Film::current_state_version).get () == i.conversion); } diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 85dea391f..ef733d370 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -22,6 +22,7 @@ * @brief Test DCP subtitle content in various ways. */ +#include #include "lib/film.h" #include "lib/dcp_subtitle_content.h" #include "lib/dcp_content.h" @@ -32,14 +33,11 @@ #include "lib/content_subtitle.h" #include "lib/subtitle_decoder.h" #include "test.h" -#include -#include #include using std::cout; using std::list; using boost::shared_ptr; -using boost::make_shared; /** Test pass-through of a very simple DCP subtitle file */ BOOST_AUTO_TEST_CASE (dcp_subtitle_test) @@ -48,7 +46,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, "test/data/dcp_sub.xml"); + shared_ptr content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); film->examine_and_add_content (content); wait_for_jobs (); @@ -69,11 +67,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV"); + shared_ptr content (new DCPContent (film, private_data / "JourneyToJah_TLR-1_F_EN-DE-FR_CH_51_2K_LOK_20140225_DGL_SMPTE_OV")); film->examine_and_add_content (content); wait_for_jobs (); - shared_ptr decoder = make_shared (content, film->log(), false); + shared_ptr decoder (new DCPDecoder (content, film->log(), false)); list ctp = decoder->text_subtitles_during ( ContentTimePeriod ( diff --git a/test/ffmpeg_audio_only_test.cc b/test/ffmpeg_audio_only_test.cc index 2101e9774..bad800e57 100644 --- a/test/ffmpeg_audio_only_test.cc +++ b/test/ffmpeg_audio_only_test.cc @@ -27,10 +27,8 @@ #include "test.h" #include #include -#include using boost::shared_ptr; -using boost::make_shared; /** Test the FFmpeg code with audio-only content */ static void @@ -39,7 +37,7 @@ test (boost::filesystem::path file) shared_ptr film = new_test_film ("ffmpeg_audio_only_test"); film->set_name ("test_film"); film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); - shared_ptr c = make_shared (film, file); + shared_ptr c (new FFmpegContent (film, file)); film->examine_and_add_content (c); wait_for_jobs (); film->write_metadata (); @@ -58,7 +56,7 @@ test (boost::filesystem::path file) BOOST_REQUIRE_EQUAL (info.samplerate, 48000); float* ref_buffer = new float[info.samplerate * info.channels]; - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); for (DCPTime t; t < film->length(); t += DCPTime::from_seconds (1)) { int const N = sf_readf_float (ref, ref_buffer, info.samplerate); diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc index 07e6e0310..cfbaf46c3 100644 --- a/test/ffmpeg_audio_test.cc +++ b/test/ffmpeg_audio_test.cc @@ -37,17 +37,15 @@ #include #include #include -#include using std::string; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (ffmpeg_audio_test) { shared_ptr film = new_test_film ("ffmpeg_audio_test"); film->set_name ("ffmpeg_audio_test"); - shared_ptr c = make_shared (film, "test/data/staircase.mov"); + shared_ptr c (new FFmpegContent (film, "test/data/staircase.mov")); film->examine_and_add_content (c); wait_for_jobs (); diff --git a/test/ffmpeg_dcp_test.cc b/test/ffmpeg_dcp_test.cc index c69516b9f..18decee95 100644 --- a/test/ffmpeg_dcp_test.cc +++ b/test/ffmpeg_dcp_test.cc @@ -24,25 +24,23 @@ * Also a quick test of Film::have_dcp (). */ +#include +#include +#include #include "lib/film.h" #include "lib/ffmpeg_content.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" #include "lib/video_content.h" #include "test.h" -#include -#include -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test) { shared_ptr film = new_test_film ("ffmpeg_dcp_test"); film->set_name ("test_film2"); - shared_ptr c = make_shared (film, "test/data/test.mp4"); + shared_ptr c (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (c); wait_for_jobs (); @@ -61,7 +59,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_dcp_test) BOOST_AUTO_TEST_CASE (ffmpeg_have_dcp_test) { boost::filesystem::path p = test_film_dir ("ffmpeg_dcp_test"); - shared_ptr film = boost::make_shared (p.string ()); + shared_ptr film (new Film (p.string ())); film->read_metadata (); BOOST_CHECK (!film->cpls().empty()); diff --git a/test/ffmpeg_decoder_seek_test.cc b/test/ffmpeg_decoder_seek_test.cc index 5e310cd3c..8a854b01b 100644 --- a/test/ffmpeg_decoder_seek_test.cc +++ b/test/ffmpeg_decoder_seek_test.cc @@ -35,14 +35,12 @@ #include "test.h" #include #include -#include #include using std::cerr; using std::vector; using std::list; using boost::shared_ptr; -using boost::make_shared; using boost::optional; static void @@ -64,11 +62,11 @@ test (boost::filesystem::path file, vector frames) } shared_ptr film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string()); - shared_ptr content = make_shared (film, path); + shared_ptr content (new FFmpegContent (film, path)); film->examine_and_add_content (content); wait_for_jobs (); - shared_ptr log = make_shared (); - shared_ptr decoder = make_shared (content, log, false); + shared_ptr log (new NullLog); + shared_ptr decoder (new FFmpegDecoder (content, log, false)); for (vector::const_iterator i = frames.begin(); i != frames.end(); ++i) { check (decoder, *i); diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc index 9edca0160..6a27d698f 100644 --- a/test/ffmpeg_decoder_sequential_test.cc +++ b/test/ffmpeg_decoder_sequential_test.cc @@ -31,7 +31,6 @@ #include "lib/film.h" #include "test.h" #include -#include #include #include @@ -39,7 +38,6 @@ using std::cout; using std::cerr; using std::list; using boost::shared_ptr; -using boost::make_shared; using boost::optional; void @@ -52,11 +50,11 @@ ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int } shared_ptr film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string()); - shared_ptr content = make_shared (film, path); + shared_ptr content (new FFmpegContent (film, path)); film->examine_and_add_content (content); wait_for_jobs (); - shared_ptr log = make_shared (); - shared_ptr decoder = make_shared (content, log, false); + shared_ptr log (new NullLog); + shared_ptr decoder (new FFmpegDecoder (content, log, false)); BOOST_REQUIRE (decoder->video->_content->video_frame_rate()); BOOST_CHECK_CLOSE (decoder->video->_content->video_frame_rate().get(), fps, 0.01); diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc index 2900689e5..13846a8a1 100644 --- a/test/ffmpeg_examiner_test.cc +++ b/test/ffmpeg_examiner_test.cc @@ -23,21 +23,19 @@ * correctly from data/count300bd24.m2ts. */ +#include #include "lib/ffmpeg_examiner.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_audio_stream.h" #include "test.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (ffmpeg_examiner_test) { shared_ptr film = new_test_film ("ffmpeg_examiner_test"); - shared_ptr content = make_shared (film, "test/data/count300bd24.m2ts"); - shared_ptr examiner = make_shared (content); + shared_ptr content (new FFmpegContent (film, "test/data/count300bd24.m2ts")); + shared_ptr examiner (new FFmpegExaminer (content)); BOOST_CHECK_EQUAL (examiner->first_video().get(), ContentTime::from_seconds (600)); BOOST_CHECK_EQUAL (examiner->audio_streams().size(), 1U); diff --git a/test/ffmpeg_pts_offset_test.cc b/test/ffmpeg_pts_offset_test.cc index ccc2a10f2..02ea0233d 100644 --- a/test/ffmpeg_pts_offset_test.cc +++ b/test/ffmpeg_pts_offset_test.cc @@ -22,27 +22,24 @@ * @brief Check the computation of _pts_offset in FFmpegDecoder. */ +#include #include "lib/film.h" #include "lib/ffmpeg_decoder.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_audio_stream.h" #include "lib/audio_content.h" #include "test.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test) { shared_ptr film = new_test_film ("ffmpeg_pts_offset_test"); - shared_ptr content = make_shared (film, "test/data/test.mp4"); + shared_ptr content (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (content); wait_for_jobs (); content->audio.reset (new AudioContent (content.get())); - /* Can't use make_shared here */ content->audio->add_stream (shared_ptr (new FFmpegAudioStream)); content->_video_frame_rate = 24; diff --git a/test/film_metadata_test.cc b/test/film_metadata_test.cc index d61f5f0d1..970c6526d 100644 --- a/test/film_metadata_test.cc +++ b/test/film_metadata_test.cc @@ -22,19 +22,17 @@ * @brief Test some basic reading/writing of film metadata. */ +#include +#include +#include #include "lib/film.h" #include "lib/dcp_content_type.h" #include "lib/ratio.h" #include "test.h" -#include -#include -#include -#include using std::string; using std::list; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (film_metadata_test) { @@ -55,7 +53,7 @@ BOOST_AUTO_TEST_CASE (film_metadata_test) ignore.push_back ("Key"); check_xml ("test/data/metadata.xml.ref", dir.string() + "/metadata.xml", ignore); - shared_ptr g = make_shared (dir); + shared_ptr g (new Film (dir)); g->read_metadata (); BOOST_CHECK_EQUAL (g->name(), "fred"); diff --git a/test/frame_rate_test.cc b/test/frame_rate_test.cc index 490836a46..592b7af8b 100644 --- a/test/frame_rate_test.cc +++ b/test/frame_rate_test.cc @@ -23,6 +23,7 @@ * frame rate for the DCP. */ +#include #include "lib/film.h" #include "lib/config.h" #include "lib/ffmpeg_content.h" @@ -32,11 +33,8 @@ #include "lib/video_content.h" #include "lib/audio_content.h" #include "test.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; /* Test Playlist::best_dcp_frame_rate and FrameRateChange with a single piece of content. @@ -45,7 +43,7 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_single) { shared_ptr film = new_test_film ("best_dcp_frame_rate_test_single"); /* Get any piece of content, it doesn't matter what */ - shared_ptr content = make_shared (film, "test/data/test.mp4"); + shared_ptr content (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (content); wait_for_jobs (); @@ -223,9 +221,9 @@ BOOST_AUTO_TEST_CASE (best_dcp_frame_rate_test_double) { shared_ptr film = new_test_film ("best_dcp_frame_rate_test_double"); /* Get any old content, it doesn't matter what */ - shared_ptr A = make_shared (film, "test/data/test.mp4"); + shared_ptr A (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (A); - shared_ptr B = make_shared (film, "test/data/test.mp4"); + shared_ptr B (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (B); wait_for_jobs (); @@ -254,7 +252,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test) { shared_ptr film = new_test_film ("audio_sampling_rate_test"); /* Get any piece of content, it doesn't matter what */ - shared_ptr content = make_shared (film, "test/data/test.mp4"); + shared_ptr content (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (content); wait_for_jobs (); @@ -264,7 +262,7 @@ BOOST_AUTO_TEST_CASE (audio_sampling_rate_test) afr.push_back (30); Config::instance()->set_allowed_dcp_frame_rates (afr); - shared_ptr stream = make_shared ("foo", 0, 0, 0, 0); + shared_ptr stream (new FFmpegAudioStream ("foo", 0, 0, 0, 0)); content->audio.reset (new AudioContent (content.get())); content->audio->add_stream (stream); content->_video_frame_rate = 24; diff --git a/test/image_test.cc b/test/image_test.cc index 59b35a96b..d00263035 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -24,17 +24,15 @@ * @see test/make_black_test.cc, test/pixel_formats_test.cc */ +#include #include #include "lib/image.h" -#include -#include #include using std::string; using std::list; using std::cout; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (aligned_image_test) { @@ -140,7 +138,7 @@ BOOST_AUTO_TEST_CASE (alpha_blend_test) { int const stride = 48 * 4; - shared_ptr A = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false); + shared_ptr A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false)); A->make_black (); uint8_t* a = A->data()[0]; @@ -153,7 +151,7 @@ BOOST_AUTO_TEST_CASE (alpha_blend_test) } } - shared_ptr B = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 48), true); + shared_ptr B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), true)); B->make_transparent (); uint8_t* b = B->data()[0]; @@ -194,7 +192,7 @@ BOOST_AUTO_TEST_CASE (merge_test1) { int const stride = 48 * 4; - shared_ptr A = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false); + shared_ptr A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false)); A->make_transparent (); uint8_t* a = A->data()[0]; @@ -219,7 +217,7 @@ BOOST_AUTO_TEST_CASE (merge_test1) /** Test merge (list) with two images */ BOOST_AUTO_TEST_CASE (merge_test2) { - shared_ptr A = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false); + shared_ptr A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false)); A->make_transparent (); uint8_t* a = A->data()[0]; for (int x = 0; x < 16; ++x) { @@ -229,7 +227,7 @@ BOOST_AUTO_TEST_CASE (merge_test2) a[x * 4 + 3] = 255; } - shared_ptr B = make_shared (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false); + shared_ptr B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false)); B->make_transparent (); uint8_t* b = B->data()[0]; for (int x = 0; x < 16; ++x) { diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc index 3dc9333da..69ffa9cc4 100644 --- a/test/import_dcp_test.cc +++ b/test/import_dcp_test.cc @@ -29,11 +29,9 @@ #include "lib/cross.h" #include #include -#include using std::vector; using boost::shared_ptr; -using boost::make_shared; /** Make an encrypted DCP, import it and make a new unencrypted DCP */ BOOST_AUTO_TEST_CASE (import_dcp_test) @@ -43,7 +41,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test) A->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); A->set_name ("frobozz"); - shared_ptr c = make_shared (A, "test/data/test.mp4"); + shared_ptr c (new FFmpegContent (A, "test/data/test.mp4")); A->examine_and_add_content (c); A->set_encrypted (true); wait_for_jobs (); @@ -54,7 +52,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test) dcp::DCP A_dcp ("build/test/import_dcp_test/" + A->dcp_name()); A_dcp.read (); - Config::instance()->set_decryption_chain (make_shared (openssl_path ())); + Config::instance()->set_decryption_chain (shared_ptr (new dcp::CertificateChain (openssl_path ()))); dcp::EncryptedKDM kdm = A->make_kdm ( Config::instance()->decryption_chain()->leaf (), @@ -70,7 +68,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test) B->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); B->set_name ("frobozz"); - shared_ptr d = boost::make_shared (B, "build/test/import_dcp_test/" + A->dcp_name()); + shared_ptr d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name())); d->add_kdm (kdm); B->examine_and_add_content (d); wait_for_jobs (); diff --git a/test/interrupt_encoder_test.cc b/test/interrupt_encoder_test.cc index 4d5787997..8883c2d6f 100644 --- a/test/interrupt_encoder_test.cc +++ b/test/interrupt_encoder_test.cc @@ -27,10 +27,8 @@ #include "lib/cross.h" #include "test.h" #include -#include using boost::shared_ptr; -using boost::make_shared; /** Interrupt a DCP encode when it is in progress, as this used to (still does?) * sometimes give an error related to pthreads. @@ -42,7 +40,7 @@ BOOST_AUTO_TEST_CASE (interrupt_encoder_test) film->set_container (Ratio::from_id ("185")); film->set_name ("interrupt_encoder_test"); - shared_ptr content = make_shared (film, private_data / "prophet_clip.mkv"); + shared_ptr content (new FFmpegContent (film, private_data / "prophet_clip.mkv")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index e3023f9f5..bb47fa9c0 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -28,12 +28,10 @@ #include "lib/ffmpeg_content.h" #include "lib/audio_content.h" #include "test.h" -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (isdcf_name_test) { @@ -78,7 +76,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) /* Test interior aspect ratio: shouldn't be shown with trailers */ - shared_ptr content = make_shared (film, "test/data/simple_testcard_640x480.png"); + shared_ptr content (new ImageContent (film, "test/data/simple_testcard_640x480.png")); film->examine_and_add_content (content); wait_for_jobs (); content->video->set_scale (VideoContentScale (Ratio::from_id ("133"))); @@ -130,7 +128,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) /* Test audio channel markup */ film->set_audio_channels (6); - shared_ptr sound = make_shared (film, "test/data/sine_440.wav"); + shared_ptr sound (new FFmpegContent (film, "test/data/sine_440.wav")); film->examine_and_add_content (sound); wait_for_jobs (); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV"); diff --git a/test/job_test.cc b/test/job_test.cc index 5212ec150..8728b7312 100644 --- a/test/job_test.cc +++ b/test/job_test.cc @@ -22,15 +22,13 @@ * @brief Basic tests of Job and JobManager. */ +#include #include "lib/job.h" #include "lib/job_manager.h" #include "lib/cross.h" -#include -#include using std::string; using boost::shared_ptr; -using boost::make_shared; class TestJob : public Job { @@ -72,7 +70,7 @@ BOOST_AUTO_TEST_CASE (job_manager_test) shared_ptr film; /* Single job */ - shared_ptr a = make_shared (film); + shared_ptr a (new TestJob (film)); JobManager::instance()->add (a); dcpomatic_sleep (1); diff --git a/test/make_black_test.cc b/test/make_black_test.cc index 88bf4bb7a..405cc835f 100644 --- a/test/make_black_test.cc +++ b/test/make_black_test.cc @@ -25,16 +25,14 @@ * @see test/image_test.cc */ +#include #include extern "C" { #include } #include "lib/image.h" -#include -#include using std::list; -using boost::make_shared; BOOST_AUTO_TEST_CASE (make_black_test) { @@ -81,7 +79,7 @@ BOOST_AUTO_TEST_CASE (make_black_test) int N = 0; for (list::const_iterator i = pix_fmts.begin(); i != pix_fmts.end(); ++i) { - boost::shared_ptr foo = make_shared (*i, in_size, true); + boost::shared_ptr foo (new Image (*i, in_size, true)); foo->make_black (); boost::shared_ptr bar = foo->scale (out_size, dcp::YUV_TO_RGB_REC601, AV_PIX_FMT_RGB24, true, false); diff --git a/test/play_test.cc b/test/play_test.cc index 9b9e2c87b..92c49a134 100644 --- a/test/play_test.cc +++ b/test/play_test.cc @@ -88,13 +88,13 @@ BOOST_AUTO_TEST_CASE (play_test) film->set_container (Ratio::from_id ("185")); film->set_name ("play_test"); - shared_ptr A = make_shared (film, "test/data/red_24.mp4"); + shared_ptr A (new FFmpegContent (film, "test/data/red_24.mp4")); film->examine_and_add_content (A); wait_for_jobs (); BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16); - shared_ptr B = make_shared (film, "test/data/red_30.mp4"); + shared_ptr B (new FFmpegContent (film, "test/data/red_30.mp4")); film->examine_and_add_content (B); wait_for_jobs (); @@ -107,7 +107,7 @@ BOOST_AUTO_TEST_CASE (play_test) /* A is 16 frames long at 25 fps */ BOOST_CHECK_EQUAL (B->position(), 16 * TIME_HZ / 25); - shared_ptr player = make_shared (film); + shared_ptr player (new Player (film)); PlayerWrapper wrap (player); /* Seek and audio don't get on at the moment */ player->disable_audio (); diff --git a/test/player_test.cc b/test/player_test.cc index 6ca0073d8..1b628f72a 100644 --- a/test/player_test.cc +++ b/test/player_test.cc @@ -22,6 +22,8 @@ * @brief Various tests of Player. */ +#include +#include #include "lib/film.h" #include "lib/ffmpeg_content.h" #include "lib/dcp_content_type.h" @@ -29,14 +31,10 @@ #include "lib/audio_buffers.h" #include "lib/player.h" #include "test.h" -#include -#include -#include using std::cout; using std::list; using boost::shared_ptr; -using boost::make_shared; static bool valid (Content const *) @@ -51,9 +49,9 @@ BOOST_AUTO_TEST_CASE (player_overlaps_test) film->set_container (Ratio::from_id ("185")); /* This content is 3s long */ - shared_ptr A = make_shared (film, "test/data/test.mp4"); - shared_ptr B = make_shared (film, "test/data/test.mp4"); - shared_ptr C = make_shared (film, "test/data/test.mp4"); + shared_ptr A (new FFmpegContent (film, "test/data/test.mp4")); + shared_ptr B (new FFmpegContent (film, "test/data/test.mp4")); + shared_ptr C (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (A); film->examine_and_add_content (B); @@ -66,7 +64,7 @@ BOOST_AUTO_TEST_CASE (player_overlaps_test) B->set_position (DCPTime::from_seconds (10)); C->set_position (DCPTime::from_seconds (20)); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); list > o = player->overlaps (DCPTime::from_seconds (0), DCPTime::from_seconds (5), &valid); BOOST_CHECK_EQUAL (o.size(), 1U); @@ -94,14 +92,14 @@ BOOST_AUTO_TEST_CASE (player_silence_padding_test) { shared_ptr film = new_test_film ("player_silence_padding_test"); film->set_name ("player_silence_padding_test"); - shared_ptr c = make_shared (film, "test/data/test.mp4"); + shared_ptr c (new FFmpegContent (film, "test/data/test.mp4")); film->set_container (Ratio::from_id ("185")); film->set_audio_channels (6); film->examine_and_add_content (c); wait_for_jobs (); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); shared_ptr test = player->get_audio (DCPTime (0), DCPTime::from_seconds (1), true); BOOST_CHECK_EQUAL (test->frames(), 48000); BOOST_CHECK_EQUAL (test->channels(), film->audio_channels ()); diff --git a/test/recover_test.cc b/test/recover_test.cc index 83e83d88d..f9ef8793e 100644 --- a/test/recover_test.cc +++ b/test/recover_test.cc @@ -32,13 +32,11 @@ #include #include #include -#include #include using std::cout; using std::string; using boost::shared_ptr; -using boost::make_shared; static void note (dcp::NoteType t, string n) @@ -55,7 +53,7 @@ BOOST_AUTO_TEST_CASE (recover_test_2d) film->set_container (Ratio::from_id ("185")); film->set_name ("recover_test"); - shared_ptr content = make_shared (film, "test/data/count300bd24.m2ts"); + shared_ptr content (new FFmpegContent (film, "test/data/count300bd24.m2ts")); film->examine_and_add_content (content); wait_for_jobs (); @@ -73,8 +71,8 @@ BOOST_AUTO_TEST_CASE (recover_test_2d) film->make_dcp (); wait_for_jobs (); - shared_ptr A = make_shared ("build/test/recover_test_2d/original.mxf"); - shared_ptr B = make_shared (video); + shared_ptr A (new dcp::MonoPictureAsset ("build/test/recover_test_2d/original.mxf")); + shared_ptr B (new dcp::MonoPictureAsset (video)); dcp::EqualityOptions eq; BOOST_CHECK (A->equals (B, eq, boost::bind (¬e, _1, _2))); @@ -88,7 +86,7 @@ BOOST_AUTO_TEST_CASE (recover_test_3d) film->set_name ("recover_test"); film->set_three_d (true); - shared_ptr content = make_shared (film, "test/data/3d_test"); + shared_ptr content (new ImageContent (film, "test/data/3d_test")); content->video->set_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT); film->examine_and_add_content (content); wait_for_jobs (); @@ -108,8 +106,8 @@ BOOST_AUTO_TEST_CASE (recover_test_3d) film->make_dcp (); wait_for_jobs (); - shared_ptr A = make_shared ("build/test/recover_test_3d/original.mxf"); - shared_ptr B = make_shared (video); + shared_ptr A (new dcp::StereoPictureAsset ("build/test/recover_test_3d/original.mxf")); + shared_ptr B (new dcp::StereoPictureAsset (video)); dcp::EqualityOptions eq; BOOST_CHECK (A->equals (B, eq, boost::bind (¬e, _1, _2))); diff --git a/test/reels_test.cc b/test/reels_test.cc index f516fb262..6178c88ac 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -29,20 +29,18 @@ #include "test.h" #include #include -#include using std::list; using boost::shared_ptr; -using boost::make_shared; /** Test Film::reels() */ BOOST_AUTO_TEST_CASE (reels_test1) { shared_ptr film = new_test_film ("reels_test1"); film->set_container (Ratio::from_id ("185")); - shared_ptr A = make_shared (film, "test/data/test.mp4"); + shared_ptr A (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (A); - shared_ptr B = make_shared (film, "test/data/test.mp4"); + shared_ptr B (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (B); wait_for_jobs (); BOOST_CHECK_EQUAL (A->full_length(), DCPTime (288000)); @@ -89,21 +87,21 @@ BOOST_AUTO_TEST_CASE (reels_test2) film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); { - shared_ptr c = make_shared (film, "test/data/flat_red.png"); + shared_ptr c (new ImageContent (film, "test/data/flat_red.png")); film->examine_and_add_content (c); wait_for_jobs (); c->video->set_length (24); } { - shared_ptr c = make_shared (film, "test/data/flat_green.png"); + shared_ptr c (new ImageContent (film, "test/data/flat_green.png")); film->examine_and_add_content (c); wait_for_jobs (); c->video->set_length (24); } { - shared_ptr c = make_shared (film, "test/data/flat_blue.png"); + shared_ptr c (new ImageContent (film, "test/data/flat_blue.png")); film->examine_and_add_content (c); wait_for_jobs (); c->video->set_length (24); @@ -123,7 +121,7 @@ BOOST_AUTO_TEST_CASE (reels_test2) film2->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); film2->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); - shared_ptr c = make_shared (film2, film->dir (film->dcp_name ())); + shared_ptr c (new DCPContent (film2, film->dir (film->dcp_name ()))); film2->examine_and_add_content (c); wait_for_jobs (); @@ -157,9 +155,9 @@ BOOST_AUTO_TEST_CASE (reels_test3) film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); - shared_ptr dcp = make_shared (film, "test/data/reels_test2"); + shared_ptr dcp (new DCPContent (film, "test/data/reels_test2")); film->examine_and_add_content (dcp); - shared_ptr sub = make_shared (film, "test/data/subrip.srt"); + shared_ptr sub (new TextSubtitleContent (film, "test/data/subrip.srt")); film->examine_and_add_content (sub); wait_for_jobs (); @@ -199,7 +197,7 @@ BOOST_AUTO_TEST_CASE (reels_test4) content[i]->video->set_length (24); } - shared_ptr subs = make_shared (film, "test/data/subrip3.srt"); + shared_ptr subs (new TextSubtitleContent (film, "test/data/subrip3.srt")); film->examine_and_add_content (subs); wait_for_jobs (); diff --git a/test/repeat_frame_test.cc b/test/repeat_frame_test.cc index be39242e7..d145ccb18 100644 --- a/test/repeat_frame_test.cc +++ b/test/repeat_frame_test.cc @@ -25,17 +25,15 @@ * @see test/skip_frame_test.cc */ +#include #include "test.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/ffmpeg_content.h" #include "lib/dcp_content_type.h" #include "lib/video_content.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (repeat_frame_test) { @@ -43,7 +41,7 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test) film->set_name ("repeat_frame_test"); film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); - shared_ptr c = make_shared (film, "test/data/red_24.mp4"); + shared_ptr c (new FFmpegContent (film, "test/data/red_24.mp4")); film->examine_and_add_content (c); wait_for_jobs (); diff --git a/test/resampler_test.cc b/test/resampler_test.cc index cb5cddc9e..fb4b98861 100644 --- a/test/resampler_test.cc +++ b/test/resampler_test.cc @@ -23,16 +23,14 @@ * to the number of samples it generates. */ +#include #include "lib/audio_buffers.h" #include "lib/resampler.h" -#include -#include #include using std::pair; using std::cout; using boost::shared_ptr; -using boost::make_shared; static void resampler_test_one (int from, int to) @@ -44,7 +42,7 @@ resampler_test_one (int from, int to) /* XXX: no longer checks anything */ for (int64_t i = 0; i < N; i += 1000) { - shared_ptr a = make_shared (1, 1000); + shared_ptr a (new AudioBuffers (1, 1000)); a->make_silent (); shared_ptr r = resamp.run (a); } diff --git a/test/scaling_test.cc b/test/scaling_test.cc index 4bb6551d3..5ac5c7525 100644 --- a/test/scaling_test.cc +++ b/test/scaling_test.cc @@ -22,18 +22,16 @@ * @brief Test scaling and black-padding of images from a still-image source. */ +#include #include "lib/image_content.h" #include "lib/ratio.h" #include "lib/film.h" #include "lib/dcp_content_type.h" #include "lib/video_content.h" #include "test.h" -#include -#include using std::string; using boost::shared_ptr; -using boost::make_shared; static void scaling_test_for (shared_ptr film, shared_ptr content, string image, string container) { @@ -62,7 +60,7 @@ BOOST_AUTO_TEST_CASE (scaling_test) shared_ptr film = new_test_film ("scaling_test"); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); film->set_name ("scaling_test"); - shared_ptr imc = make_shared (film, "test/data/simple_testcard_640x480.png"); + shared_ptr imc (new ImageContent (film, "test/data/simple_testcard_640x480.png")); film->examine_and_add_content (imc); diff --git a/test/seek_zero_test.cc b/test/seek_zero_test.cc index c22cadb96..05bf1b5bf 100644 --- a/test/seek_zero_test.cc +++ b/test/seek_zero_test.cc @@ -23,6 +23,7 @@ * confusing things as it might in ffmpeg_seek_test). */ +#include #include "lib/film.h" #include "lib/ffmpeg_content.h" #include "lib/ratio.h" @@ -34,8 +35,6 @@ #include "lib/video_content.h" #include "lib/video_decoder.h" #include "test.h" -#include -#include #include using std::cout; @@ -43,7 +42,6 @@ using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; -using boost::make_shared; BOOST_AUTO_TEST_CASE (seek_zero_test) { @@ -51,7 +49,7 @@ BOOST_AUTO_TEST_CASE (seek_zero_test) film->set_name ("seek_zero_test"); film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); - shared_ptr content = make_shared (film, "test/data/count300bd48.m2ts"); + shared_ptr content (new FFmpegContent (film, "test/data/count300bd48.m2ts")); film->examine_and_add_content (content); wait_for_jobs (); content->video->set_scale (VideoContentScale (Ratio::from_id ("185"))); diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc index 5ece7d9cd..9791b7172 100644 --- a/test/silence_padding_test.cc +++ b/test/silence_padding_test.cc @@ -35,12 +35,10 @@ #include #include #include -#include using std::string; using boost::lexical_cast; using boost::shared_ptr; -using boost::make_shared; static void test_silence_padding (int channels) @@ -51,7 +49,7 @@ test_silence_padding (int channels) film->set_container (Ratio::from_id ("185")); film->set_name (film_name); - shared_ptr content = make_shared (film, "test/data/staircase.wav"); + shared_ptr content (new FFmpegContent (film, "test/data/staircase.wav")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/skip_frame_test.cc b/test/skip_frame_test.cc index b98b80334..8ff43a4ca 100644 --- a/test/skip_frame_test.cc +++ b/test/skip_frame_test.cc @@ -25,17 +25,15 @@ * @see test/repeat_frame_test.cc */ +#include #include "test.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/ffmpeg_content.h" #include "lib/dcp_content_type.h" #include "lib/video_content.h" -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (skip_frame_test) { @@ -43,7 +41,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test) film->set_name ("skip_frame_test"); film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test")); - shared_ptr c = make_shared (film, "test/data/count300bd48.m2ts"); + shared_ptr c (new FFmpegContent (film, "test/data/count300bd48.m2ts")); film->examine_and_add_content (c); wait_for_jobs (); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 2899d5064..123d04d95 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -31,13 +31,11 @@ #include "test.h" #include #include -#include #include using std::string; using std::list; using boost::shared_ptr; -using boost::make_shared; /** Make a very short DCP with a single subtitle from .srt with no specified fonts */ BOOST_AUTO_TEST_CASE (srt_subtitle_test) @@ -46,7 +44,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, "test/data/subrip2.srt"); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -66,7 +64,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, "test/data/subrip2.srt"); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -91,7 +89,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (true); - shared_ptr content = make_shared (film, private_data / "Ankoemmling.srt"); + shared_ptr content (new TextSubtitleContent (film, private_data / "Ankoemmling.srt")); film->examine_and_add_content (content); wait_for_jobs (); @@ -132,11 +130,11 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3) BOOST_AUTO_TEST_CASE (srt_subtitle_test4) { shared_ptr film = new_test_film ("subrip_render_test"); - shared_ptr content = make_shared (film, "test/data/subrip.srt"); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip.srt")); content->examine (shared_ptr (), true); BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds ((3 * 60) + 56.471)); - shared_ptr decoder = make_shared (content); + shared_ptr decoder (new SubRipDecoder (content)); list cts = decoder->get_text_subtitles ( ContentTimePeriod ( ContentTime::from_seconds (109), ContentTime::from_seconds (110) diff --git a/test/ssa_subtitle_test.cc b/test/ssa_subtitle_test.cc index 0bfa39e74..f6c65b1af 100644 --- a/test/ssa_subtitle_test.cc +++ b/test/ssa_subtitle_test.cc @@ -27,13 +27,11 @@ #include "test.h" #include #include -#include #include using std::string; using std::list; using boost::shared_ptr; -using boost::make_shared; /** Make a DCP with subs from a .ssa file */ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1) @@ -44,7 +42,7 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_interop (true); - shared_ptr content = make_shared (film, private_data / "DKH_UT_EN20160601def.ssa"); + shared_ptr content (new TextSubtitleContent (film, private_data / "DKH_UT_EN20160601def.ssa")); film->examine_and_add_content (content); wait_for_jobs (); diff --git a/test/test.cc b/test/test.cc index d3180434d..c7a9e95bf 100644 --- a/test/test.cc +++ b/test/test.cc @@ -40,7 +40,6 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE dcpomatic_test #include -#include #include #include #include @@ -54,7 +53,6 @@ using std::list; using std::abs; using boost::shared_ptr; using boost::scoped_array; -using boost::make_shared; boost::filesystem::path private_data = boost::filesystem::path ("..") / boost::filesystem::path ("dcpomatic-test-private"); @@ -114,7 +112,7 @@ new_test_film (string name) boost::filesystem::remove_all (p); } - shared_ptr film = boost::make_shared (p.string()); + shared_ptr film = shared_ptr (new Film (p.string())); film->write_metadata (); return film; } diff --git a/test/threed_test.cc b/test/threed_test.cc index 23236fb31..ab94cf8e5 100644 --- a/test/threed_test.cc +++ b/test/threed_test.cc @@ -29,18 +29,16 @@ #include "lib/dcp_content_type.h" #include "lib/ffmpeg_content.h" #include "lib/video_content.h" -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (threed_test) { shared_ptr film = new_test_film ("threed_test"); film->set_name ("test_film2"); - shared_ptr c = make_shared (film, "test/data/test.mp4"); + shared_ptr c (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (c); wait_for_jobs (); diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc index bf21e5476..ddd685d0c 100644 --- a/test/time_calculation_test.cc +++ b/test/time_calculation_test.cc @@ -25,12 +25,10 @@ #include "lib/audio_content.h" #include "test.h" #include -#include using std::string; using std::list; using boost::shared_ptr; -using boost::make_shared; static string const xml = "" "FFmpeg" @@ -125,11 +123,11 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test) { shared_ptr film = new_test_film ("ffmpeg_time_calculation_test"); - shared_ptr doc = make_shared (); + shared_ptr doc (new cxml::Document); doc->read_string (xml); list notes; - shared_ptr content = boost::make_shared (film, doc, film->state_version(), notes); + shared_ptr content (new FFmpegContent (film, doc, film->state_version(), notes)); /* 25fps content, 25fps DCP */ film->set_video_frame_rate (25); @@ -178,15 +176,15 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1) { shared_ptr film = new_test_film ("player_time_calculation_test1"); - shared_ptr doc = make_shared (); + shared_ptr doc (new cxml::Document); doc->read_string (xml); list notes; - shared_ptr content = boost::make_shared (film, doc, film->state_version(), notes); + shared_ptr content (new FFmpegContent (film, doc, film->state_version(), notes)); film->set_sequence (false); film->add_content (content); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); /* Position 0, no trim, content rate = DCP rate */ content->set_position (DCPTime ()); @@ -383,15 +381,15 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2) { shared_ptr film = new_test_film ("player_time_calculation_test2"); - shared_ptr doc = make_shared (); + shared_ptr doc (new cxml::Document); doc->read_string (xml); list notes; - shared_ptr content = boost::make_shared (film, doc, film->state_version(), notes); + shared_ptr content (new FFmpegContent (film, doc, film->state_version(), notes)); film->set_sequence (false); film->add_content (content); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); /* Position 0, no trim, content rate = DCP rate */ content->set_position (DCPTime ()); @@ -559,16 +557,16 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3) { shared_ptr film = new_test_film ("player_time_calculation_test3"); - shared_ptr doc = make_shared (); + shared_ptr doc (new cxml::Document); doc->read_string (xml); list notes; - shared_ptr content = boost::make_shared (film, doc, film->state_version(), notes); + shared_ptr content (new FFmpegContent (film, doc, film->state_version(), notes)); AudioStreamPtr stream = content->audio->streams().front(); film->set_sequence (false); film->add_content (content); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); /* Position 0, no trim, video/audio content rate = video/audio DCP rate */ content->set_position (DCPTime ()); diff --git a/test/upmixer_a_test.cc b/test/upmixer_a_test.cc index 4c611c37e..e0117c734 100644 --- a/test/upmixer_a_test.cc +++ b/test/upmixer_a_test.cc @@ -18,6 +18,8 @@ */ +#include +#include #include "lib/film.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" @@ -26,12 +28,8 @@ #include "lib/audio_buffers.h" #include "lib/upmixer_a.h" #include "test.h" -#include -#include -#include using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (upmixer_a_test) { @@ -40,7 +38,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); film->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a")); - shared_ptr content = make_shared (film, "test/data/white.wav"); + shared_ptr content (new FFmpegContent (film, "test/data/white.wav")); film->examine_and_add_content (content); wait_for_jobs (); @@ -56,7 +54,7 @@ BOOST_AUTO_TEST_CASE (upmixer_a_test) SNDFILE* Ls = sf_open ("build/test/upmixer_a_test/Ls.wav", SFM_WRITE, &info); SNDFILE* Rs = sf_open ("build/test/upmixer_a_test/Rs.wav", SFM_WRITE, &info); - shared_ptr player = make_shared (film, film->playlist ()); + shared_ptr player (new Player (film, film->playlist ())); for (DCPTime t; t < film->length(); t += DCPTime::from_seconds (1)) { shared_ptr b = player->get_audio (t, DCPTime::from_seconds (1), true); sf_write_float (L, b->data(0), b->frames()); diff --git a/test/vf_test.cc b/test/vf_test.cc index 480df0bd7..ae7c30be3 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -24,18 +24,16 @@ #include "test.h" #include #include -#include using std::list; using std::string; using boost::shared_ptr; -using boost::make_shared; /** Test the logic which decides whether a DCP can be referenced or not */ BOOST_AUTO_TEST_CASE (vf_test1) { shared_ptr film = new_test_film ("vf_test1"); - shared_ptr dcp = make_shared (film, "test/data/reels_test2"); + shared_ptr dcp (new DCPContent (film, "test/data/reels_test2")); film->examine_and_add_content (dcp); wait_for_jobs (); @@ -53,7 +51,7 @@ BOOST_AUTO_TEST_CASE (vf_test1) /* (but reels_test2 has no subtitles to reference) */ BOOST_CHECK (!dcp->can_reference_subtitle(why_not)); - shared_ptr other = make_shared (film, "test/data/test.mp4"); + shared_ptr other (new FFmpegContent (film, "test/data/test.mp4")); film->examine_and_add_content (other); wait_for_jobs (); diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index f1edce041..6f5d85a11 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -18,17 +18,15 @@ */ +#include #include "lib/ffmpeg_content.h" #include "lib/ratio.h" #include "lib/video_content.h" -#include -#include using std::list; using std::string; using std::cerr; using boost::shared_ptr; -using boost::make_shared; using boost::optional; static @@ -88,11 +86,11 @@ test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop "0" ""; - shared_ptr doc = make_shared (); + shared_ptr doc (new cxml::Document ()); doc->read_string(s.str ()); list notes; - shared_ptr vc = boost::make_shared (film, doc, 10, notes); + shared_ptr vc (new FFmpegContent (film, doc, 10, notes)); optional sc; if (ratio) { diff --git a/test/video_decoder_fill_test.cc b/test/video_decoder_fill_test.cc index 8aa5e830f..2d783f52d 100644 --- a/test/video_decoder_fill_test.cc +++ b/test/video_decoder_fill_test.cc @@ -18,25 +18,23 @@ */ +#include #include "lib/image_decoder.h" #include "lib/image_content.h" #include "lib/content_video.h" #include "lib/video_decoder.h" #include "lib/film.h" #include "test.h" -#include -#include #include using std::list; using std::cout; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (video_decoder_fill_test1) { shared_ptr film = new_test_film ("video_decoder_fill_test"); - shared_ptr c = make_shared (film, "test/data/simple_testcard_640x480.png"); + shared_ptr c (new ImageContent (film, "test/data/simple_testcard_640x480.png")); ImageDecoder decoder (c, film->log()); decoder.video->fill_one_eye (0, 4, EYES_BOTH); @@ -61,7 +59,7 @@ BOOST_AUTO_TEST_CASE (video_decoder_fill_test1) BOOST_AUTO_TEST_CASE (video_decoder_fill_test2) { shared_ptr film = new_test_film ("video_decoder_fill_test"); - shared_ptr c = make_shared (film, "test/data/simple_testcard_640x480.png"); + shared_ptr c (new ImageContent (film, "test/data/simple_testcard_640x480.png")); ImageDecoder decoder (c, film->log()); decoder.video->fill_both_eyes (VideoFrame (0, EYES_LEFT), VideoFrame (4, EYES_LEFT)); diff --git a/test/video_mxf_content_test.cc b/test/video_mxf_content_test.cc index 4759cb69c..953e9b7b7 100644 --- a/test/video_mxf_content_test.cc +++ b/test/video_mxf_content_test.cc @@ -26,10 +26,8 @@ #include "test.h" #include #include -#include using boost::shared_ptr; -using boost::make_shared; using boost::dynamic_pointer_cast; static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_a41afbff-e1ad-41c4-9a84-de315b95dd0f.mxf"; @@ -55,9 +53,9 @@ BOOST_AUTO_TEST_CASE (video_mxf_content_test) film->make_dcp (); wait_for_jobs (); - shared_ptr ref = make_shared (ref_mxf); + shared_ptr ref (new dcp::MonoPictureAsset (ref_mxf)); boost::filesystem::directory_iterator i ("build/test/video_mxf_content_test/video"); - shared_ptr comp = make_shared (*i); + shared_ptr comp (new dcp::MonoPictureAsset (*i)); dcp::EqualityOptions op; BOOST_CHECK (ref->equals (comp, op, note)); } diff --git a/test/xml_subtitle_test.cc b/test/xml_subtitle_test.cc index 408d46b62..678f2b8d0 100644 --- a/test/xml_subtitle_test.cc +++ b/test/xml_subtitle_test.cc @@ -22,19 +22,17 @@ * @brief Test creation of XML DCP subtitles. */ +#include #include "lib/text_subtitle_content.h" #include "lib/film.h" #include "lib/ratio.h" #include "lib/dcp_content_type.h" #include "lib/subtitle_content.h" #include "test.h" -#include -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; /** Build a small DCP with no picture and a single subtitle overlaid onto it */ BOOST_AUTO_TEST_CASE (xml_subtitle_test) @@ -43,7 +41,7 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test) film->set_container (Ratio::from_id ("185")); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR")); film->set_name ("frobozz"); - shared_ptr content = make_shared (film, "test/data/subrip2.srt"); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); content->subtitle->set_use (true); content->subtitle->set_burn (false); film->examine_and_add_content (content); @@ -64,7 +62,7 @@ BOOST_AUTO_TEST_CASE (xml_subtitle_test2) film->set_name ("frobozz"); film->set_interop (true); film->set_sequence (false); - shared_ptr content = make_shared (film, "test/data/subrip2.srt"); + shared_ptr content (new TextSubtitleContent (film, "test/data/subrip2.srt")); content->subtitle->set_use (true); content->subtitle->set_burn (false); film->examine_and_add_content (content); -- 2.30.2