*/
-#include <stdint.h>
-#include <algorithm>
#include "player.h"
#include "film.h"
#include "ffmpeg_decoder.h"
#include "dcp_decoder.h"
#include "dcp_subtitle_content.h"
#include "dcp_subtitle_decoder.h"
+#include <boost/foreach.hpp>
+#include <stdint.h>
+#include <algorithm>
+
+#include "i18n.h"
#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (*i);
if (dc) {
- decoder.reset (new DCPDecoder (dc, _film->log ()));
+ decoder.reset (new DCPDecoder (dc));
frc = FrameRateChange (dc->video_frame_rate(), _film->video_frame_rate());
}
{
return shared_ptr<PlayerVideo> (
new PlayerVideo (
- shared_ptr<const ImageProxy> (new RawImageProxy (_black_image, _film->log ())),
+ shared_ptr<const ImageProxy> (new RawImageProxy (_black_image)),
time,
Crop (),
+ optional<float> (),
_video_container_size,
_video_container_size,
Scaler::from_id ("bicubic"),
shared_ptr<Piece> piece = ov.back ();
shared_ptr<VideoDecoder> decoder = dynamic_pointer_cast<VideoDecoder> (piece->decoder);
- assert (decoder);
+ DCPOMATIC_ASSERT (decoder);
shared_ptr<VideoContent> content = dynamic_pointer_cast<VideoContent> (piece->content);
- assert (content);
+ DCPOMATIC_ASSERT (content);
list<ContentVideo> content_video = decoder->get_video (dcp_to_content_video (piece, time), accurate);
if (content_video.empty ()) {
i->image,
content_video_to_dcp (piece, i->frame),
content->crop (),
+ content->fade (i->frame),
image_size,
_video_container_size,
_film->scaler(),
for (list<shared_ptr<Piece> >::iterator i = ov.begin(); i != ov.end(); ++i) {
shared_ptr<AudioContent> content = dynamic_pointer_cast<AudioContent> ((*i)->content);
- assert (content);
+ DCPOMATIC_ASSERT (content);
shared_ptr<AudioDecoder> decoder = dynamic_pointer_cast<AudioDecoder> ((*i)->decoder);
- assert (decoder);
+ DCPOMATIC_ASSERT (decoder);
if (content->audio_frame_rate() == 0) {
/* This AudioContent has no audio (e.g. if it is an FFmpegContent with no
}
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));
+ BOOST_FOREACH (ContentTextSubtitle& ts, text) {
+ BOOST_FOREACH (dcp::SubtitleString& s, ts.subs) {
+ s.set_v_position (s.v_position() + subtitle_content->subtitle_y_offset ());
+ s.set_size (s.size() * max (subtitle_content->subtitle_x_scale(), subtitle_content->subtitle_y_scale()));
+ ps.text.push_back (s);
+ }
}
}
return ps;
}
+
+list<shared_ptr<Font> >
+Player::get_subtitle_fonts ()
+{
+ if (!_have_valid_pieces) {
+ setup_pieces ();
+ }
+
+ list<shared_ptr<Font> > fonts;
+ BOOST_FOREACH (shared_ptr<Piece>& p, _pieces) {
+ shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (p->content);
+ if (sc) {
+ /* XXX: things may go wrong if there are duplicate font IDs
+ with different font files.
+ */
+ list<shared_ptr<Font> > f = sc->fonts ();
+ copy (f.begin(), f.end(), back_inserter (fonts));
+ }
+ }
+
+ return fonts;
+}