summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-04-12 16:43:45 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-18 11:50:29 +0100
commit36774ee2b48f0bfde43b743592e5816ff58bb7d2 (patch)
tree1974d8e7e1b05338429bd40da57092d6e5a0e59a /src/lib
parent3ef438f90729d78ad579bbeb7933b3cf4f09c10c (diff)
Innocuous build fixes.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/dcp_content.cc12
-rw-r--r--src/lib/dcp_content.h6
-rw-r--r--src/lib/dcp_decoder.cc10
-rw-r--r--src/lib/ffmpeg_content.cc6
-rw-r--r--src/lib/ffmpeg_content.h6
-rw-r--r--src/lib/user_property.h7
-rw-r--r--src/lib/video_content.h7
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> job)
Content::examine (job);
shared_ptr<DCPExaminer> 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<string>& why_not) const
return can_reference<SubtitleContent> (_("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<std::string> &) const;
+ boost::shared_ptr<VideoContent> video;
+
protected:
void add_properties (std::list<UserProperty>& 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<const DCPContent> 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<ContentTimePeriod> ctp;
- double const vfr = _dcp_content->video_frame_rate ();
+ double const vfr = _dcp_content->video->video_frame_rate ();
BOOST_FOREACH (shared_ptr<dcp::Reel> 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<Filter const *> 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 <boost/thread/mutex.hpp>
+#include <boost/weak_ptr.hpp>
class VideoExaminer;
class Ratio;
+class Film;
class VideoContentProperty
{
@@ -174,7 +179,7 @@ private:
void add_properties (std::list<UserProperty> &) const;
boost::weak_ptr<const Film> _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<double> _video_frame_rate;