summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-04-12 22:10:54 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit6f344b876689a1234a5eb75041882f06f5d9fe5c (patch)
tree3a51f17cab8b8f31b21661b643aaed6a53326031 /src/lib/ffmpeg_content.cc
parent36774ee2b48f0bfde43b743592e5816ff58bb7d2 (diff)
Reasonably straightforward stuff; main things are adding
a _parent to VideoContent (mainly, but not only, for signalling) and moving the video shared_ptr into Content, which makes much more sense to replace dynamic_cast tests for whether something has video or whatever. Nearly builds.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 54e0b470a..a8b7fb716 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -63,8 +63,9 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, boost::filesystem::pa
: Content (film, p)
, AudioContent (film, p)
, SubtitleContent (film, p)
- , video (new VideoContent (film))
{
+ video.reset (new VideoContent (this, film));
+
set_default_colour_conversion ();
}
@@ -72,8 +73,9 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr no
: Content (film, node)
, AudioContent (film, node)
, SubtitleContent (film, node, version)
- , video (new VideoContent (film, node, version))
{
+ video.reset (new VideoContent (this, film, node, version));
+
list<cxml::NodePtr> c = node->node_children ("SubtitleStream");
for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
_subtitle_streams.push_back (shared_ptr<FFmpegSubtitleStream> (new FFmpegSubtitleStream (*i, version)));
@@ -120,8 +122,9 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<boost::shared_
: Content (film, c)
, AudioContent (film, c)
, SubtitleContent (film, c)
- , video (new VideoContent (film, c))
{
+ video.reset (new VideoContent (this, film, c));
+
shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
DCPOMATIC_ASSERT (ref);
@@ -194,7 +197,7 @@ FFmpegContent::examine (shared_ptr<Job> job)
Content::examine (job);
shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this (), job));
- take_from_video_examiner (examiner);
+ video->take_from_video_examiner (examiner);
set_default_colour_conversion ();
{
@@ -287,8 +290,8 @@ operator!= (FFmpegStream const & a, FFmpegStream const & b)
DCPTime
FFmpegContent::full_length () const
{
- FrameRateChange const frc (video_frame_rate (), film()->video_frame_rate ());
- return DCPTime::from_frames (llrint (video_length_after_3d_combine() * frc.factor()), film()->video_frame_rate());
+ FrameRateChange const frc (video->video_frame_rate (), film()->video_frame_rate ());
+ return DCPTime::from_frames (llrint (video->video_length_after_3d_combine() * frc.factor()), film()->video_frame_rate());
}
void
@@ -373,14 +376,14 @@ FFmpegContent::has_text_subtitles () const
void
FFmpegContent::set_default_colour_conversion ()
{
- dcp::Size const s = video_size ();
+ dcp::Size const s = video->video_size ();
boost::mutex::scoped_lock lm (_mutex);
if (s.width < 1080) {
- _colour_conversion = PresetColourConversion::from_id ("rec601").conversion;
+ video->set_colour_conversion (PresetColourConversion::from_id ("rec601").conversion);
} else {
- _colour_conversion = PresetColourConversion::from_id ("rec709").conversion;
+ video->set_colour_conversion (PresetColourConversion::from_id ("rec709").conversion);
}
}