From 36774ee2b48f0bfde43b743592e5816ff58bb7d2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 12 Apr 2016 16:43:45 +0100 Subject: [PATCH] Innocuous build fixes. --- src/lib/dcp_content.cc | 12 +++++++++--- src/lib/dcp_content.h | 6 +++--- src/lib/dcp_decoder.cc | 10 +++++----- src/lib/ffmpeg_content.cc | 6 ++++++ src/lib/ffmpeg_content.h | 6 ++---- src/lib/user_property.h | 7 +++++++ src/lib/video_content.h | 7 ++++++- 7 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 5bd6e1e33..3bc28598d 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -106,7 +106,7 @@ DCPContent::examine (shared_ptr job) Content::examine (job); shared_ptr examiner (new DCPExaminer (shared_from_this ())); - take_from_video_examiner (examiner); + video->take_from_video_examiner (examiner); set_default_colour_conversion (); take_from_audio_examiner (examiner); @@ -164,7 +164,7 @@ DCPContent::as_xml (xmlpp::Node* node) const DCPTime DCPContent::full_length () const { - FrameRateChange const frc (video_frame_rate (), film()->video_frame_rate ()); + FrameRateChange const frc (video->video_frame_rate (), film()->video_frame_rate ()); return DCPTime::from_frames (llrint (video_length () * frc.factor ()), film()->video_frame_rate ()); } @@ -217,7 +217,7 @@ void DCPContent::set_default_colour_conversion () { /* Default to no colour conversion for DCPs */ - unset_colour_conversion (); + video->unset_colour_conversion (); } void @@ -344,3 +344,9 @@ DCPContent::can_reference_subtitle (list& why_not) const return can_reference (_("There is other subtitle content overlapping this DCP; remove it."), why_not); } + +double +DCPContent::subtitle_video_frame_rate () const +{ + return video->video_frame_rate (); +} diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index f4445ad53..04352b269 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -77,9 +77,7 @@ public: return false; } - double subtitle_video_frame_rate () const { - return video_frame_rate (); - } + double subtitle_video_frame_rate () const; boost::filesystem::path directory () const; @@ -123,6 +121,8 @@ public: bool can_reference_subtitle (std::list &) const; + boost::shared_ptr video; + protected: void add_properties (std::list& p) const; diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index f58577c8c..873b3634f 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -43,7 +43,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; DCPDecoder::DCPDecoder (shared_ptr c, bool fast) - : VideoDecoder (c) + : VideoDecoder (c->video) , AudioDecoder (c, fast) , SubtitleDecoder (c) , _dcp_content (c) @@ -73,7 +73,7 @@ DCPDecoder::pass (PassReason reason, bool) ++i; } - double const vfr = _dcp_content->video_frame_rate (); + double const vfr = _dcp_content->video->video_frame_rate (); /* Frame within the (played part of the) reel that is coming up next */ int64_t const frame = _next.frames_round (vfr); @@ -156,8 +156,8 @@ DCPDecoder::seek (ContentTime t, bool accurate) SubtitleDecoder::seek (t, accurate); _reel = _reels.begin (); - while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video_frame_rate ())) { - t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video_frame_rate ()); + while (_reel != _reels.end() && t >= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video->video_frame_rate ())) { + t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->video->video_frame_rate ()); ++_reel; } @@ -177,7 +177,7 @@ DCPDecoder::text_subtitles_during (ContentTimePeriod period, bool starting) cons /* XXX: inefficient */ list ctp; - double const vfr = _dcp_content->video_frame_rate (); + double const vfr = _dcp_content->video->video_frame_rate (); BOOST_FOREACH (shared_ptr r, _reels) { if (!r->main_subtitle ()) { diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 8d9aa195a..54e0b470a 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -523,3 +523,9 @@ FFmpegContent::signal_subtitle_stream_changed () { signal_changed (FFmpegContentProperty::SUBTITLE_STREAM); } + +double +FFmpegContent::subtitle_video_frame_rate () const +{ + return video->video_frame_rate (); +} diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 9f82be9c3..f5bbbd31e 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -33,7 +33,7 @@ class VideoContent; struct ffmpeg_pts_offset_test; struct audio_sampling_rate_test; -class FFmpegContentProperty : public VideoContentProperty +class FFmpegContentProperty { public: static int const SUBTITLE_STREAMS; @@ -70,9 +70,7 @@ public: /* SubtitleContent */ bool has_text_subtitles () const; bool has_image_subtitles () const; - double subtitle_video_frame_rate () const { - return video_frame_rate (); - } + double subtitle_video_frame_rate () const; void set_filters (std::vector const &); diff --git a/src/lib/user_property.h b/src/lib/user_property.h index c57cbef3e..b269c9a8e 100644 --- a/src/lib/user_property.h +++ b/src/lib/user_property.h @@ -17,6 +17,11 @@ */ +#ifndef DCPOMATIC_USER_PROPERTY_H +#define DCPOMATIC_USER_PROPERTY_H + +#include "raw_convert.h" + class UserProperty { public: @@ -33,3 +38,5 @@ public: std::string value; std::string unit; }; + +#endif diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 9577d2d85..b93744053 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -22,9 +22,14 @@ #include "colour_conversion.h" #include "video_content_scale.h" +#include "dcpomatic_time.h" +#include "user_property.h" +#include +#include class VideoExaminer; class Ratio; +class Film; class VideoContentProperty { @@ -174,7 +179,7 @@ private: void add_properties (std::list &) const; boost::weak_ptr _film; - boost::mutex _mutex; + mutable boost::mutex _mutex; Frame _video_length; /** Video frame rate, or not set if this content should use the DCP's frame rate */ boost::optional _video_frame_rate; -- 2.30.2