#include "content_video.h"
#include "player_video.h"
#include "frame_rate_change.h"
+#include "dcp_content.h"
+#include "dcp_decoder.h"
#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
frc = FrameRateChange (fc->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 ()));
+ frc = FrameRateChange (dc->video_frame_rate(), _film->video_frame_rate());
+ }
+
/* ImageContent */
shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (*i);
if (ic) {
/* Add subtitles (for possible burn-in) to whatever PlayerVideos we got */
- PlayerSubtitles ps = get_subtitles (time, DCPTime::from_frames (1, _film->video_frame_rate ()));
+ PlayerSubtitles ps = get_subtitles (time, DCPTime::from_frames (1, _film->video_frame_rate ()), false);
list<PositionImage> sub_images;
}
PlayerSubtitles
-Player::get_subtitles (DCPTime time, DCPTime length)
+Player::get_subtitles (DCPTime time, DCPTime length, bool starting)
{
list<shared_ptr<Piece> > subs = overlaps<SubtitleContent> (time, time + length);
/* XXX: this video_frame_rate() should be the rate that the subtitle content has been prepared for */
ContentTime const to = from + ContentTime::from_frames (1, _film->video_frame_rate ());
- list<ContentImageSubtitle> image = subtitle_decoder->get_image_subtitles (ContentTimePeriod (from, to));
+ list<ContentImageSubtitle> image = subtitle_decoder->get_image_subtitles (ContentTimePeriod (from, to), starting);
for (list<ContentImageSubtitle>::iterator i = image.begin(); i != image.end(); ++i) {
/* Apply content's subtitle offsets */
ps.image.push_back (i->sub);
}
- list<ContentTextSubtitle> text = subtitle_decoder->get_text_subtitles (ContentTimePeriod (from, to));
+ list<ContentTextSubtitle> text = subtitle_decoder->get_text_subtitles (ContentTimePeriod (from, to), starting);
for (list<ContentTextSubtitle>::const_iterator i = text.begin(); i != text.end(); ++i) {
copy (i->subs.begin(), i->subs.end(), back_inserter (ps.text));
}