diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-11-20 23:58:51 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-11-20 23:58:51 +0000 |
| commit | 878e19aabf2278828a3c9b518e0804b2cef0c01e (patch) | |
| tree | 1929355377edc46d25e6f9635d259ae7092ac3ef /src/lib | |
| parent | 4337694dfd488e88f56b63898ad35ce8ce9bb3c3 (diff) | |
Some more decode logging.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/audio_decoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/audio_decoder_stream.cc | 3 | ||||
| -rw-r--r-- | src/lib/dcp_decoder.cc | 1 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_decoder.cc | 3 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/decoder_factory.cc | 4 | ||||
| -rw-r--r-- | src/lib/decoder_part.cc | 5 | ||||
| -rw-r--r-- | src/lib/decoder_part.h | 4 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 1 | ||||
| -rw-r--r-- | src/lib/subtitle_decoder.cc | 6 | ||||
| -rw-r--r-- | src/lib/subtitle_decoder.h | 1 | ||||
| -rw-r--r-- | src/lib/text_subtitle_decoder.cc | 3 | ||||
| -rw-r--r-- | src/lib/text_subtitle_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 4 | ||||
| -rw-r--r-- | src/lib/video_decoder.h | 1 |
15 files changed, 28 insertions, 14 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 9801a68da..f26c676b2 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -32,7 +32,7 @@ using std::map; 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)); diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index 4f1a2f4ff..ef67b94f1 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -71,7 +71,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate) { 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; @@ -89,6 +89,7 @@ AudioDecoderStream::get (Frame frame, Frame length, bool accurate) } 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); } diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 1d7c66a5b..e384e1230 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -61,6 +61,7 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log) new SubtitleDecoder ( this, c->subtitle, + log, bind (&DCPDecoder::image_subtitles_during, this, _1, _2), bind (&DCPDecoder::text_subtitles_during, this, _1, _2) ) diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index fe383226e..daafee3e5 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -28,12 +28,13 @@ using std::cout; 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) ) diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h index 4b52a1ac4..b6e9aa63c 100644 --- a/src/lib/dcp_subtitle_decoder.h +++ b/src/lib/dcp_subtitle_decoder.h @@ -26,7 +26,7 @@ class DCPSubtitleContent; 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); diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index 462a80eed..b661d494b 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -56,12 +56,12 @@ decoder_factory (shared_ptr<const Content> content, shared_ptr<Log> log) 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); diff --git a/src/lib/decoder_part.cc b/src/lib/decoder_part.cc index 9ae9633e1..f210bd7ae 100644 --- a/src/lib/decoder_part.cc +++ b/src/lib/decoder_part.cc @@ -21,8 +21,11 @@ #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) { diff --git a/src/lib/decoder_part.h b/src/lib/decoder_part.h index 4b309a668..1a8794527 100644 --- a/src/lib/decoder_part.h +++ b/src/lib/decoder_part.h @@ -25,11 +25,12 @@ #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; @@ -51,6 +52,7 @@ public: protected: Decoder* _parent; + boost::shared_ptr<Log> _log; private: bool _ignore; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index b7dced34d..463d2cd80 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -98,6 +98,7 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log> new SubtitleDecoder ( this, c->subtitle, + log, bind (&FFmpegDecoder::image_subtitles_during, this, _1, _2), bind (&FFmpegDecoder::text_subtitles_during, this, _1, _2) ) diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc index 9c6ac969d..a7cf8110f 100644 --- a/src/lib/subtitle_decoder.cc +++ b/src/lib/subtitle_decoder.cc @@ -21,6 +21,8 @@ #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> @@ -38,10 +40,11 @@ using boost::function; 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) @@ -104,6 +107,7 @@ SubtitleDecoder::get (list<T> const & subs, list<ContentTimePeriod> const & sp, /* 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); } diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h index df4946c07..dfa3d6d90 100644 --- a/src/lib/subtitle_decoder.h +++ b/src/lib/subtitle_decoder.h @@ -44,6 +44,7 @@ public: 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 ); diff --git a/src/lib/text_subtitle_decoder.cc b/src/lib/text_subtitle_decoder.cc index 1576f50a1..ec60bd36b 100644 --- a/src/lib/text_subtitle_decoder.cc +++ b/src/lib/text_subtitle_decoder.cc @@ -34,7 +34,7 @@ using boost::shared_ptr; 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) { @@ -42,6 +42,7 @@ TextSubtitleDecoder::TextSubtitleDecoder (shared_ptr<const TextSubtitleContent> new SubtitleDecoder ( this, content->subtitle, + log, bind (&TextSubtitleDecoder::image_subtitles_during, this, _1, _2), bind (&TextSubtitleDecoder::text_subtitles_during, this, _1, _2) ) diff --git a/src/lib/text_subtitle_decoder.h b/src/lib/text_subtitle_decoder.h index c79b89937..5477e6f5f 100644 --- a/src/lib/text_subtitle_decoder.h +++ b/src/lib/text_subtitle_decoder.h @@ -29,7 +29,7 @@ class TextSubtitleContent; 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); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 63cf02187..01d33cd68 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -37,12 +37,11 @@ using boost::shared_ptr; 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)); @@ -90,6 +89,7 @@ VideoDecoder::get (Frame frame, bool accurate) */ 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); } diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h index 2442d3173..4f764d203 100644 --- a/src/lib/video_decoder.h +++ b/src/lib/video_decoder.h @@ -67,7 +67,6 @@ private: 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; |
