Re-add mutex that was taken away in
[dcpomatic.git] / src / lib / j2k_encoder.h
index 2180f3f6afd0625c20f436186febed35ec2e1c95..818c75c99209052044f6d2131e680417406555a2 100644 (file)
@@ -63,12 +63,12 @@ public:
        void begin ();
 
        /** Called to pass a bit of video to be encoded as the next DCP frame */
-       void encode (boost::shared_ptr<PlayerVideo> pv, DCPTime time);
+       void encode (boost::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time);
 
        /** Called when a processing run has finished */
        void end ();
 
-       float current_encoding_rate () const;
+       boost::optional<float> current_encoding_rate () const;
        int video_frames_enqueued () const;
 
        void servers_list_changed ();
@@ -87,9 +87,9 @@ private:
 
        EventHistory _history;
 
-       /** Mutex for _threads */
-       mutable boost::mutex _threads_mutex;
-       std::list<boost::thread *> _threads;
+       boost::mutex _threads_mutex;
+       boost::shared_ptr<boost::thread_group> _threads;
+
        mutable boost::mutex _queue_mutex;
        std::list<boost::shared_ptr<DCPVideo> > _queue;
        /** condition to manage thread wakeups when we have nothing to do */
@@ -101,7 +101,7 @@ private:
        Waker _waker;
 
        boost::shared_ptr<PlayerVideo> _last_player_video[EYES_COUNT];
-       boost::optional<DCPTime> _last_player_video_time;
+       boost::optional<dcpomatic::DCPTime> _last_player_video_time;
 
        boost::signals2::scoped_connection _server_found_connection;
 };