]> 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 4fc099ca808490c2d2b0d780ef3a40569fae2e7b..531dee8edffe44822188e3087e173eb105c913bb 100644 (file)
@@ -1,27 +1,30 @@
 /*\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 <common/memory/safe_ptr.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
 \r
 #include <functional>\r
 #include <string>\r
@@ -36,28 +39,19 @@ struct frame_consumer : boost::noncopyable
 {\r
        virtual ~frame_consumer() {}\r
        \r
-       virtual void send(const safe_ptr<const read_frame>& frame) = 0;\r
-       virtual size_t buffer_depth() const {return 1;}\r
-       virtual bool key_only() const{ return false;}\r
-       virtual void initialize(const video_format_desc& format_desc) = 0;\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
-               struct empty_frame_consumer : public frame_consumer\r
-               {\r
-                       virtual void send(const safe_ptr<const read_frame>&){}\r
-                       virtual size_t buffer_depth() const{return 0;}\r
-                       virtual void initialize(const video_format_desc&){}\r
-                       virtual std::wstring print() const {return L"empty";}\r
-                       virtual bool has_synchronization_clock() const {return false;}\r
-               };\r
-               static safe_ptr<frame_consumer> consumer = make_safe<empty_frame_consumer>();\r
-               return consumer;\r
-       }\r
+       static const safe_ptr<frame_consumer>& empty();\r
 };\r
 \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