Patch from Aaron Boxer adding initial support for GPU-powered J2K encoding via his...
[dcpomatic.git] / src / lib / j2k_encoder.h
index ce362f3862871db7d00d4bb557c36b7054bb2c6d..6df30a3f7e7fcdac976f54da141e4a6e01afa58c 100644 (file)
 
 
 #include "cross.h"
+#include "dcp_video.h"
 #include "enum_indexed_vector.h"
 #include "event_history.h"
 #include "exception_store.h"
-#include "util.h"
 #include "writer.h"
 #include <boost/optional.hpp>
 #include <boost/signals2.hpp>
@@ -42,8 +42,8 @@
 #include <list>
 #include <stdint.h>
 
+#include "grok_context.h"
 
-class DCPVideo;
 class EncodeServerDescription;
 class Film;
 class Job;
@@ -56,7 +56,7 @@ class PlayerVideo;
  *  This class keeps a queue of frames to be encoded and distributes
  *  the work around threads and encoding servers.
  */
-class J2KEncoder : public ExceptionStore, public std::enable_shared_from_this<J2KEncoder>
+class J2KEncoder : public ExceptionStore
 {
 public:
        J2KEncoder(std::shared_ptr<const Film> film, Writer& writer);
@@ -71,8 +71,11 @@ public:
        /** Called to pass a bit of video to be encoded as the next DCP frame */
        void encode (std::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time);
 
+       void pause(void);
+       void resume(void);
+
        /** Called when a processing run has finished */
-       void end ();
+       void end (bool isFinal);
 
        boost::optional<float> current_encoding_rate () const;
        int video_frames_enqueued () const;
@@ -108,6 +111,9 @@ private:
        boost::optional<dcpomatic::DCPTime> _last_player_video_time;
 
        boost::signals2::scoped_connection _server_found_connection;
+
+       grk_plugin::DcpomaticContext dcpomaticContext_;
+       grk_plugin::GrokContext *context_;
 };