diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-21 22:41:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-21 22:41:52 +0100 |
| commit | 47f25009bcbc765e397bcb471dd361a511c99daf (patch) | |
| tree | 356ac924524183047a84e34674985b3a00c5ca24 /src/lib/matcher.h | |
| parent | afc495f722f89fea0bcc579046d1a5d362e36f69 (diff) | |
| parent | e8d8a27c7f6861b031b3250b0ad50d04c41a7721 (diff) | |
Untested merge of master.
Diffstat (limited to 'src/lib/matcher.h')
| -rw-r--r-- | src/lib/matcher.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/lib/matcher.h b/src/lib/matcher.h index b1680e131..f54aa4b6a 100644 --- a/src/lib/matcher.h +++ b/src/lib/matcher.h @@ -21,15 +21,19 @@ #include "processor.h" #include "ffmpeg_compatibility.h" -class Matcher : public AudioVideoProcessor +class Matcher : public Processor, public TimedAudioSink, public TimedVideoSink, public AudioSource, public VideoSource { public: Matcher (boost::shared_ptr<Log> log, int sample_rate, float frames_per_second); - void process_video (boost::shared_ptr<Image> i, bool, boost::shared_ptr<Subtitle> s); - void process_audio (boost::shared_ptr<AudioBuffers>); + void process_video (boost::shared_ptr<Image> i, bool, boost::shared_ptr<Subtitle> s, double); + void process_audio (boost::shared_ptr<AudioBuffers>, double); void process_end (); private: + void fix_start (double); + void match (double); + void repeat_last_video (); + int _sample_rate; float _frames_per_second; int _video_frames; @@ -37,4 +41,23 @@ private: boost::optional<AVPixelFormat> _pixel_format; boost::optional<libdcp::Size> _size; boost::optional<int> _channels; + + struct AudioRecord { + AudioRecord (boost::shared_ptr<AudioBuffers> a, double t) + : audio (a) + , time (t) + {} + + boost::shared_ptr<AudioBuffers> audio; + double time; + }; + + std::list<AudioRecord> _pending_audio; + + boost::optional<double> _first_input; + boost::shared_ptr<Image> _last_image; + boost::shared_ptr<Subtitle> _last_subtitle; + + bool _had_first_video; + bool _had_first_audio; }; |
