diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-04-12 16:33:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | 3ef438f90729d78ad579bbeb7933b3cf4f09c10c (patch) | |
| tree | 9ecb2d9657986395570b0239486dfa0efdb01f55 /src | |
| parent | 500a503a982e8e62884035e156e47ed61a20ef85 (diff) | |
Basic detach of FFmpegContent, ImageContent, DCPContent
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/dcp_content.cc | 15 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 5 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 20 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 6 | ||||
| -rw-r--r-- | src/lib/image_content.cc | 15 | ||||
| -rw-r--r-- | src/lib/image_content.h | 9 |
6 files changed, 42 insertions, 28 deletions
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 8698c4ecd..5bd6e1e33 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ */ #include "dcp_content.h" +#include "video_content.h" #include "dcp_examiner.h" #include "job.h" #include "film.h" @@ -52,9 +53,9 @@ int const DCPContentProperty::REFERENCE_SUBTITLE = 603; DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p) : Content (film) - , VideoContent (film) , SingleStreamAudioContent (film) , SubtitleContent (film) + , video (new VideoContent (film)) , _has_subtitles (false) , _encrypted (false) , _kdm_valid (false) @@ -63,13 +64,14 @@ DCPContent::DCPContent (shared_ptr<const Film> film, boost::filesystem::path p) , _reference_subtitle (false) { read_directory (p); + set_default_colour_conversion (); } DCPContent::DCPContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version) : Content (film, node) - , VideoContent (film, node, version) , SingleStreamAudioContent (film, node, version) , SubtitleContent (film, node, version) + , video (new VideoContent (film, node, version)) { _name = node->string_child ("Name"); _has_subtitles = node->bool_child ("HasSubtitles"); @@ -105,6 +107,7 @@ DCPContent::examine (shared_ptr<Job> job) shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ())); take_from_video_examiner (examiner); + set_default_colour_conversion (); take_from_audio_examiner (examiner); { @@ -131,7 +134,7 @@ string DCPContent::technical_summary () const { return Content::technical_summary() + " - " - + VideoContent::technical_summary() + " - " + + video->technical_summary() + " - " + AudioContent::technical_summary() + " - "; } @@ -141,7 +144,7 @@ DCPContent::as_xml (xmlpp::Node* node) const node->add_child("Type")->add_child_text ("DCP"); Content::as_xml (node); - VideoContent::as_xml (node); + video->as_xml (node); SingleStreamAudioContent::as_xml (node); SubtitleContent::as_xml (node); @@ -169,7 +172,7 @@ string DCPContent::identifier () const { SafeStringStream s; - s << VideoContent::identifier() << "_" << SubtitleContent::identifier () << " " + s << Content::identifier() << "_" << video->identifier() << "_" << SubtitleContent::identifier () << " " << (_reference_video ? "1" : "0") << (_reference_subtitle ? "1" : "0"); return s.str (); diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index 26c1802ba..f4445ad53 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ * @brief DCPContent class. */ -#include "video_content.h" #include "single_stream_audio_content.h" #include "subtitle_content.h" #include <libcxml/cxml.h> @@ -42,7 +41,7 @@ public: /** @class DCPContent * @brief An existing DCP used as input. */ -class DCPContent : public VideoContent, public SingleStreamAudioContent, public SubtitleContent +class DCPContent : public SingleStreamAudioContent, public SubtitleContent { public: DCPContent (boost::shared_ptr<const Film>, boost::filesystem::path p); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 8452d65ee..8d9aa195a 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -18,6 +18,7 @@ */ #include "ffmpeg_content.h" +#include "video_content.h" #include "ffmpeg_examiner.h" #include "ffmpeg_subtitle_stream.h" #include "ffmpeg_audio_stream.h" @@ -60,18 +61,18 @@ int const FFmpegContentProperty::FILTERS = 102; FFmpegContent::FFmpegContent (shared_ptr<const Film> film, boost::filesystem::path p) : Content (film, p) - , VideoContent (film, p) , AudioContent (film, p) , SubtitleContent (film, p) + , video (new VideoContent (film)) { - + set_default_colour_conversion (); } FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, list<string>& notes) : Content (film, node) - , VideoContent (film, node, version) , AudioContent (film, node) , SubtitleContent (film, node, version) + , video (new VideoContent (film, node, version)) { list<cxml::NodePtr> c = node->node_children ("SubtitleStream"); for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) { @@ -117,9 +118,9 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr no FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<boost::shared_ptr<Content> > c) : Content (film, c) - , VideoContent (film, c) , AudioContent (film, c) , SubtitleContent (film, c) + , video (new VideoContent (film, c)) { shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]); DCPOMATIC_ASSERT (ref); @@ -150,7 +151,7 @@ FFmpegContent::as_xml (xmlpp::Node* node) const { node->add_child("Type")->add_child_text ("FFmpeg"); Content::as_xml (node); - VideoContent::as_xml (node); + video->as_xml (node); AudioContent::as_xml (node); SubtitleContent::as_xml (node); @@ -194,6 +195,7 @@ FFmpegContent::examine (shared_ptr<Job> job) shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this (), job)); take_from_video_examiner (examiner); + set_default_colour_conversion (); { boost::mutex::scoped_lock lm (_mutex); @@ -252,7 +254,7 @@ FFmpegContent::technical_summary () const string filt = Filter::ffmpeg_string (_filters); return Content::technical_summary() + " - " - + VideoContent::technical_summary() + " - " + + video->technical_summary() + " - " + AudioContent::technical_summary() + " - " + String::compose ( "ffmpeg: audio %1 subtitle %2 filters %3", as, ss, filt @@ -305,7 +307,8 @@ FFmpegContent::identifier () const { SafeStringStream s; - s << VideoContent::identifier() << "_" + s << Content::identifier() << "_" + << video->identifier() << "_" << SubtitleContent::identifier(); boost::mutex::scoped_lock lm (_mutex); @@ -394,7 +397,8 @@ FFmpegContent::audio_streams () const void FFmpegContent::add_properties (list<UserProperty>& p) const { - VideoContent::add_properties (p); + Content::add_properties (p); + video->add_properties (p); AudioContent::add_properties (p); if (_bits_per_pixel) { diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index e9cb3dacf..9f82be9c3 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -20,7 +20,6 @@ #ifndef DCPOMATIC_FFMPEG_CONTENT_H #define DCPOMATIC_FFMPEG_CONTENT_H -#include "video_content.h" #include "audio_content.h" #include "subtitle_content.h" @@ -30,6 +29,7 @@ struct AVStream; class Filter; class FFmpegSubtitleStream; class FFmpegAudioStream; +class VideoContent; struct ffmpeg_pts_offset_test; struct audio_sampling_rate_test; @@ -42,7 +42,7 @@ public: static int const FILTERS; }; -class FFmpegContent : public VideoContent, public AudioContent, public SubtitleContent +class FFmpegContent : public AudioContent, public SubtitleContent { public: FFmpegContent (boost::shared_ptr<const Film>, boost::filesystem::path); @@ -108,6 +108,8 @@ public: void signal_subtitle_stream_changed (); + boost::shared_ptr<VideoContent> video; + protected: void add_properties (std::list<UserProperty> &) const; diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index c415f933d..ed290dd6c 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -18,6 +18,7 @@ */ #include "image_content.h" +#include "video_content.h" #include "image_examiner.h" #include "compose.hpp" #include "film.h" @@ -39,7 +40,7 @@ using boost::shared_ptr; ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path p) : Content (film) - , VideoContent (film) + , video (new VideoContent (film)) { if (boost::filesystem::is_regular_file (p) && valid_image_file (p)) { _paths.push_back (p); @@ -56,12 +57,14 @@ ImageContent::ImageContent (shared_ptr<const Film> film, boost::filesystem::path sort (_paths.begin(), _paths.end(), ImageFilenameSorter ()); } + + set_default_colour_conversion (); } ImageContent::ImageContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version) : Content (film, node) - , VideoContent (film, node, version) + , video (new VideoContent (film, node, version)) { } @@ -84,7 +87,7 @@ string ImageContent::technical_summary () const { string s = Content::technical_summary() + " - " - + VideoContent::technical_summary() + " - "; + + video->technical_summary() + " - "; if (still ()) { s += _("still"); @@ -100,7 +103,7 @@ ImageContent::as_xml (xmlpp::Node* node) const { node->add_child("Type")->add_child_text ("Image"); Content::as_xml (node); - VideoContent::as_xml (node); + video->as_xml (node); } void @@ -113,6 +116,7 @@ ImageContent::examine (shared_ptr<Job> job) shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job)); take_from_video_examiner (examiner); + set_default_colour_conversion (); } void @@ -139,7 +143,8 @@ string ImageContent::identifier () const { SafeStringStream s; - s << VideoContent::identifier (); + s << Content::identifier(); + s << "_" << video->identifier (); s << "_" << video_length(); return s.str (); } diff --git a/src/lib/image_content.h b/src/lib/image_content.h index a4968ea8b..353ce8370 100644 --- a/src/lib/image_content.h +++ b/src/lib/image_content.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,9 +20,9 @@ #ifndef DCPOMATIC_IMAGE_CONTENT_H #define DCPOMATIC_IMAGE_CONTENT_H -#include "video_content.h" +#include "content.h" -class ImageContent : public VideoContent +class ImageContent : public Content { public: ImageContent (boost::shared_ptr<const Film>, boost::filesystem::path); @@ -40,11 +40,12 @@ public: std::string identifier () const; - /* VideoContent */ void set_default_colour_conversion (); void set_video_length (Frame); bool still () const; + + boost::shared_ptr<VideoContent> video; }; #endif |
