1 #include "cpu_player_video_preparer.h"
2 #include "player_video_preparer.h"
4 #include <fastvideo_decoder_j2k.h>
5 #include <fastvideo_sdk.h>
6 #include <boost/shared_ptr.hpp>
7 #include <boost/thread.hpp>
8 #include <boost/thread/condition.hpp>
9 #include <boost/weak_ptr.hpp>
16 class FastvideoPlayerVideoPreparer : public PlayerVideoPreparer
19 FastvideoPlayerVideoPreparer (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast);
20 ~FastvideoPlayerVideoPreparer ();
22 void request (boost::shared_ptr<PlayerVideo> pv);
26 void setup (dcp::Data sample);
27 void send_to_gpu (boost::shared_ptr<PlayerVideo> pv, boost::shared_ptr<const J2KImageProxy> proxy);
28 void transform_and_extract ();
30 std::queue<boost::weak_ptr<PlayerVideo> > _queue;
32 boost::condition _work;
34 boost::atomic<bool> _stop_thread;
35 boost::thread _thread;
37 fastDecoderJ2kHandle_t _decoder;
38 fastDeviceSurfaceBufferHandle_t _buffer;
39 fastExportToHostHandle_t _adapter;
42 std::vector<boost::weak_ptr<PlayerVideo> > _batch;
46 CPUPlayerVideoPreparer _cpu;
48 static const int max_batch_size = 16;
49 static const int max_stream_size = 1302083;