From 2c5398adaea8bc56fe196144a9a233981657fba0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 20 Oct 2015 09:55:24 +0100 Subject: Various multi-reel fixes. * _video_frames_enqueued -> _position * some int -> Frame replacements * Call Writer::ref_write when there is nothing to encode / write for one frame. * Assume Encoder::encode is called once per output video frame. * Possibly correct some off-by-1 overlap bugs. * Don't reset _last_written on FAKE write as I believe there is no need. --- src/lib/encoder.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/lib/encoder.h') diff --git a/src/lib/encoder.h b/src/lib/encoder.h index 76c87a9f7..3d0597cfa 100644 --- a/src/lib/encoder.h +++ b/src/lib/encoder.h @@ -59,10 +59,10 @@ public: /** Called to indicate that a processing run is about to begin */ void begin (); - /** Call with a frame of video. - * @param f Video frame. + /** Called to pass in zero or more bits of video to be encoded + * as the next DCP frame. */ - void enqueue (boost::shared_ptr f); + void encode (std::list > f); /** Called when a processing run has finished */ void end (); @@ -72,6 +72,7 @@ public: private: + void enqueue (boost::shared_ptr f); void frame_done (); void encoder_thread (boost::optional); @@ -90,10 +91,8 @@ private: std::list _time_history; /** Number of frames that we should keep history for */ static int const _history_size; - /** Number of video frames enqueued so far */ - int _video_frames_enqueued; - bool _left_done; - bool _right_done; + /** Current DCP frame index */ + Frame _position; /* XXX: probably should be atomic */ bool _terminate_enqueue; -- cgit v1.2.3