#include <stdint.h>
#include <algorithm>
+#include "i18n.h"
+
#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
using std::list;
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> (),
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 ()) {
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
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;
+}