- Encoder (boost::shared_ptr<const Film>, boost::weak_ptr<Job>, boost::shared_ptr<Writer>);
- virtual ~Encoder ();
-
- /** Called to indicate that a processing run is about to begin */
- void begin ();
-
- /** Call with a frame of video.
- * @param f Video frame.
- */
- void enqueue (boost::shared_ptr<PlayerVideo> f);
-
- /** Called when a processing run has finished */
- void end ();
-
- float current_encoding_rate () const;
- int video_frames_out () const;
-
-private:
-
- void frame_done ();
-
- void encoder_thread (boost::optional<ServerDescription>);
- void terminate_threads ();
- void add_worker_threads (ServerDescription);
- void server_found (ServerDescription);
-
- /** Film that we are encoding */
- boost::shared_ptr<const Film> _film;
- boost::weak_ptr<Job> _job;
-
- /** Mutex for _time_history and _last_frame */
- mutable boost::mutex _state_mutex;
- /** List of the times of completion of the last _history_size frames;
- first is the most recently completed.
- */
- std::list<struct timeval> _time_history;
- /** Number of frames that we should keep history for */
- static int const _history_size;