using boost::shared_ptr;
AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> content, shared_ptr<Log> log)
- : DecoderPart (parent)
+ : DecoderPart (parent, log)
{
BOOST_FOREACH (AudioStreamPtr i, content->streams ()) {
_streams[i] = shared_ptr<AudioDecoderStream> (new AudioDecoderStream (content, i, parent, this, log));
{
shared_ptr<ContentAudio> dec;
- _log->log (String::compose ("-> ADS has request for %1 %2", frame, length), LogEntry::TYPE_DEBUG_DECODE);
+ _log->log (String::compose ("ADS has request for %1 %2", frame, length), LogEntry::TYPE_DEBUG_DECODE);
Frame const from = frame;
Frame const to = from + length;
}
if (missing) {
+ _log->log (String::compose ("ADS suggests seek to %1", *missing), LogEntry::TYPE_DEBUG_DECODE);
_audio_decoder->maybe_seek (ContentTime::from_frames (*missing, _content->resampled_frame_rate()), accurate);
}
new SubtitleDecoder (
this,
c->subtitle,
+ log,
bind (&DCPDecoder::image_subtitles_during, this, _1, _2),
bind (&DCPDecoder::text_subtitles_during, this, _1, _2)
)
using boost::shared_ptr;
using boost::bind;
-DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content)
+DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const DCPSubtitleContent> content, shared_ptr<Log> log)
{
subtitle.reset (
new SubtitleDecoder (
this,
content->subtitle,
+ log,
bind (&DCPSubtitleDecoder::image_subtitles_during, this, _1, _2),
bind (&DCPSubtitleDecoder::text_subtitles_during, this, _1, _2)
)
class DCPSubtitleDecoder : public DCPSubtitle, public Decoder
{
public:
- DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>);
+ DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>, boost::shared_ptr<Log> log);
protected:
bool pass (PassReason, bool accurate);
shared_ptr<const TextSubtitleContent> rc = dynamic_pointer_cast<const TextSubtitleContent> (content);
if (rc) {
- return shared_ptr<Decoder> (new TextSubtitleDecoder (rc));
+ return shared_ptr<Decoder> (new TextSubtitleDecoder (rc, log));
}
shared_ptr<const DCPSubtitleContent> dsc = dynamic_pointer_cast<const DCPSubtitleContent> (content);
if (dsc) {
- return shared_ptr<Decoder> (new DCPSubtitleDecoder (dsc));
+ return shared_ptr<Decoder> (new DCPSubtitleDecoder (dsc, log));
}
shared_ptr<const VideoMXFContent> vmc = dynamic_pointer_cast<const VideoMXFContent> (content);
#include "decoder_part.h"
#include "decoder.h"
-DecoderPart::DecoderPart (Decoder* parent)
+using boost::shared_ptr;
+
+DecoderPart::DecoderPart (Decoder* parent, shared_ptr<Log> log)
: _parent (parent)
+ , _log (log)
, _ignore (false)
{
#include <boost/optional.hpp>
class Decoder;
+class Log;
class DecoderPart
{
public:
- DecoderPart (Decoder* parent);
+ DecoderPart (Decoder* parent, boost::shared_ptr<Log> log);
void set_ignore () {
_ignore = true;
protected:
Decoder* _parent;
+ boost::shared_ptr<Log> _log;
private:
bool _ignore;
new SubtitleDecoder (
this,
c->subtitle,
+ log,
bind (&FFmpegDecoder::image_subtitles_during, this, _1, _2),
bind (&FFmpegDecoder::text_subtitles_during, this, _1, _2)
)
#include "subtitle_decoder.h"
#include "subtitle_content.h"
#include "util.h"
+#include "log.h"
+#include "compose.hpp"
#include <sub/subtitle.h>
#include <boost/shared_ptr.hpp>
#include <boost/foreach.hpp>
SubtitleDecoder::SubtitleDecoder (
Decoder* parent,
shared_ptr<const SubtitleContent> c,
+ shared_ptr<Log> log,
function<list<ContentTimePeriod> (ContentTimePeriod, bool)> image_during,
function<list<ContentTimePeriod> (ContentTimePeriod, bool)> text_during
)
- : DecoderPart (parent)
+ : DecoderPart (parent, log)
, _content (c)
, _image_during (image_during)
, _text_during (text_during)
/* Suggest to our parent decoder that it might want to seek if we haven't got what we're being asked for */
if (missing) {
+ _log->log (String::compose ("SD suggests seek to %1", to_string (*missing)), LogEntry::TYPE_DEBUG_DECODE);
maybe_seek (*missing, true);
}
SubtitleDecoder (
Decoder* parent,
boost::shared_ptr<const SubtitleContent>,
+ boost::shared_ptr<Log> log,
boost::function<std::list<ContentTimePeriod> (ContentTimePeriod, bool)> image_during,
boost::function<std::list<ContentTimePeriod> (ContentTimePeriod, bool)> text_during
);
using boost::optional;
using boost::dynamic_pointer_cast;
-TextSubtitleDecoder::TextSubtitleDecoder (shared_ptr<const TextSubtitleContent> content)
+TextSubtitleDecoder::TextSubtitleDecoder (shared_ptr<const TextSubtitleContent> content, shared_ptr<Log> log)
: TextSubtitle (content)
, _next (0)
{
new SubtitleDecoder (
this,
content->subtitle,
+ log,
bind (&TextSubtitleDecoder::image_subtitles_during, this, _1, _2),
bind (&TextSubtitleDecoder::text_subtitles_during, this, _1, _2)
)
class TextSubtitleDecoder : public Decoder, public TextSubtitle
{
public:
- TextSubtitleDecoder (boost::shared_ptr<const TextSubtitleContent>);
+ TextSubtitleDecoder (boost::shared_ptr<const TextSubtitleContent>, boost::shared_ptr<Log> log);
protected:
void seek (ContentTime time, bool accurate);
using boost::optional;
VideoDecoder::VideoDecoder (Decoder* parent, shared_ptr<const Content> c, shared_ptr<Log> log)
- : DecoderPart (parent)
+ : DecoderPart (parent, log)
#ifdef DCPOMATIC_DEBUG
, test_gaps (0)
#endif
, _content (c)
- , _log (log)
, _last_seek_accurate (true)
{
_black_image.reset (new Image (AV_PIX_FMT_RGB24, _content->video->size(), true));
*/
seek_frame *= 2;
}
+ _log->log (String::compose ("VD suggests seek to %1", seek_frame), LogEntry::TYPE_DEBUG_DECODE);
maybe_seek (ContentTime::from_frames (seek_frame, _content->active_video_frame_rate()), accurate);
}
void fill_both_eyes (VideoFrame from, VideoFrame to);
boost::shared_ptr<const Content> _content;
- boost::shared_ptr<Log> _log;
std::list<ContentVideo> _decoded;
boost::shared_ptr<Image> _black_image;
boost::optional<ContentTime> _last_seek_time;
film->examine_and_add_content (content);
wait_for_jobs ();
- shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content));
+ shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content, film->log()));
list<ContentTextSubtitle> sub = decoder->subtitle->get_text (
ContentTimePeriod (ContentTime::from_seconds(0), ContentTime::from_seconds(2)), true, true
);
film->make_dcp ();
wait_for_jobs ();
- shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content));
+ shared_ptr<DCPSubtitleDecoder> decoder (new DCPSubtitleDecoder (content, film->log()));
list<ContentTextSubtitle> sub = decoder->subtitle->get_text (
ContentTimePeriod (ContentTime::from_seconds(0), ContentTime::from_seconds(2)), true, true
);