/*\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
-#pragma once\r
\r
-#include "../video_format.h"\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
virtual ~frame_consumer() {}\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, int sub_index) = 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 bool send(const safe_ptr<read_frame>&) override {return false;}\r
- virtual void initialize(const video_format_desc&, int, int) override{}\r
- virtual std::wstring print() const override {return L"empty";}\r
- virtual bool has_synchronization_clock() const override {return false;}\r
- virtual size_t buffer_depth() const override {return 0;};\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