X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fj2k_encoder.h;h=98cca6ba2b5f38c9ea5726f009a145dc01ddefb9;hb=8fedaaa75c4586a4cc7ffb393bd71d1fdb091dc8;hp=b4542c40a147cca4ccbc62b39f340a5f6a660afe;hpb=5b1b70c86df7225a2a102bdde3b38ea591a6dcbb;p=dcpomatic.git diff --git a/src/lib/j2k_encoder.h b/src/lib/j2k_encoder.h index b4542c40a..98cca6ba2 100644 --- a/src/lib/j2k_encoder.h +++ b/src/lib/j2k_encoder.h @@ -29,13 +29,11 @@ #include "cross.h" #include "event_history.h" #include "exception_store.h" -#include #include #include #include #include #include -#include #include #include @@ -53,17 +51,17 @@ class PlayerVideo; * the work around threads and encoding servers. */ -class J2KEncoder : public boost::noncopyable, public ExceptionStore, public boost::enable_shared_from_this +class J2KEncoder : public boost::noncopyable, public ExceptionStore, public std::enable_shared_from_this { public: - J2KEncoder (boost::shared_ptr film, boost::shared_ptr writer); + J2KEncoder (std::shared_ptr film, std::shared_ptr writer); ~J2KEncoder (); /** Called to indicate that a processing run is about to begin */ void begin (); /** Called to pass a bit of video to be encoded as the next DCP frame */ - void encode (boost::shared_ptr pv, dcpomatic::DCPTime time); + void encode (std::shared_ptr pv, dcpomatic::DCPTime time); /** Called when a processing run has finished */ void end (); @@ -75,7 +73,7 @@ public: private: - static void call_servers_list_changed (boost::weak_ptr encoder); + static void call_servers_list_changed (std::weak_ptr encoder); void frame_done (); @@ -83,24 +81,24 @@ private: void terminate_threads (); /** Film that we are encoding */ - boost::shared_ptr _film; + std::shared_ptr _film; EventHistory _history; - /** Mutex for _threads */ - mutable boost::mutex _threads_mutex; - std::list _threads; + boost::mutex _threads_mutex; + std::shared_ptr _threads; + mutable boost::mutex _queue_mutex; - std::list > _queue; + std::list > _queue; /** condition to manage thread wakeups when we have nothing to do */ boost::condition _empty_condition; /** condition to manage thread wakeups when we have too much to do */ boost::condition _full_condition; - boost::shared_ptr _writer; + std::shared_ptr _writer; Waker _waker; - boost::shared_ptr _last_player_video[EYES_COUNT]; + std::shared_ptr _last_player_video[static_cast(Eyes::COUNT)]; boost::optional _last_player_video_time; boost::signals2::scoped_connection _server_found_connection;