]> git.sesse.net Git - casparcg/blobdiff - core/consumer/frame_consumer.h
2.0.2: Updated file info headers.
[casparcg] / core / consumer / frame_consumer.h
index 619770c011159e4538e7c87085c0daadb33116e7..531dee8edffe44822188e3087e173eb105c913bb 100644 (file)
@@ -1,51 +1,60 @@
 /*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
 *\r
-*  This file is part of CasparCG.\r
+* This file is part of CasparCG (www.casparcg.com).\r
 *\r
-*    CasparCG is free software: you can redistribute it and/or modify\r
-*    it under the terms of the GNU General Public License as published by\r
-*    the Free Software Foundation, either version 3 of the License, or\r
-*    (at your option) any later version.\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
 *\r
-*    CasparCG is distributed in the hope that it will be useful,\r
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-*    GNU General Public License for more details.\r
-\r
-*    You should have received a copy of the GNU General Public License\r
-*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
 *\r
+* Author: Robert Nagy, ronag89@gmail.com\r
 */\r
+\r
 #pragma once\r
 \r
-#include "../format/video_format.h"\r
-#include "../processor/read_frame.h"\r
+#include <common/memory/safe_ptr.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
 \r
-#include <memory>\r
+#include <functional>\r
+#include <string>\r
+#include <vector>\r
 \r
 namespace caspar { namespace core {\r
        \r
+class read_frame;\r
+struct video_format_desc;\r
+\r
 struct frame_consumer : boost::noncopyable\r
 {\r
-       enum sync_mode\r
-       {\r
-               ready = 0,\r
-               clock           \r
-       };\r
-\r
        virtual ~frame_consumer() {}\r
-\r
-       virtual void send(const consumer_frame&) = 0;\r
-       virtual sync_mode synchronize() = 0;\r
+       \r
+       virtual bool send(const safe_ptr<read_frame>& frame) = 0;\r
+       virtual void initialize(const video_format_desc& format_desc, int channel_index) = 0;\r
+       virtual std::wstring print() const = 0;\r
+       virtual boost::property_tree::wptree info() const = 0;\r
+       virtual bool has_synchronization_clock() const {return true;}\r
        virtual size_t buffer_depth() const = 0;\r
+       virtual int index() const = 0;\r
+\r
+       static const safe_ptr<frame_consumer>& empty();\r
 };\r
-typedef std::shared_ptr<frame_consumer> frame_consumer_ptr;\r
-typedef std::shared_ptr<const frame_consumer> frame_consumer_const_ptr;\r
 \r
-typedef std::unique_ptr<frame_consumer> frame_consumer_uptr;\r
-typedef std::unique_ptr<const frame_consumer> frame_consumer_const_uptr;\r
+safe_ptr<frame_consumer> create_consumer_cadence_guard(const safe_ptr<frame_consumer>& consumer);\r
+\r
+typedef std::function<safe_ptr<core::frame_consumer>(const std::vector<std::wstring>&)> consumer_factory_t;\r
+\r
+void register_consumer_factory(const consumer_factory_t& factory);\r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
 \r
 }}
\ No newline at end of file