+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG.\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
+*\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
+*/\r
#include "../StdAfx.h"\r
\r
#include "frame_consumer.h"\r
\r
+#include <common/env.h>\r
#include <common/memory/safe_ptr.h>\r
-\r
-#include <tbb/spin_rw_mutex.h>\r
+#include <common/exception/exceptions.h>\r
\r
namespace caspar { namespace core {\r
+\r
+size_t consumer_buffer_depth()\r
+{\r
+ return env::properties().get("configuration.consumers.buffer-depth", 5);\r
+}\r
\r
-std::vector<const consumer_factory_t> c_factories;\r
-tbb::spin_rw_mutex c_factories_mutex;\r
+std::vector<const consumer_factory_t> g_factories;\r
\r
void register_consumer_factory(const consumer_factory_t& factory)\r
{\r
- tbb::spin_rw_mutex::scoped_lock(c_factories_mutex, true);\r
- c_factories.push_back(factory);\r
+ g_factories.push_back(factory);\r
}\r
\r
safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
if(params.empty())\r
BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
\r
- tbb::spin_rw_mutex::scoped_lock(c_factories_mutex, false);\r
auto consumer = frame_consumer::empty();\r
- std::any_of(c_factories.begin(), c_factories.end(), [&](const consumer_factory_t& factory) -> bool\r
+ std::any_of(g_factories.begin(), g_factories.end(), [&](const consumer_factory_t& factory) -> bool\r
{\r
try\r
{\r