#include "render_subtitles.h"
#include "config.h"
#include "content_video.h"
-#include "player_video_frame.h"
+#include "player_video.h"
#include "frame_rate_change.h"
#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
Changed (frequent);
} else if (
+ property == SubtitleContentProperty::SUBTITLE_USE ||
property == SubtitleContentProperty::SUBTITLE_X_OFFSET ||
property == SubtitleContentProperty::SUBTITLE_Y_OFFSET ||
property == SubtitleContentProperty::SUBTITLE_SCALE ||
last time we were run.
*/
- if (p == Film::SCALER || p == Film::WITH_SUBTITLES || p == Film::CONTAINER || p == Film::VIDEO_FRAME_RATE) {
+ if (p == Film::SCALER || p == Film::CONTAINER || p == Film::VIDEO_FRAME_RATE) {
Changed (false);
}
}
_approximate_size = true;
}
-shared_ptr<PlayerVideoFrame>
+shared_ptr<PlayerVideo>
Player::black_player_video_frame () const
{
- return shared_ptr<PlayerVideoFrame> (
- new PlayerVideoFrame (
+ return shared_ptr<PlayerVideo> (
+ new PlayerVideo (
shared_ptr<const ImageProxy> (new RawImageProxy (_black_image, _film->log ())),
Crop (),
_video_container_size,
);
}
-/** @return All PlayerVideoFrames at the given time (there may be two frames for 3D) */
-list<shared_ptr<PlayerVideoFrame> >
+/** @return All PlayerVideos at the given time (there may be two frames for 3D) */
+list<shared_ptr<PlayerVideo> >
Player::get_video (DCPTime time, bool accurate)
{
if (!_have_valid_pieces) {
time + DCPTime::from_frames (1, _film->video_frame_rate ())
);
- list<shared_ptr<PlayerVideoFrame> > pvf;
+ list<shared_ptr<PlayerVideo> > pvf;
if (ov.empty ()) {
/* No video content at this time */
pvf.push_back (black_player_video_frame ());
} else {
- /* Create a PlayerVideoFrame from the content's video at this time */
+ /* Create a PlayerVideo from the content's video at this time */
shared_ptr<Piece> piece = ov.back ();
shared_ptr<VideoDecoder> decoder = dynamic_pointer_cast<VideoDecoder> (piece->decoder);
for (list<ContentVideo>::const_iterator i = content_video.begin(); i != content_video.end(); ++i) {
pvf.push_back (
- shared_ptr<PlayerVideoFrame> (
- new PlayerVideoFrame (
+ shared_ptr<PlayerVideo> (
+ new PlayerVideo (
i->image,
content->crop (),
image_size,
}
}
- /* Add subtitles to whatever PlayerVideoFrames we got */
+ /* Add subtitles to whatever PlayerVideos we got */
list<shared_ptr<Piece> > subs = overlaps<SubtitleContent> (
time,
list<PositionImage> sub_images;
for (list<shared_ptr<Piece> >::const_iterator j = subs.begin(); j != subs.end(); ++j) {
- shared_ptr<SubtitleDecoder> subtitle_decoder = dynamic_pointer_cast<SubtitleDecoder> ((*j)->decoder);
shared_ptr<SubtitleContent> subtitle_content = dynamic_pointer_cast<SubtitleContent> ((*j)->content);
+ if (!subtitle_content->subtitle_use ()) {
+ continue;
+ }
+
+ shared_ptr<SubtitleDecoder> subtitle_decoder = dynamic_pointer_cast<SubtitleDecoder> ((*j)->decoder);
ContentTime const from = dcp_to_content_subtitle (*j, time);
/* 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 ());
}
if (!sub_images.empty ()) {
- for (list<shared_ptr<PlayerVideoFrame> >::const_iterator i = pvf.begin(); i != pvf.end(); ++i) {
+ for (list<shared_ptr<PlayerVideo> >::const_iterator i = pvf.begin(); i != pvf.end(); ++i) {
(*i)->set_subtitle (merge (sub_images));
}
}
{
/* s is the offset of t from the start position of this content */
DCPTime s = t - piece->content->position ();
- s = DCPTime (max (int64_t (0), s.get ()));
+ s = DCPTime (max (DCPTime::Type (0), s.get ()));
s = DCPTime (min (piece->content->length_after_trim().get(), s.get()));
/* Convert this to the content frame */
{
/* s is the offset of t from the start position of this content */
DCPTime s = t - piece->content->position ();
- s = DCPTime (max (int64_t (0), s.get ()));
+ s = DCPTime (max (DCPTime::Type (0), s.get ()));
s = DCPTime (min (piece->content->length_after_trim().get(), s.get()));
/* Convert this to the content frame */
{
/* s is the offset of t from the start position of this content */
DCPTime s = t - piece->content->position ();
- s = DCPTime (max (int64_t (0), s.get ()));
+ s = DCPTime (max (DCPTime::Type (0), s.get ()));
s = DCPTime (min (piece->content->length_after_trim().get(), s.get()));
return ContentTime (s + piece->content->trim_start(), piece->frc);