diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-12-13 15:02:09 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-04-19 23:04:32 +0100 |
| commit | eb135e8dcdf36ae82420bcd18e954ad593b3e9a5 (patch) | |
| tree | f63742f6409c182482e7204aaf024ce93c63bc20 /src/lib | |
| parent | 22b13599407e45d85d1c83e0805aa14965b0ab19 (diff) | |
Reinstate subtitle list view.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/dcp_decoder.cc | 6 | ||||
| -rw-r--r-- | src/lib/dcp_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_decoder.cc | 5 | ||||
| -rw-r--r-- | src/lib/dcp_subtitle_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/decoder.h | 3 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 5 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/image_decoder.cc | 6 | ||||
| -rw-r--r-- | src/lib/image_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/text_subtitle_decoder.cc | 6 | ||||
| -rw-r--r-- | src/lib/text_subtitle_decoder.h | 2 | ||||
| -rw-r--r-- | src/lib/video_mxf_decoder.cc | 5 | ||||
| -rw-r--r-- | src/lib/video_mxf_decoder.h | 2 |
13 files changed, 27 insertions, 21 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 25c805d3f..e7f04a061 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -79,11 +79,11 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log) get_readers (); } -void +bool DCPDecoder::pass () { if (_reel == _reels.end () || !_dcp_content->can_be_played ()) { - return; + return true; } double const vfr = _dcp_content->active_video_frame_rate (); @@ -163,6 +163,8 @@ DCPDecoder::pass () _next = ContentTime (); } } + + return false; } void diff --git a/src/lib/dcp_decoder.h b/src/lib/dcp_decoder.h index 84deab101..71687ad15 100644 --- a/src/lib/dcp_decoder.h +++ b/src/lib/dcp_decoder.h @@ -47,7 +47,7 @@ public: void set_decode_referenced (); - void pass (); + bool pass (); void seek (ContentTime t, bool accurate); private: diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index ea24bb1c5..120836643 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -47,11 +47,11 @@ DCPSubtitleDecoder::seek (ContentTime time, bool) } } -void +bool DCPSubtitleDecoder::pass () { if (_next == _subtitles.end ()) { - return; + return true; } /* Gather all subtitles with the same time period that are next @@ -70,6 +70,7 @@ DCPSubtitleDecoder::pass () } subtitle->emit_text (p, s); + return false; } ContentTimePeriod diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h index 076dc3f3b..359d19145 100644 --- a/src/lib/dcp_subtitle_decoder.h +++ b/src/lib/dcp_subtitle_decoder.h @@ -28,7 +28,7 @@ class DCPSubtitleDecoder : public DCPSubtitle, public Decoder public: DCPSubtitleDecoder (boost::shared_ptr<const DCPSubtitleContent>, boost::shared_ptr<Log> log); - void pass (); + bool pass (); void seek (ContentTime time, bool accurate); private: diff --git a/src/lib/decoder.h b/src/lib/decoder.h index f70eca8b3..26035d221 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -47,7 +47,8 @@ public: boost::shared_ptr<AudioDecoder> audio; boost::shared_ptr<SubtitleDecoder> subtitle; - virtual void pass () = 0; + /** @return true if there is no more data to come from this decoder */ + virtual bool pass () = 0; virtual void seek (ContentTime time, bool accurate) = 0; ContentTime position () const; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 32903a20e..b7b70e061 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -116,7 +116,7 @@ FFmpegDecoder::flush () } } -void +bool FFmpegDecoder::pass () { int r = av_read_frame (_format_context, &_packet); @@ -134,7 +134,7 @@ FFmpegDecoder::pass () } flush (); - return; + return true; } int const si = _packet.stream_index; @@ -149,6 +149,7 @@ FFmpegDecoder::pass () } av_packet_unref (&_packet); + return false; } /** @param data pointer to array of pointers to buffers. diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index 82472c164..65e4cf46a 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -46,7 +46,7 @@ class FFmpegDecoder : public FFmpeg, public Decoder public: FFmpegDecoder (boost::shared_ptr<const FFmpegContent>, boost::shared_ptr<Log>); - void pass (); + bool pass (); void seek (ContentTime time, bool); private: diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index 6d8f878ef..5a637f4df 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -44,11 +44,11 @@ ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c, shared_ptr<Log> lo video.reset (new VideoDecoder (this, c, log)); } -void +bool ImageDecoder::pass () { if (_frame_video_position >= _image_content->video->length()) { - return; + return true; } if (!_image_content->still() || !_image) { @@ -74,7 +74,7 @@ ImageDecoder::pass () video->emit (_image, _frame_video_position); ++_frame_video_position; - return; + return false; } void diff --git a/src/lib/image_decoder.h b/src/lib/image_decoder.h index 7978f34c8..140032317 100644 --- a/src/lib/image_decoder.h +++ b/src/lib/image_decoder.h @@ -33,7 +33,7 @@ public: return _image_content; } - void pass (); + bool pass (); void seek (ContentTime, bool); private: diff --git a/src/lib/text_subtitle_decoder.cc b/src/lib/text_subtitle_decoder.cc index 51a747fa9..1b8ee1310 100644 --- a/src/lib/text_subtitle_decoder.cc +++ b/src/lib/text_subtitle_decoder.cc @@ -50,18 +50,18 @@ TextSubtitleDecoder::seek (ContentTime time, bool) } } -void +bool TextSubtitleDecoder::pass () { if (_next >= _subtitles.size ()) { - return; + return true; } ContentTimePeriod const p = content_time_period (_subtitles[_next]); subtitle->emit_text (p, _subtitles[_next]); ++_next; - return; + return false; } ContentTimePeriod diff --git a/src/lib/text_subtitle_decoder.h b/src/lib/text_subtitle_decoder.h index 01338683f..72bb89b77 100644 --- a/src/lib/text_subtitle_decoder.h +++ b/src/lib/text_subtitle_decoder.h @@ -32,7 +32,7 @@ public: TextSubtitleDecoder (boost::shared_ptr<const TextSubtitleContent>, boost::shared_ptr<Log> log); void seek (ContentTime time, bool accurate); - void pass (); + bool pass (); private: ContentTimePeriod content_time_period (sub::Subtitle s) const; diff --git a/src/lib/video_mxf_decoder.cc b/src/lib/video_mxf_decoder.cc index 95dd668ee..7b4066f20 100644 --- a/src/lib/video_mxf_decoder.cc +++ b/src/lib/video_mxf_decoder.cc @@ -66,14 +66,14 @@ VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const VideoMXFContent> content, sha } } -void +bool VideoMXFDecoder::pass () { double const vfr = _content->active_video_frame_rate (); int64_t const frame = _next.frames_round (vfr); if (frame >= _content->video->length()) { - return; + return true; } if (_mono_reader) { @@ -90,6 +90,7 @@ VideoMXFDecoder::pass () } _next += ContentTime::from_frames (1, vfr); + return false; } void diff --git a/src/lib/video_mxf_decoder.h b/src/lib/video_mxf_decoder.h index 3a93bbb06..3cbdcfb2d 100644 --- a/src/lib/video_mxf_decoder.h +++ b/src/lib/video_mxf_decoder.h @@ -30,7 +30,7 @@ class VideoMXFDecoder : public Decoder public: VideoMXFDecoder (boost::shared_ptr<const VideoMXFContent>, boost::shared_ptr<Log> log); - void pass (); + bool pass (); void seek (ContentTime t, bool accurate); private: |
