]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/video/video_decoder.h
2.0.1: ffmpeg: Replaced TBB implementation with better Concurrency Runtime based...
[casparcg] / modules / ffmpeg / producer / video / video_decoder.h
index 1351e881bf0f5ee35fd8b4e2ac078b30d077f4ad..2fb0b85636aed90428fc43a86483b6d7a90a475e 100644 (file)
@@ -25,6 +25,7 @@
 \r
 #include <boost/noncopyable.hpp>\r
 \r
+#include <agents.h>\r
 #include <vector>\r
 \r
 struct AVFormatContext;\r
@@ -35,7 +36,6 @@ namespace caspar {
 \r
 namespace core {\r
        struct frame_factory;\r
-       class write_frame;\r
 }\r
 \r
 namespace ffmpeg {\r
@@ -43,16 +43,23 @@ namespace ffmpeg {
 class video_decoder : boost::noncopyable\r
 {\r
 public:\r
-       explicit video_decoder(const safe_ptr<AVFormatContext>& context, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& filter);\r
-       \r
-       void push(const std::shared_ptr<AVPacket>& packet);\r
-       bool ready() const;\r
-       std::vector<std::shared_ptr<AVFrame>> poll();\r
-       \r
+\r
+       typedef Concurrency::ISource<bool>                                              token_t;\r
+       typedef Concurrency::ISource<std::shared_ptr<AVPacket>> source_t;\r
+       typedef Concurrency::ITarget<std::shared_ptr<AVFrame>>  target_t;\r
+\r
+       explicit video_decoder(token_t& active_token,\r
+                                                  source_t& source,\r
+                                                  target_t& target,\r
+                                                  const safe_ptr<AVFormatContext>& context, \r
+                                                  double fps, \r
+                                                  const std::wstring& filter); \r
+\r
        size_t width() const;\r
        size_t height() const;\r
 \r
        int64_t nb_frames() const;\r
+       bool is_progressive() const;\r
 \r
        double fps() const;\r
 private:\r