int const AudioContentProperty::STREAMS = 200;
int const AudioContentProperty::GAIN = 201;
int const AudioContentProperty::DELAY = 202;
-int const AudioContentProperty::VIDEO_FRAME_RATE = 203;
AudioContent::AudioContent (Content* parent, shared_ptr<const Film> film)
: ContentPart (parent, film)
{
_gain = node->number_child<double> ("AudioGain");
_delay = node->number_child<int> ("AudioDelay");
- _video_frame_rate = node->optional_number_child<double> ("AudioVideoFrameRate");
+
+ /* Backwards compatibility */
+ optional<double> r = node->optional_number_child<double> ("AudioVideoFrameRate");
+ if (r) {
+ _parent->set_video_frame_rate (r.get ());
+ }
}
AudioContent::AudioContent (Content* parent, shared_ptr<const Film> film, vector<shared_ptr<Content> > c)
if (c[i]->audio->delay() != ref->delay()) {
throw JoinError (_("Content to be joined must have the same audio delay."));
}
-
- if (c[i]->audio->video_frame_rate() != ref->video_frame_rate()) {
- throw JoinError (_("Content to be joined must have the same video frame rate."));
- }
}
_gain = ref->gain ();
_delay = ref->delay ();
- /* Preserve the optional<> part of this */
- _video_frame_rate = ref->_video_frame_rate;
_streams = ref->streams ();
}
boost::mutex::scoped_lock lm (_mutex);
node->add_child("AudioGain")->add_child_text (raw_convert<string> (_gain));
node->add_child("AudioDelay")->add_child_text (raw_convert<string> (_delay));
- if (_video_frame_rate) {
- node->add_child("AudioVideoFrameRate")->add_child_text (raw_convert<string> (_video_frame_rate.get()));
- }
}
void
shared_ptr<const Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
- FrameRateChange frc (video_frame_rate(), film->video_frame_rate());
+ FrameRateChange frc (_parent->active_video_frame_rate(), film->video_frame_rate());
/* Compensate if the DCP is being run at a different frame rate
to the source; that is, if the video is run such that it will
shared_ptr<const Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
- FrameRateChange const frc (video_frame_rate(), film->video_frame_rate());
+ FrameRateChange const frc (_parent->active_video_frame_rate(), film->video_frame_rate());
ContentTime const c (_parent->full_length(), frc);
p.push_back (
}
}
-void
-AudioContent::set_video_frame_rate (double r)
-{
- maybe_set (_video_frame_rate, r, AudioContentProperty::VIDEO_FRAME_RATE);
-}
-
-double
-AudioContent::video_frame_rate () const
-{
- {
- boost::mutex::scoped_lock lm (_mutex);
- if (_video_frame_rate) {
- return _video_frame_rate.get ();
- }
- }
-
- /* No frame rate specified, so assume this content has been
- prepared for any concurrent video content.
- */
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
- return film->active_frame_rate_change(_parent->position()).source;
-}
-
void
AudioContent::set_streams (vector<AudioStreamPtr> streams)
{
static int const STREAMS;
static int const GAIN;
static int const DELAY;
- static int const VIDEO_FRAME_RATE;
};
class AudioContent : public ContentPart
return _delay;
}
- double video_frame_rate () const;
- void set_video_frame_rate (double r);
-
std::string processing_description () const;
std::vector<AudioStreamPtr> streams () const {
double _gain;
/** Delay to apply to audio (positive moves audio later) in milliseconds */
int _delay;
- boost::optional<double> _video_frame_rate;
std::vector<AudioStreamPtr> _streams;
};
public:
AudioDecoder (boost::shared_ptr<const AudioContent>, bool fast, boost::shared_ptr<Log> log);
- boost::shared_ptr<const AudioContent> audio_content () const {
- return _audio_content;
- }
-
/** Try to fetch some audio from a specific place in this content.
* @param frame Frame to start from (after resampling, if applicable)
* @param length Frames to get (after resampling, if applicable)
int const ContentProperty::LENGTH = 402;
int const ContentProperty::TRIM_START = 403;
int const ContentProperty::TRIM_END = 404;
+int const ContentProperty::VIDEO_FRAME_RATE = 405;
Content::Content (shared_ptr<const Film> film)
: _film (film)
{
try {
emit (boost::bind (boost::ref (Changed), shared_from_this (), p, _change_signals_frequent));
- changed (p);
} catch (boost::bad_weak_ptr) {
/* This must be during construction; never mind */
}
t.push_back (position().round_up (film()->video_frame_rate()));
return t;
}
+
+void
+Content::set_video_frame_rate (double r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _video_frame_rate = r;
+ }
+
+ signal_changed (ContentProperty::VIDEO_FRAME_RATE);
+}
+
+double
+Content::active_video_frame_rate () const
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_video_frame_rate) {
+ return _video_frame_rate.get ();
+ }
+ }
+
+ /* No frame rate specified, so assume this content has been
+ prepared for any concurrent video content or perhaps
+ just the DCP rate.
+ */
+ shared_ptr<const Film> film = _film.lock ();
+ DCPOMATIC_ASSERT (film);
+ return film->active_frame_rate_change(position()).source;
+}
static int const LENGTH;
static int const TRIM_START;
static int const TRIM_END;
+ static int const VIDEO_FRAME_RATE;
};
/** @class Content
*/
virtual std::list<DCPTime> reel_split_points () const;
- virtual void changed (int) {}
-
boost::shared_ptr<Content> clone () const;
void set_path (boost::filesystem::path);
DCPTime length_after_trim () const;
+ boost::optional<double> video_frame_rate () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _video_frame_rate;
+ }
+
+ void set_video_frame_rate (double r);
+
+ double active_video_frame_rate () const;
+
void set_change_signals_frequent (bool f) {
_change_signals_frequent = f;
}
std::vector<boost::filesystem::path> _paths;
private:
+ friend struct ffmpeg_pts_offset_test;
+ friend struct best_dcp_frame_rate_test_single;
+ friend struct best_dcp_frame_rate_test_double;
+ friend struct audio_sampling_rate_test;
+
std::string _digest;
DCPTime _position;
ContentTime _trim_start;
ContentTime _trim_end;
+ /** The video frame rate that this content is or was prepared to be used with,
+ * or empty if the effective rate of this content should be dictated by something
+ * else (either some video happening at the same time, or the rate of the DCP).
+ */
+ boost::optional<double> _video_frame_rate;
bool _change_signals_frequent;
};
DCPTime
DCPContent::full_length () const
{
- FrameRateChange const frc (video->frame_rate (), film()->video_frame_rate ());
+ FrameRateChange const frc (active_video_frame_rate (), film()->video_frame_rate ());
return DCPTime::from_frames (llrint (video->length () * frc.factor ()), film()->video_frame_rate ());
}
/* XXX: this needs to be fixed */
return true;
}
-
-void
-DCPContent::changed (int property)
-{
- if (property == VideoContentProperty::FRAME_RATE && subtitle) {
- subtitle->set_video_frame_rate (video->frame_rate ());
- }
-}
void set_default_colour_conversion ();
std::list<DCPTime> reel_split_points () const;
- void changed (int property);
-
boost::filesystem::path directory () const;
bool encrypted () const {
using boost::dynamic_pointer_cast;
DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log, bool fast)
- : VideoDecoder (c->video, log)
+ : VideoDecoder (c, log)
, AudioDecoder (c->audio, fast, log)
, SubtitleDecoder (c->subtitle)
, _dcp_content (c)
++i;
}
- double const vfr = _dcp_content->video->frame_rate ();
+ double const vfr = _dcp_content->active_video_frame_rate ();
/* Frame within the (played part of the) reel that is coming up next */
int64_t const frame = _next.frames_round (vfr);
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->active_video_frame_rate ())) {
+ t -= ContentTime::from_frames ((*_reel)->main_picture()->duration(), _dcp_content->active_video_frame_rate ());
++_reel;
}
/* XXX: inefficient */
list<ContentTimePeriod> ctp;
- double const vfr = _dcp_content->video->frame_rate ();
+ double const vfr = _dcp_content->active_video_frame_rate ();
BOOST_FOREACH (shared_ptr<dcp::Reel> r, _reels) {
if (!r->main_subtitle ()) {
shared_ptr<dcp::SMPTESubtitleAsset> smpte = dynamic_pointer_cast<dcp::SMPTESubtitleAsset> (sc);
if (smpte) {
subtitle->set_language (smpte->language().get_value_or (""));
- subtitle->set_video_frame_rate (smpte->edit_rate().numerator);
+ set_video_frame_rate (smpte->edit_rate().numerator);
}
_length = ContentTime::from_seconds (sc->latest_subtitle_out().as_seconds ());
DCPTime
DCPSubtitleContent::full_length () const
{
- FrameRateChange const frc (subtitle->video_frame_rate(), film()->video_frame_rate());
+ FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate());
return DCPTime (_length, frc);
}
DCPTime
FFmpegContent::full_length () const
{
- FrameRateChange const frc (video->frame_rate (), film()->video_frame_rate ());
+ FrameRateChange const frc (active_video_frame_rate (), film()->video_frame_rate ());
return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor()), film()->video_frame_rate());
}
signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
-void
-FFmpegContent::changed (int property)
-{
- if (property == VideoContentProperty::FRAME_RATE && subtitle) {
- subtitle->set_video_frame_rate (video->frame_rate ());
- }
-}
-
vector<shared_ptr<FFmpegAudioStream> >
FFmpegContent::ffmpeg_audio_streams () const
{
void set_filters (std::vector<Filter const *> const &);
- void changed (int property);
-
std::vector<boost::shared_ptr<FFmpegSubtitleStream> > subtitle_streams () const {
boost::mutex::scoped_lock lm (_mutex);
return _subtitle_streams;
using dcp::Size;
FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log> log, bool fast)
- : VideoDecoder (c->video, log)
+ : VideoDecoder (c, log)
, AudioDecoder (c->audio, fast, log)
, SubtitleDecoder (c->subtitle)
, FFmpeg (c)
, _log (log)
- , _pts_offset (pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->video->frame_rate()))
+ , _pts_offset (pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->active_video_frame_rate()))
{
}
double const pts = i->second * av_q2d (_format_context->streams[_video_stream]->time_base) + _pts_offset.seconds ();
video (
shared_ptr<ImageProxy> (new RawImageProxy (image)),
- llrint (pts * _ffmpeg_content->video->frame_rate ())
+ llrint (pts * _ffmpeg_content->active_video_frame_rate ())
);
} else {
LOG_WARNING_NC ("Dropping frame without PTS");
{
_dirty = true;
- if (p == VideoContentProperty::FRAME_RATE) {
+ if (p == ContentProperty::VIDEO_FRAME_RATE) {
set_video_frame_rate (_playlist->best_dcp_frame_rate ());
} else if (p == AudioContentProperty::STREAMS) {
signal_changed (NAME);
{
shared_ptr<const Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
- FrameRateChange const frc (video->frame_rate(), film->video_frame_rate());
+ FrameRateChange const frc (active_video_frame_rate(), film->video_frame_rate());
return DCPTime::from_frames (llrint (video->length_after_3d_combine() * frc.factor ()), film->video_frame_rate ());
}
using dcp::Size;
ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c, shared_ptr<Log> log)
- : VideoDecoder (c->video, log)
+ : VideoDecoder (c, log)
, _image_content (c)
, _video_position (0)
{
ImageDecoder::seek (ContentTime time, bool accurate)
{
VideoDecoder::seek (time, accurate);
- _video_position = time.frames_round (_image_content->video->frame_rate ());
+ _video_position = time.frames_round (_image_content->active_video_frame_rate ());
}
optional<double>
ImageExaminer::video_frame_rate () const
{
- if (_image_content->video->has_own_frame_rate()) {
+ if (_image_content->video_frame_rate()) {
/* The content already knows what frame rate it should be */
- return _image_content->video->frame_rate();
+ return _image_content->video_frame_rate().get();
}
/* Don't know */
static bool
has_video (Content* c)
{
- return c->video;
+ return static_cast<bool>(c->video);
}
static bool
has_audio (Content* c)
{
- return c->audio;
+ return static_cast<bool>(c->audio);
}
static bool
has_subtitle (Content* c)
{
- return c->subtitle;
+ return static_cast<bool>(c->subtitle);
}
Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist)
shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (i);
if (fc) {
decoder.reset (new FFmpegDecoder (fc, _film->log(), _fast));
- frc = FrameRateChange (fc->video->frame_rate(), _film->video_frame_rate());
+ frc = FrameRateChange (fc->active_video_frame_rate(), _film->video_frame_rate());
}
shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (i);
if (dc) {
decoder.reset (new DCPDecoder (dc, _film->log(), _fast));
- frc = FrameRateChange (dc->video->frame_rate(), _film->video_frame_rate());
+ frc = FrameRateChange (dc->active_video_frame_rate(), _film->video_frame_rate());
}
/* ImageContent */
decoder.reset (new ImageDecoder (ic, _film->log()));
}
- frc = FrameRateChange (ic->video->frame_rate(), _film->video_frame_rate());
+ frc = FrameRateChange (ic->active_video_frame_rate(), _film->video_frame_rate());
}
/* SndfileContent */
}
if (best_overlap) {
- frc = FrameRateChange (best_overlap->video->frame_rate(), _film->video_frame_rate ());
+ frc = FrameRateChange (best_overlap->active_video_frame_rate(), _film->video_frame_rate ());
} else {
/* No video overlap; e.g. if the DCP is just audio */
frc = FrameRateChange (_film->video_frame_rate(), _film->video_frame_rate ());
shared_ptr<const TextSubtitleContent> rc = dynamic_pointer_cast<const TextSubtitleContent> (i);
if (rc) {
decoder.reset (new TextSubtitleDecoder (rc));
- frc = FrameRateChange (rc->subtitle->video_frame_rate(), _film->video_frame_rate());
+ frc = FrameRateChange (rc->active_video_frame_rate(), _film->video_frame_rate());
}
/* DCPSubtitleContent */
shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (i);
if (dsc) {
decoder.reset (new DCPSubtitleDecoder (dsc));
- frc = FrameRateChange (dsc->subtitle->video_frame_rate(), _film->video_frame_rate());
+ frc = FrameRateChange (dsc->active_video_frame_rate(), _film->video_frame_rate());
}
shared_ptr<VideoDecoder> vd = dynamic_pointer_cast<VideoDecoder> (decoder);
Changed (frequent);
} else if (
+ property == ContentProperty::VIDEO_FRAME_RATE ||
property == SubtitleContentProperty::USE ||
property == SubtitleContentProperty::X_OFFSET ||
property == SubtitleContentProperty::Y_OFFSET ||
property == SubtitleContentProperty::FONTS ||
property == VideoContentProperty::CROP ||
property == VideoContentProperty::SCALE ||
- property == VideoContentProperty::FRAME_RATE ||
property == VideoContentProperty::FADE_IN ||
property == VideoContentProperty::FADE_OUT ||
property == VideoContentProperty::COLOUR_CONVERSION
float this_error = 0;
BOOST_FOREACH (shared_ptr<Content> j, _content) {
- if (!j->video || !j->video->has_own_frame_rate()) {
+ if (!j->video || !j->video_frame_rate()) {
continue;
}
/* Best error for this content; we could use the content as-is or double its rate */
float best_error = min (
- float (fabs (i->source - j->video->frame_rate ())),
- float (fabs (i->source - j->video->frame_rate () * 2))
+ float (fabs (i->source - j->video_frame_rate().get())),
+ float (fabs (i->source - j->video_frame_rate().get() * 2))
);
/* Use the largest difference between DCP and source as the "error" */
/* This is the first piece of content (going backwards...) that starts before t,
so it's the active one.
*/
- return FrameRateChange ((*i)->video->frame_rate(), dcp_video_frame_rate);
+ if ((*i)->video_frame_rate ()) {
+ /* This content specified a rate, so use it */
+ return FrameRateChange ((*i)->video_frame_rate().get(), dcp_video_frame_rate);
+ } else {
+ /* No specified rate so just use the DCP one */
+ return FrameRateChange (dcp_video_frame_rate, dcp_video_frame_rate);
+ }
}
}
DCPTime
SndfileContent::full_length () const
{
- FrameRateChange const frc (audio->video_frame_rate(), film()->video_frame_rate());
+ FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate());
return DCPTime::from_frames (audio_length() / frc.speed_up, audio->stream()->frame_rate ());
}
int const SubtitleContentProperty::BURN = 505;
int const SubtitleContentProperty::LANGUAGE = 506;
int const SubtitleContentProperty::FONTS = 507;
-int const SubtitleContentProperty::VIDEO_FRAME_RATE = 508;
-int const SubtitleContentProperty::COLOUR = 509;
-int const SubtitleContentProperty::OUTLINE = 510;
-int const SubtitleContentProperty::OUTLINE_COLOUR = 511;
+int const SubtitleContentProperty::COLOUR = 508;
+int const SubtitleContentProperty::OUTLINE = 509;
+int const SubtitleContentProperty::OUTLINE_COLOUR = 510;
SubtitleContent::SubtitleContent (Content* parent, shared_ptr<const Film> film)
: ContentPart (parent, film)
node->optional_number_child<int>("OutlineGreen").get_value_or(255),
node->optional_number_child<int>("OutlineBlue").get_value_or(255)
)
- , _frame_rate (node->optional_number_child<double>("SubtitleFrameRate"))
{
if (version >= 32) {
_use = node->bool_child ("UseSubtitles");
{
maybe_set (_language, language, SubtitleContentProperty::LANGUAGE);
}
-
-void
-SubtitleContent::set_video_frame_rate (double r)
-{
- maybe_set (_frame_rate, r, SubtitleContentProperty::VIDEO_FRAME_RATE);
-}
-
-double
-SubtitleContent::video_frame_rate () const
-{
- {
- boost::mutex::scoped_lock lm (_mutex);
- if (_frame_rate) {
- return _frame_rate.get ();
- }
- }
-
- /* No frame rate specified, so assume this content has been
- prepared for any concurrent video content.
- */
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
- return film->active_frame_rate_change(_parent->position()).source;
-}
static int const BURN;
static int const LANGUAGE;
static int const FONTS;
- static int const VIDEO_FRAME_RATE;
static int const COLOUR;
static int const OUTLINE;
static int const OUTLINE_COLOUR;
return _outline_colour;
}
- double video_frame_rate () const;
- void set_video_frame_rate (double r);
-
protected:
/** subtitle language (e.g. "German") or empty if it is not known */
std::string _language;
bool _outline;
dcp::Colour _outline_colour;
std::list<boost::signals2::connection> _font_connections;
- /** Video frame rate that this content has been prepared for, if known */
- boost::optional<double> _frame_rate;
};
#endif
DCPTime
TextSubtitleContent::full_length () const
{
- FrameRateChange const frc (subtitle->video_frame_rate(), film()->video_frame_rate ());
+ FrameRateChange const frc (active_video_frame_rate(), film()->video_frame_rate ());
return DCPTime (_length, frc);
}
#define LOG_GENERAL(...) film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
int const VideoContentProperty::SIZE = 0;
-int const VideoContentProperty::FRAME_RATE = 1;
-int const VideoContentProperty::FRAME_TYPE = 2;
-int const VideoContentProperty::CROP = 3;
-int const VideoContentProperty::SCALE = 4;
-int const VideoContentProperty::COLOUR_CONVERSION = 5;
-int const VideoContentProperty::FADE_IN = 6;
-int const VideoContentProperty::FADE_OUT = 7;
+int const VideoContentProperty::FRAME_TYPE = 1;
+int const VideoContentProperty::CROP = 2;
+int const VideoContentProperty::SCALE = 3;
+int const VideoContentProperty::COLOUR_CONVERSION = 4;
+int const VideoContentProperty::FADE_IN = 5;
+int const VideoContentProperty::FADE_OUT = 6;
using std::string;
using std::setprecision;
{
_size.width = node->number_child<int> ("VideoWidth");
_size.height = node->number_child<int> ("VideoHeight");
- _frame_rate = node->optional_number_child<double> ("VideoFrameRate");
+
+ /* Backwards compatibility */
+ optional<double> r = node->optional_number_child<double>("VideoFrameRate");
+ if (r) {
+ _parent->set_video_frame_rate (r.get ());
+ }
+
_length = node->number_child<Frame> ("VideoLength");
_frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType"));
_sample_aspect_ratio = node->optional_number_child<double> ("SampleAspectRatio");
throw JoinError (_("Content to be joined must have the same picture size."));
}
- if (c[i]->video->frame_rate() != ref->frame_rate()) {
- throw JoinError (_("Content to be joined must have the same video frame rate."));
- }
-
if (c[i]->video->frame_type() != ref->frame_type()) {
throw JoinError (_("Content to be joined must have the same video frame type."));
}
}
_size = ref->size ();
- _frame_rate = ref->frame_rate ();
_frame_type = ref->frame_type ();
_crop = ref->crop ();
_scale = ref->scale ();
node->add_child("VideoLength")->add_child_text (raw_convert<string> (_length));
node->add_child("VideoWidth")->add_child_text (raw_convert<string> (_size.width));
node->add_child("VideoHeight")->add_child_text (raw_convert<string> (_size.height));
- if (_frame_rate) {
- node->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_frame_rate.get()));
- }
node->add_child("VideoFrameType")->add_child_text (raw_convert<string> (static_cast<int> (_frame_type)));
if (_sample_aspect_ratio) {
node->add_child("SampleAspectRatio")->add_child_text (raw_convert<string> (_sample_aspect_ratio.get ()));
{
/* These examiner calls could call other content methods which take a lock on the mutex */
dcp::Size const vs = d->video_size ();
- optional<double> const vfr = d->video_frame_rate ();
Frame vl = d->video_length ();
optional<double> const ar = d->sample_aspect_ratio ();
bool const yuv = d->yuv ();
{
boost::mutex::scoped_lock lm (_mutex);
_size = vs;
- _frame_rate = vfr;
_length = vl;
_sample_aspect_ratio = ar;
_yuv = yuv;
DCPOMATIC_ASSERT (film);
LOG_GENERAL ("Video length obtained from header as %1 frames", _length);
+ if (d->video_frame_rate()) {
+ _parent->set_video_frame_rate (d->video_frame_rate().get());
+ }
+
_parent->signal_changed (VideoContentProperty::SIZE);
- _parent->signal_changed (VideoContentProperty::FRAME_RATE);
_parent->signal_changed (VideoContentProperty::SCALE);
_parent->signal_changed (ContentProperty::LENGTH);
}
VideoContent::technical_summary () const
{
string s = String::compose (
- N_("video: length %1 frames, size %2x%3, rate %4"),
+ N_("video: length %1 frames, size %2x%3"),
length_after_3d_combine(),
size().width,
- size().height,
- frame_rate()
+ size().height
);
if (sample_aspect_ratio ()) {
{
DCPOMATIC_ASSERT (f >= 0);
- Frame const ts = _parent->trim_start().frames_round(frame_rate());
+ shared_ptr<const Film> film = _film.lock ();
+ DCPOMATIC_ASSERT (film);
+
+ double const vfr = _parent->active_video_frame_rate ();
+
+ Frame const ts = _parent->trim_start().frames_round(vfr);
if ((f - ts) < fade_in()) {
return double (f - ts) / fade_in();
}
- Frame fade_out_start = length() - _parent->trim_end().frames_round(frame_rate()) - fade_out();
+ Frame fade_out_start = length() - _parent->trim_end().frames_round(vfr) - fade_out();
if (f >= fade_out_start) {
return 1 - double (f - fade_out_start) / fade_out();
}
d << " (" << fixed << setprecision(2) << container_size.ratio () << ":1)\n";
}
- d << _("Content frame rate");
- d << " " << fixed << setprecision(4) << frame_rate() << "\n";
-
- FrameRateChange frc (frame_rate(), film->video_frame_rate ());
- d << frc.description () << "\n";
-
return d.str ();
}
{
p.push_back (UserProperty (_("Video"), _("Length"), raw_convert<string> (length ()), _("video frames")));
p.push_back (UserProperty (_("Video"), _("Size"), raw_convert<string> (size().width) + "x" + raw_convert<string> (size().height)));
- p.push_back (UserProperty (_("Video"), _("Frame rate"), raw_convert<string> (frame_rate(), 5), _("frames per second")));
-}
-
-double
-VideoContent::frame_rate () const
-{
- boost::mutex::scoped_lock lm (_mutex);
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
- return _frame_rate.get_value_or (film->video_frame_rate ());
}
void
maybe_set (_scale, s, VideoContentProperty::SCALE);
}
-void
-VideoContent::set_frame_rate (double r)
-{
- maybe_set (_frame_rate, r, VideoContentProperty::FRAME_RATE);
-}
-
void
VideoContent::set_frame_type (VideoFrameType t)
{
{
public:
static int const SIZE;
- static int const FRAME_RATE;
static int const FRAME_TYPE;
static int const CROP;
static int const SCALE;
return _size;
}
- double frame_rate () const;
-
- /** @return true if this content has a specific video frame rate, false
- * if it should use the DCP's rate.
- */
- bool has_own_frame_rate () const {
- boost::mutex::scoped_lock lm (_mutex);
- return static_cast<bool>(_frame_rate);
- }
-
void set_frame_type (VideoFrameType);
- void set_frame_rate (double);
void set_left_crop (int);
void set_right_crop (int);
void setup_default_colour_conversion ();
Frame _length;
- /** Video frame rate, or not set if this content should use the DCP's frame rate */
- boost::optional<double> _frame_rate;
boost::optional<ColourConversion> _colour_conversion;
dcp::Size _size;
VideoFrameType _frame_type;
using boost::shared_ptr;
using boost::optional;
-VideoDecoder::VideoDecoder (shared_ptr<const VideoContent> c, shared_ptr<Log> log)
+VideoDecoder::VideoDecoder (shared_ptr<const Content> c, shared_ptr<Log> log)
#ifdef DCPOMATIC_DEBUG
: test_gaps (0)
, _video_content (c)
, _last_seek_accurate (true)
, _ignore_video (false)
{
- _black_image.reset (new Image (AV_PIX_FMT_RGB24, _video_content->size(), true));
+ _black_image.reset (new Image (AV_PIX_FMT_RGB24, _video_content->video->size(), true));
_black_image->make_black ();
}
_log->log (String::compose ("VD has request for %1", frame), LogEntry::TYPE_DEBUG_DECODE);
if (_decoded_video.empty() || frame < _decoded_video.front().frame || frame > (_decoded_video.back().frame + 1)) {
- seek (ContentTime::from_frames (frame, _video_content->frame_rate()), accurate);
+ seek (ContentTime::from_frames (frame, _video_content->active_video_frame_rate()), accurate);
}
list<ContentVideo> dec;
/* Work out what we are going to push into _decoded_video next */
list<ContentVideo> to_push;
- switch (_video_content->frame_type ()) {
+ switch (_video_content->video->frame_type ()) {
case VIDEO_FRAME_TYPE_2D:
to_push.push_back (ContentVideo (image, EYES_BOTH, PART_WHOLE, frame));
break;
optional<Frame> to;
if (_decoded_video.empty() && _last_seek_time && _last_seek_accurate) {
- from = _last_seek_time->frames_round (_video_content->frame_rate ());
+ from = _last_seek_time->frames_round (_video_content->active_video_frame_rate ());
to = to_push.front().frame;
} else if (!_decoded_video.empty ()) {
from = _decoded_video.back().frame + 1;
}
if (from) {
- switch (_video_content->frame_type ()) {
+ switch (_video_content->video->frame_type ()) {
case VIDEO_FRAME_TYPE_2D:
fill_one_eye (from.get(), to.get (), EYES_BOTH);
break;
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-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
class VideoDecoder : public virtual Decoder
{
public:
- VideoDecoder (boost::shared_ptr<const VideoContent> c, boost::shared_ptr<Log> log);
+ VideoDecoder (boost::shared_ptr<const Content> c, boost::shared_ptr<Log> log);
std::list<ContentVideo> get_video (Frame frame, bool accurate);
- boost::shared_ptr<const VideoContent> video_content () const {
- return _video_content;
- }
-
void set_ignore_video ();
#ifdef DCPOMATIC_DEBUG
protected:
friend struct video_decoder_fill_test1;
friend struct video_decoder_fill_test2;
+ friend struct ffmpeg_pts_offset_test;
+ friend void ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int gaps, int video_length);
void seek (ContentTime time, bool accurate);
void video (boost::shared_ptr<const ImageProxy>, Frame frame);
void fill_one_eye (Frame from, Frame to, Eyes);
void fill_both_eyes (Frame from, Frame to, Eyes);
- boost::shared_ptr<const VideoContent> _video_content;
+ boost::shared_ptr<const Content> _video_content;
boost::shared_ptr<Log> _log;
std::list<ContentVideo> _decoded_video;
boost::shared_ptr<Image> _black_image;
if (c->video) {
cout << "\t" << c->video->size().width << "x" << c->video->size().height << "\n"
- << "\t" << c->video->frame_rate() << "fps\n"
+ << "\t" << c->active_video_frame_rate() << "fps\n"
<< "\tcrop left " << c->video->left_crop()
<< " right " << c->video->right_crop()
<< " top " << c->video->top_crop()
}
setup_sensitivity ();
- } else if (property == AudioContentProperty::VIDEO_FRAME_RATE) {
+ } else if (property == ContentProperty::VIDEO_FRAME_RATE) {
setup_description ();
}
}
return;
}
- ic->video->set_frame_rate (frame_rate);
+ ic->set_video_frame_rate (frame_rate);
}
_film->examine_and_add_content (content);
} else if (
property == ContentProperty::LENGTH ||
- property == VideoContentProperty::FRAME_RATE ||
- property == VideoContentProperty::FRAME_TYPE ||
- property == AudioContentProperty::VIDEO_FRAME_RATE ||
- property == SubtitleContentProperty::VIDEO_FRAME_RATE
+ property == ContentProperty::VIDEO_FRAME_RATE ||
+ property == VideoContentProperty::FRAME_TYPE
) {
update_full_length ();
property == ContentProperty::LENGTH ||
property == ContentProperty::TRIM_START ||
property == ContentProperty::TRIM_END ||
- property == VideoContentProperty::FRAME_RATE ||
- property == VideoContentProperty::FRAME_TYPE ||
- property == AudioContentProperty::VIDEO_FRAME_RATE ||
- property == SubtitleContentProperty::VIDEO_FRAME_RATE
+ property == ContentProperty::VIDEO_FRAME_RATE ||
+ property == VideoContentProperty::FRAME_TYPE
) {
update_play_length ();
}
- if (property == VideoContentProperty::FRAME_RATE || property == SubtitleContentProperty::VIDEO_FRAME_RATE) {
+ if (property == ContentProperty::VIDEO_FRAME_RATE) {
set<double> check_vc;
- shared_ptr<const Content> vc;
+ shared_ptr<const Content> content;
int count_ac = 0;
- shared_ptr<const Content> ac;
int count_sc = 0;
- shared_ptr<const Content> sc;
BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
- if (i->video) {
- check_vc.insert (i->video->frame_rate ());
- vc = i;
+ if (i->video && i->video_frame_rate()) {
+ check_vc.insert (i->video_frame_rate().get());
+ content = i;
}
- if (i->audio) {
+ if (i->audio && i->video_frame_rate()) {
++count_ac;
- ac = i;
+ content = i;
}
- if (i->subtitle) {
+ if (i->subtitle && i->video_frame_rate()) {
++count_sc;
- sc = i;
+ content = i;
}
}
- bool const single_frame_image_content = vc && dynamic_pointer_cast<const ImageContent> (vc) && vc->number_of_paths() == 1;
+ bool const single_frame_image_content = content && dynamic_pointer_cast<const ImageContent> (content) && content->number_of_paths() == 1;
if ((check_vc.size() == 1 || count_ac == 1 || count_sc == 1) && !single_frame_image_content) {
- if (vc) {
- checked_set (_video_frame_rate, raw_convert<string> (vc->video->frame_rate (), 5));
- } else if (ac) {
- checked_set (_video_frame_rate, raw_convert<string> (ac->audio->video_frame_rate (), 5));
- } else if (sc) {
- checked_set (_video_frame_rate, raw_convert<string> (sc->subtitle->video_frame_rate (), 5));
- }
+ checked_set (_video_frame_rate, raw_convert<string> (content->video_frame_rate().get(), 5));
_video_frame_rate->Enable (true);
} else {
checked_set (_video_frame_rate, wxT (""));
void
TimingPanel::set_video_frame_rate ()
{
+ double const fr = raw_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
- shared_ptr<DCPSubtitleContent> dsc = dynamic_pointer_cast<DCPSubtitleContent> (i);
- shared_ptr<TextSubtitleContent> tsc = dynamic_pointer_cast<TextSubtitleContent> (i);
- double const fr = raw_convert<double> (wx_to_std (_video_frame_rate->GetValue ()));
- if (i->video) {
- i->video->set_frame_rate (fr);
- } else if (i->audio) {
- /* Audio but not video, i.e. SndfileContent */
- i->audio->set_video_frame_rate (fr);
- } else if (dsc) {
- dsc->subtitle->set_video_frame_rate (fr);
- } else if (tsc) {
- tsc->subtitle->set_video_frame_rate (fr);
- }
- _set_video_frame_rate->Enable (false);
+ i->set_video_frame_rate (fr);
}
+
+ _set_video_frame_rate->Enable (false);
}
void
film_content_changed (ContentProperty::LENGTH);
film_content_changed (ContentProperty::TRIM_START);
film_content_changed (ContentProperty::TRIM_END);
- film_content_changed (VideoContentProperty::FRAME_RATE);
- film_content_changed (SubtitleContentProperty::VIDEO_FRAME_RATE);
- film_content_changed (AudioContentProperty::VIDEO_FRAME_RATE);
+ film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
}
void
fcs = dynamic_pointer_cast<FFmpegContent> (vcs);
}
- if (property == VideoContentProperty::FRAME_TYPE) {
- setup_description ();
- } else if (property == VideoContentProperty::CROP) {
- setup_description ();
- } else if (property == VideoContentProperty::SCALE) {
- setup_description ();
- } else if (property == VideoContentProperty::FRAME_RATE) {
+ if (property == ContentProperty::VIDEO_FRAME_RATE ||
+ property == VideoContentProperty::FRAME_TYPE ||
+ property == VideoContentProperty::CROP ||
+ property == VideoContentProperty::SCALE) {
setup_description ();
} else if (property == VideoContentProperty::COLOUR_CONVERSION) {
if (vcs && vcs->video->colour_conversion ()) {
if (check.size() == 1) {
_fade_in->set (
- ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->video->frame_rate ()),
- vc.front()->video->frame_rate ()
+ ContentTime::from_frames (vc.front()->video->fade_in (), vc.front()->active_video_frame_rate ()),
+ vc.front()->active_video_frame_rate ()
);
} else {
_fade_in->clear ();
if (check.size() == 1) {
_fade_out->set (
- ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->video->frame_rate ()),
- vc.front()->video->frame_rate ()
+ ContentTime::from_frames (vc.front()->video->fade_out (), vc.front()->active_video_frame_rate ()),
+ vc.front()->active_video_frame_rate ()
);
} else {
_fade_out->clear ();
_bottom_crop->set_content (video_sel);
_scale->set_content (video_sel);
+ film_content_changed (ContentProperty::VIDEO_FRAME_RATE);
film_content_changed (VideoContentProperty::CROP);
- film_content_changed (VideoContentProperty::FRAME_RATE);
film_content_changed (VideoContentProperty::COLOUR_CONVERSION);
film_content_changed (VideoContentProperty::FADE_IN);
film_content_changed (VideoContentProperty::FADE_OUT);
using boost::shared_ptr;
using boost::optional;
-static void
-test (boost::filesystem::path file, float fps, int gaps, int video_length)
+void
+ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int gaps, int video_length)
{
boost::filesystem::path path = private_data / file;
if (!boost::filesystem::exists (path)) {
shared_ptr<Log> log (new NullLog);
shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (content, log, false));
- BOOST_CHECK_CLOSE (decoder->video_content()->frame_rate(), fps, 0.01);
+ BOOST_REQUIRE (decoder->_video_content->video_frame_rate());
+ BOOST_CHECK_CLOSE (decoder->_video_content->video_frame_rate().get(), fps, 0.01);
#ifdef DCPOMATIC_DEBUG
decoder->test_gaps = 0;
BOOST_AUTO_TEST_CASE (ffmpeg_decoder_sequential_test)
{
- test ("boon_telly.mkv", 29.97, 0, 6910);
- test ("Sintel_Trailer1.480p.DivX_Plus_HD.mkv", 24, 0, 1248);
+ ffmpeg_decoder_sequential_test_one ("boon_telly.mkv", 29.97, 0, 6910);
+ ffmpeg_decoder_sequential_test_one ("Sintel_Trailer1.480p.DivX_Plus_HD.mkv", 24, 0, 1248);
/* The first video frame is 12 here, so VideoDecoder should see 12 gaps
(at the start of the file)
*/
- test ("prophet_clip.mkv", 23.976, 12, 2875);
+ ffmpeg_decoder_sequential_test_one ("prophet_clip.mkv", 23.976, 12, 2875);
}
shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test");
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
content->audio->add_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream));
- content->video->_frame_rate = 24;
+ content->_video_frame_rate = 24;
{
/* Sound == video so no offset required */
afr.push_back (30);
Config::instance()->set_allowed_dcp_frame_rates (afr);
- content->video->_frame_rate = 60;
+ content->_video_frame_rate = 60;
int best = film->best_video_frame_rate ();
FrameRateChange frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 50;
+ content->_video_frame_rate = 50;
best = film->best_video_frame_rate ();
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 48;
+ content->_video_frame_rate = 48;
best = film->best_video_frame_rate ();
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 30;
+ content->_video_frame_rate = 30;
best = film->best_video_frame_rate ();
frc = FrameRateChange (30, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 29.97;
+ content->_video_frame_rate = 29.97;
best = film->best_video_frame_rate ();
frc = FrameRateChange (29.97, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.change_speed, true);
BOOST_CHECK_CLOSE (frc.speed_up, 30 / 29.97, 0.1);
- content->video->_frame_rate = 25;
+ content->_video_frame_rate = 25;
best = film->best_video_frame_rate ();
frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 24;
+ content->_video_frame_rate = 24;
best = film->best_video_frame_rate ();
frc = FrameRateChange (24, best);
BOOST_CHECK_EQUAL (best, 24);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 14.5;
+ content->_video_frame_rate = 14.5;
best = film->best_video_frame_rate ();
frc = FrameRateChange (14.5, best);
BOOST_CHECK_EQUAL (best, 30);
BOOST_CHECK_EQUAL (frc.change_speed, true);
BOOST_CHECK_CLOSE (frc.speed_up, 15 / 14.5, 0.1);
- content->video->_frame_rate = 12.6;
+ content->_video_frame_rate = 12.6;
best = film->best_video_frame_rate ();
frc = FrameRateChange (12.6, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.change_speed, true);
BOOST_CHECK_CLOSE (frc.speed_up, 25 / 25.2, 0.1);
- content->video->_frame_rate = 12.4;
+ content->_video_frame_rate = 12.4;
best = film->best_video_frame_rate ();
frc = FrameRateChange (12.4, best);
BOOST_CHECK_EQUAL (best, 25);
BOOST_CHECK_EQUAL (frc.change_speed, true);
BOOST_CHECK_CLOSE (frc.speed_up, 25 / 24.8, 0.1);
- content->video->_frame_rate = 12;
+ content->_video_frame_rate = 12;
best = film->best_video_frame_rate ();
frc = FrameRateChange (12, best);
BOOST_CHECK_EQUAL (best, 24);
afr.push_back (60);
Config::instance()->set_allowed_dcp_frame_rates (afr);
- content->video->_frame_rate = 60;
+ content->_video_frame_rate = 60;
best = film->best_video_frame_rate ();
frc = FrameRateChange (60, best);
BOOST_CHECK_EQUAL (best, 60);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 50;
+ content->_video_frame_rate = 50;
best = film->best_video_frame_rate ();
frc = FrameRateChange (50, best);
BOOST_CHECK_EQUAL (best, 50);
BOOST_CHECK_EQUAL (frc.change_speed, false);
BOOST_CHECK_CLOSE (frc.speed_up, 1, 0.1);
- content->video->_frame_rate = 48;
+ content->_video_frame_rate = 48;
best = film->best_video_frame_rate ();
frc = FrameRateChange (48, best);
BOOST_CHECK_EQUAL (best, 48);
afr.push_back (24);
Config::instance()->set_allowed_dcp_frame_rates (afr);
- content->video->_frame_rate = 25;
+ content->_video_frame_rate = 25;
best = film->best_video_frame_rate ();
frc = FrameRateChange (25, best);
BOOST_CHECK_EQUAL (best, 24);
afr.push_back (30);
Config::instance()->set_allowed_dcp_frame_rates (afr);
- A->video->_frame_rate = 30;
- B->video->_frame_rate = 24;
+ A->_video_frame_rate = 30;
+ B->_video_frame_rate = 24;
BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 25);
- A->video->_frame_rate = 24;
- B->video->_frame_rate = 24;
+ A->_video_frame_rate = 24;
+ B->_video_frame_rate = 24;
BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 24);
- A->video->_frame_rate = 24;
- B->video->_frame_rate = 48;
+ A->_video_frame_rate = 24;
+ B->_video_frame_rate = 48;
BOOST_CHECK_EQUAL (film->best_video_frame_rate(), 24);
}
shared_ptr<FFmpegAudioStream> stream (new FFmpegAudioStream ("foo", 0, 0, 0));
content->audio->add_stream (stream);
- content->video->_frame_rate = 24;
+ content->_video_frame_rate = 24;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 48000);
stream->_frame_rate = 80000;
BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 96000);
- content->video->_frame_rate = 23.976;
+ content->_video_frame_rate = 23.976;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 47952);
- content->video->_frame_rate = 29.97;
+ content->_video_frame_rate = 29.97;
film->set_video_frame_rate (30);
BOOST_CHECK_EQUAL (film->video_frame_rate (), 30);
stream->_frame_rate = 48000;
BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 47952);
- content->video->_frame_rate = 25;
+ content->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 50000);
- content->video->_frame_rate = 25;
+ content->_video_frame_rate = 25;
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
BOOST_CHECK_EQUAL (content->audio->resampled_frame_rate(), 50000);
/* Check some out-there conversions (not the best) */
- content->video->_frame_rate = 14.99;
+ content->_video_frame_rate = 14.99;
film->set_video_frame_rate (25);
stream->_frame_rate = 16000;
/* The FrameRateChange within resampled_frame_rate should choose to double-up
video_delay = ContentTime ();
}
- Frame const first_frame = video_delay.round_up (content->video->frame_rate ()).frames_round (content->video->frame_rate ());
+ Frame const first_frame = video_delay.round_up (content->active_video_frame_rate ()).frames_round (content->active_video_frame_rate ());
FFmpegDecoder decoder (content, film->log(), false);
list<ContentVideo> a = decoder.get_video (first_frame, true);
/* Position 0, no trim, content rate = DCP rate */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.5s trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate 24, DCP rate 25 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.6));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (48);
+ content->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (48);
+ content->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (48);
+ content->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 0s, no trim, content rate 29.9978733, DCP rate 30 */
content->set_position (DCPTime::from_seconds (0));
content->set_trim_start (ContentTime::from_seconds (0));
- content->video->set_frame_rate (29.9978733);
+ content->set_video_frame_rate (29.9978733);
film->set_video_frame_rate (30);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 0, no trim, content rate = DCP rate */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.5s trim, content rate = DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate 24, DCP rate 25 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.6s trim, content rate 24, DCP rate 25, so the 1.6s trim is at 24fps */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.6));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (48);
+ content->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (48);
+ content->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (48);
+ content->set_video_frame_rate (48);
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1);
/* Position 0, no trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, no trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, 1.5s trim, video/audio content rate = video/audio DCP rate */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 0, no trim, content video rate 24, DCP video rate 25, both audio rates still 48k */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, no trim, content video rate 24, DCP rate 25, both audio rates still 48k. */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
stream->_frame_rate = 48000;
player->setup_pieces ();
*/
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.6));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (25);
stream->_frame_rate = 48000;
player->setup_pieces ();
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
*/
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (48);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, no trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 3s, 1.5s trim, content rate 24, DCP rate 48 */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();
/* Position 0, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
content->set_position (DCPTime ());
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
player->setup_pieces ();
/* Position 3s, no trim, video content rate = video DCP rate, content audio rate = 44.1k */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime ());
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
player->setup_pieces ();
/* Position 3s, 1.5s trim, video content rate = video DCP rate, content audio rate = 44.1k */
content->set_position (DCPTime::from_seconds (3));
content->set_trim_start (ContentTime::from_seconds (1.5));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 44100;
player->setup_pieces ();
/* Check with a large start trim */
content->set_position (DCPTime::from_seconds (0));
content->set_trim_start (ContentTime::from_seconds (54143));
- content->video->set_frame_rate (24);
+ content->set_video_frame_rate (24);
film->set_video_frame_rate (24);
stream->_frame_rate = 48000;
player->setup_pieces ();