* Change parameters const& to const parameters& for coding style.
* Update thumbnail producer to use parameters class.
* Update some methods to use params.get(...) rather than get_params.
Conflicts:
core/core.vcxproj
+++ /dev/null
-/*\r
-* Copyright 2013 Sveriges Television AB http://casparcg.com/\r
-*\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
-*\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 <boost/lexical_cast.hpp>\r
-\r
-#include <type_traits>\r
-#include <string>\r
-\r
-namespace caspar {\r
- \r
-template<typename T, typename C>\r
-typename std::enable_if<!std::is_convertible<T, std::wstring>::value, typename std::decay<T>::type>::type get_param(const std::wstring& name, C&& params, T fail_value = T())\r
-{ \r
- auto it = std::find(std::begin(params), std::end(params), name);\r
- if(it == params.end() || ++it == params.end()) \r
- return fail_value;\r
- \r
- T value = fail_value;\r
- try\r
- {\r
- value = boost::lexical_cast<std::decay<T>::type>(*it);\r
- }\r
- catch(boost::bad_lexical_cast&){}\r
-\r
- return value;\r
-}\r
-\r
-template<typename C>\r
-std::wstring get_param(const std::wstring& name, C&& params, const std::wstring& fail_value = L"")\r
-{ \r
- auto it = std::find(std::begin(params), std::end(params), name);\r
- if(it == params.end() || ++it == params.end()) \r
- return fail_value;\r
- return *it;\r
-}\r
-\r
-}
\ No newline at end of file
#include <common/memory/safe_ptr.h>\r
#include <common/exception/exceptions.h>\r
#include <common/concurrency/future_util.h>\r
+#include <core/parameters/parameters.h>\r
#include <core/video_format.h>\r
#include <core/mixer/read_frame.h>\r
\r
g_factories.push_back(factory);\r
}\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)\r
{\r
if(params.empty())\r
BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
namespace caspar { namespace core {\r
\r
class read_frame;\r
+class parameters;\r
struct video_format_desc;\r
\r
struct frame_consumer : boost::noncopyable\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
+typedef std::function<safe_ptr<core::frame_consumer>(const core::parameters&)> 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
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
\r
}}
\ No newline at end of file
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
<ItemGroup Label="ProjectConfigurations">\r
<ProjectConfiguration Include="Profile|Win32">\r
<ClInclude Include="mixer\image\blend_modes.h" />\r
<ClInclude Include="mixer\image\shader\blending_glsl.h" />\r
<ClInclude Include="mixer\image\shader\image_shader.h" />\r
+ <ClInclude Include="parameters\parameters.h" />\r
<ClInclude Include="monitor\monitor.h" />\r
<ClInclude Include="producer\channel\channel_producer.h" />\r
<ClInclude Include="thumbnail_generator.h" />\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">../../../stdafx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">../../../stdafx.h</PrecompiledHeaderFile>\r
</ClCompile>\r
+ <ClCompile Include="parameters\parameters.cpp">\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">../stdafx.h</PrecompiledHeaderFile>\r
+ <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">../stdafx.h</PrecompiledHeaderFile>\r
+ </ClCompile>\r
<ClCompile Include="monitor\monitor.cpp">\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">../stdafx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">../stdafx.h</PrecompiledHeaderFile>\r
--- /dev/null
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Cambell Prince, cambell.prince@gmail.com
+*/
+
+#include "../StdAfx.h"
+
+#include "parameters.h"
+
+#include <boost/algorithm/string.hpp>
+
+//#if defined(_MSC_VER)
+//#pragma warning (push, 1) // TODO: Legacy code, just disable warnings
+//#endif
+
+namespace caspar { namespace core {
+
+parameters::parameters(std::vector<std::wstring> const& params) :
+ params_(params)
+{
+ params_original_ = params_;
+}
+
+void parameters::clear()
+{
+ params_.clear();
+}
+
+void parameters::to_upper()
+{
+ for(size_t n = 0; n < params_.size(); ++n)
+ {
+ params_[n] = boost::to_upper_copy(params_[n]);
+ }
+}
+
+bool parameters::has(std::wstring const& parameter) const
+{
+ return boost::range::find(params_, parameter) != params_.end();
+}
+
+std::vector<std::wstring> parameters::protocol_split(std::wstring const& s)
+{
+ std::vector<std::wstring> result;
+ size_t pos;
+ if ((pos = s.find_first_of(L"://")) != std::wstring::npos)
+ {
+ result.push_back(s.substr(0, pos));
+ result.push_back(s.substr(pos + 3));
+ } else
+ {
+ result.push_back(L"");
+ result.push_back(s);
+ }
+ return result;
+}
+
+std::wstring parameters::get(std::wstring const& key, std::wstring const& default_value) const
+{
+ auto it = std::find(std::begin(params_), std::end(params_), key);
+ if (it == params_.end() || ++it == params_.end())
+ return default_value;
+ return *it;
+}
+
+std::wstring parameters::get_original() const
+{
+ std::wstring str;
+ BOOST_FOREACH(auto& param, params_)
+ {
+ str += param + L" ";
+ }
+ return str;
+}
+
+std::wstring parameters::at_original(size_t i) const
+{
+ return params_original_[i];
+}
+
+void parameters::set(size_t index, std::wstring const& value)
+{
+ if (index < params_.size())
+ {
+ params_[index] = value;
+ }
+ if (index < params_original_.size())
+ {
+ params_original_[index] = value;
+ }
+}
+
+}}
--- /dev/null
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Cambell Prince, cambell.prince@gmail.com
+*/
+
+#pragma once
+
+#include <string>
+#include <vector>
+#include <stdint.h>
+
+namespace caspar {
+
+namespace core {
+
+class parameters
+{
+ std::vector<std::wstring> params_;
+ std::vector<std::wstring> params_original_;
+
+public:
+ parameters() {}
+
+ parameters(std::vector<std::wstring> const& params);
+
+ std::vector<std::wstring> const& get_params() const {
+ return params_;
+ }
+
+ static std::vector<std::wstring> protocol_split(std::wstring const& s);
+
+ void to_upper();
+
+ bool has(std::wstring const& key) const;
+
+ template<typename C>
+ typename std::enable_if<!std::is_convertible<C, std::wstring>::value, typename std::decay<C>::type>::type get(std::wstring const& key, C default_value = C()) const
+ {
+ auto it = std::find(std::begin(params_), std::end(params_), key);
+ if(it == params_.end() || ++it == params_.end())
+ return default_value;
+
+ C value = default_value;
+ try
+ {
+ value = boost::lexical_cast<std::decay<C>::type>(*it);
+ }
+ catch(boost::bad_lexical_cast&){}
+
+ return value;
+ }
+
+ std::wstring get(std::wstring const& key, std::wstring const& default_value = L"") const;
+
+ std::wstring get_original() const;
+
+ std::wstring at_original(size_t i) const;
+
+ void set(size_t index, std::wstring const& value);
+
+ // Type conversion operator for compatibiltiy with existing code not yet updated.
+ operator std::vector<std::wstring> const& () const
+ {
+ return params_;
+ }
+
+ // Compatibility method though likely to be useful
+ void clear();
+
+ // Compatibility method though likely to be useful
+ bool empty() const
+ {
+ return params_.empty();
+ }
+
+ // Compatibility method, though likely to be useful.
+ size_t size() const
+ {
+ return params_.size();
+ }
+
+ // Compatibility method
+ void push_back(std::wstring const& s)
+ {
+ params_.push_back(s);
+ params_original_.push_back(s);
+ }
+
+ // Compatibility method
+ std::wstring const& at(int i) const
+ {
+ return params_.at(i);
+ }
+
+ // Compatibility method
+ std::wstring const& back() const
+ {
+ return params_.back();
+ }
+
+ // Compatibility method
+ void pop_back()
+ {
+ params_.pop_back();
+ }
+
+ // Compatibility method
+ std::wstring const& operator [] (size_t i) const
+ {
+ return params_[i];
+ }
+
+ // Compatibility method
+ // Used for the upper casing
+ //std::wstring& operator [] (size_t i) {
+ // return params_[i];
+ //}
+
+ // Compatibility method
+ std::vector<std::wstring>::const_iterator begin() const
+ {
+ return params_.begin();
+ }
+
+ // Compatibility method
+ std::vector<std::wstring>::const_iterator end() const
+ {
+ return params_.end();
+ }
+
+};
+
+}}
+
\r
#include <common/exception/exceptions.h>\r
\r
+#include <core/parameters/parameters.h>\r
+\r
#include <boost/algorithm/string.hpp>\r
\r
#include <sstream>\r
\r
safe_ptr<frame_producer> create_color_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{\r
- if(params.size() < 0)\r
+ if(params.empty())\r
return core::frame_producer::empty();\r
\r
auto color2 = get_hex_color(params[0]);\r
\r
safe_ptr<frame_producer> create_color_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
safe_ptr<core::write_frame> create_color_frame(void* tag, const safe_ptr<core::frame_factory>& frame_factory, const std::wstring& color);\r
\r
}}\r
#include "frame/basic_frame.h"\r
#include "frame/frame_transform.h"\r
\r
+#include "../parameters/parameters.h"\r
+\r
#include "color/color_producer.h"\r
#include "separated/separated_producer.h"\r
\r
g_thumbnail_factories.push_back(factory);\r
}\r
\r
-safe_ptr<core::frame_producer> do_create_producer(const safe_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& upper_case_params, const std::vector<std::wstring>& original_case_params, const std::vector<const producer_factory_t>& factories, bool throw_on_fail = false)\r
+safe_ptr<core::frame_producer> do_create_producer(const safe_ptr<frame_factory>& my_frame_factory, const core::parameters& params, const std::vector<const producer_factory_t>& factories, bool throw_on_fail = false)\r
{\r
- if(upper_case_params.empty())\r
+ if(params.empty())\r
BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("params") << arg_value_info(""));\r
\r
auto producer = frame_producer::empty();\r
{\r
try\r
{\r
- producer = factory(my_frame_factory, upper_case_params, original_case_params);\r
+ producer = factory(my_frame_factory, params);\r
}\r
catch(...)\r
{\r
});\r
\r
if(producer == frame_producer::empty())\r
- producer = create_color_producer(my_frame_factory, upper_case_params, original_case_params);\r
+ producer = create_color_producer(my_frame_factory, params);\r
return producer;\r
}\r
\r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& my_frame_factory, const std::vector<std::wstring>& upper_case_params, const std::vector<std::wstring>& original_case_params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& my_frame_factory, const core::parameters& params)\r
{ \r
- auto producer = do_create_producer(my_frame_factory, upper_case_params, original_case_params, g_factories);\r
+ auto producer = do_create_producer(my_frame_factory, params, g_factories);\r
auto key_producer = frame_producer::empty();\r
\r
std::wstring resource_name = L"";\r
- auto tokens = protocol_split(original_case_params[0]);\r
+ auto tokens = parameters::protocol_split(params.at_original(0));\r
if (tokens[0].empty())\r
{\r
- resource_name = original_case_params[0];\r
+ resource_name = params.at_original(0);\r
}\r
\r
if(!resource_name.empty()) {\r
try // to find a key file.\r
{\r
- auto upper_params_copy = upper_case_params;\r
- auto original_params_copy = original_case_params;\r
-\r
- if(upper_case_params.size() > 0)\r
+ auto params_copy = params;\r
+ if(params_copy.size() > 0)\r
{\r
- upper_params_copy[0] += L"_A";\r
- original_params_copy[0] += L"_A";\r
- key_producer = do_create_producer(my_frame_factory, upper_params_copy, original_params_copy, g_factories); \r
+ auto resource_name = params_copy[0];\r
+ params_copy.set(0, resource_name + L"_A");\r
+ key_producer = do_create_producer(my_frame_factory, params_copy, g_factories); \r
if(key_producer == frame_producer::empty())\r
{\r
- upper_params_copy[0] += L"LPHA";\r
- original_params_copy[0] += L"LPHA";\r
- key_producer = do_create_producer(my_frame_factory, upper_params_copy, original_params_copy, g_factories); \r
+ params_copy.set(0, resource_name + L"_ALPHA");\r
+ key_producer = do_create_producer(my_frame_factory, params_copy, g_factories); \r
}\r
}\r
}\r
\r
if(producer == frame_producer::empty())\r
{\r
- std::wstring str;\r
- BOOST_FOREACH(auto& param, original_case_params)\r
- str += param + L" ";\r
+ std::wstring str = params.get_original();\r
BOOST_THROW_EXCEPTION(file_not_found() << msg_info("No match found for supplied commands. Check syntax.") << arg_value_info(narrow(str)));\r
}\r
\r
std::vector<std::wstring> params;\r
params.push_back(media_file);\r
\r
- auto producer = do_create_producer(my_frame_factory, params, params, g_thumbnail_factories, true);\r
+ auto producer = do_create_producer(my_frame_factory, params, g_thumbnail_factories, true);\r
auto key_producer = frame_producer::empty();\r
\r
try // to find a key file.\r
if (params_copy.size() > 0)\r
{\r
params_copy[0] += L"_A";\r
- key_producer = do_create_producer(my_frame_factory, params_copy, params_copy, g_thumbnail_factories, true);\r
+ key_producer = do_create_producer(my_frame_factory, params_copy, g_thumbnail_factories, true);\r
if (key_producer == frame_producer::empty())\r
{\r
params_copy[0] += L"LPHA";\r
- key_producer = do_create_producer(my_frame_factory, params_copy, params_copy, g_thumbnail_factories, true);\r
+ key_producer = do_create_producer(my_frame_factory, params_copy, g_thumbnail_factories, true);\r
}\r
}\r
}\r
return producer;\r
}\r
\r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& factory, const std::wstring& params)\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>& factory, const std::wstring& param)\r
{\r
- std::wstringstream iss(params);\r
- std::vector<std::wstring> tokens;\r
- typedef std::istream_iterator<std::wstring, wchar_t, std::char_traits<wchar_t> > iterator;\r
- std::copy(iterator(iss), iterator(), std::back_inserter(tokens));\r
- return create_producer(factory, tokens, tokens);\r
+ parameters params;\r
+ params.push_back(param);\r
+ return create_producer(factory, params);\r
}\r
\r
std::vector<std::wstring> protocol_split(std::wstring const& s)\r
namespace core {\r
\r
class basic_frame;\r
+class parameters;\r
struct frame_factory;\r
\r
struct frame_producer : boost::noncopyable\r
\r
safe_ptr<basic_frame> receive_and_follow(safe_ptr<frame_producer>& producer, int hints);\r
\r
-typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<frame_factory>&, const std::vector<std::wstring>& upper_case_params, const std::vector<std::wstring>& original_case_params)> producer_factory_t;\r
+typedef std::function<safe_ptr<core::frame_producer>(const safe_ptr<frame_factory>&, const core::parameters& params)> producer_factory_t;\r
void register_producer_factory(const producer_factory_t& factory); // Not thread-safe.\r
void register_thumbnail_producer_factory(const producer_factory_t& factory); // Not thread-safe.\r
-safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::vector<std::wstring>& upper_case_params, const std::vector<std::wstring>& original_case_params);\r
+safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const core::parameters& params);\r
safe_ptr<core::frame_producer> create_producer(const safe_ptr<frame_factory>&, const std::wstring& params);\r
safe_ptr<core::frame_producer> create_producer_destroy_proxy(safe_ptr<core::frame_producer> producer);\r
safe_ptr<core::frame_producer> create_producer_print_proxy(safe_ptr<core::frame_producer> producer);\r
safe_ptr<core::frame_producer> create_thumbnail_producer(const safe_ptr<frame_factory>& factory, const std::wstring& media_file);\r
\r
-std::vector<std::wstring> protocol_split(std::wstring const& s);\r
-\r
}}\r
#include <common/log/log.h>\r
#include <common/utility/string.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/consumer/frame_consumer.h>\r
\r
#include <boost/lexical_cast.hpp>\r
try\r
{\r
blue_initialize();\r
- core::register_consumer_factory([](const std::vector<std::wstring>& params)\r
+ core::register_consumer_factory([](const core::parameters& params)\r
{\r
- return create_consumer(params);\r
+ return bluefish::create_consumer(params);\r
});\r
}\r
catch(...){}\r
#include "../util/blue_velvet.h"\r
#include "../util/memory.h"\r
\r
+#include <core/parameters/parameters.h>
#include <core/video_format.h>\r
#include <core/mixer/read_frame.h>\r
\r
#include <common/memory/memcpy.h>\r
#include <common/memory/memshfl.h>\r
#include <common/utility/timer.h>\r
-#include <common/utility/param.h>\r
\r
#include <core/consumer/frame_consumer.h>\r
#include <core/mixer/audio/audio_util.h>\r
}\r
}; \r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)
{\r
if(params.size() < 1 || params[0] != L"BLUEFISH")\r
return core::frame_consumer::empty();\r
const auto embedded_audio = std::find(params.begin(), params.end(), L"EMBEDDED_AUDIO") != params.end();\r
const auto key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
const auto audio_layout = core::default_channel_layout_repository().get_by_name(\r
- get_param(L"CHANNEL_LAYOUT", params, L"STEREO"));\r
+ params.get(L"CHANNEL_LAYOUT", L"STEREO"));\r
\r
return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only, audio_layout);\r
}\r
\r
namespace core {\r
struct frame_consumer;\r
+ class parameters;\r
}\r
\r
namespace bluefish {\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
#include <common/memory/memcpy.h>\r
#include <common/memory/memclr.h>\r
#include <common/memory/memshfl.h>\r
-#include <common/utility/param.h>\r
\r
+#include <core/parameters/parameters.h>
#include <core/consumer/frame_consumer.h>\r
#include <core/mixer/audio/audio_util.h>\r
\r
}\r
}; \r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)
{\r
if(params.size() < 1 || params[0] != L"DECKLINK")\r
return core::frame_consumer::empty();\r
config.embedded_audio = std::find(params.begin(), params.end(), L"EMBEDDED_AUDIO") != params.end();\r
config.key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
config.audio_layout = core::default_channel_layout_repository().get_by_name(\r
- get_param(L"CHANNEL_LAYOUT", params, L"STEREO"));\r
+ params.get(L"CHANNEL_LAYOUT", L"STEREO"));\r
\r
return make_safe<decklink_consumer_proxy>(config);\r
}\r
\r
namespace core {\r
struct frame_consumer;\r
+ class parameters;\r
}\r
\r
namespace decklink {\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
#include "consumer/decklink_consumer.h"\r
#include "producer/decklink_producer.h"\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/consumer/frame_consumer.h>\r
#include <core/producer/frame_producer.h>\r
\r
if(FAILED(pDecklinkIterator.CoCreateInstance(CLSID_CDeckLinkIterator))) \r
return;\r
\r
- core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+ core::register_consumer_factory([](const core::parameters& params){return decklink::create_consumer(params);});\r
core::register_producer_factory(create_producer);\r
}\r
\r
#include <common/exception/exceptions.h>\r
#include <common/log/log.h>\r
#include <common/memory/memclr.h>\r
-#include <common/utility/param.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/monitor/monitor.h>\r
#include <core/mixer/write_frame.h>\r
#include <core/mixer/audio/audio_util.h>\r
\r
safe_ptr<core::frame_producer> create_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{\r
if(params.empty() || !boost::iequals(params[0], "decklink"))\r
return core::frame_producer::empty();\r
\r
- auto device_index = get_param(L"DEVICE", params, -1);\r
+ auto device_index = params.get(L"DEVICE", -1);\r
if(device_index == -1)\r
device_index = boost::lexical_cast<int>(params.at(1));\r
- auto filter_str = get_param(L"FILTER", params); \r
- auto length = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max()); \r
- auto buffer_depth = get_param(L"BUFFER", params, 2); \r
- auto format_desc = core::video_format_desc::get(get_param(L"FORMAT", params, L"INVALID"));\r
+ auto filter_str = params.get(L"FILTER"); \r
+ auto length = params.get(L"LENGTH", std::numeric_limits<uint32_t>::max()); \r
+ auto buffer_depth = params.get(L"BUFFER", 2); \r
+ auto format_desc = core::video_format_desc::get(params.get(L"FORMAT", L"INVALID"));\r
auto audio_layout = core::create_custom_channel_layout(\r
- get_param(L"CHANNEL_LAYOUT", params, L"STEREO"),\r
+ params.get(L"CHANNEL_LAYOUT", L"STEREO"),\r
core::default_channel_layout_repository());\r
\r
boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");\r
#include <string>\r
#include <vector>\r
\r
-namespace caspar { namespace decklink {\r
+namespace caspar {\r
+namespace core {\r
+ class parameters;\r
+}\r
+namespace decklink {\r
\r
safe_ptr<core::frame_producer> create_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
\r
}}\r
\r
#include "../producer/audio/audio_resampler.h"\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/mixer/read_frame.h>\r
#include <core/mixer/audio/audio_util.h>\r
#include <core/consumer/frame_consumer.h>\r
#include <common/diagnostics/graph.h>\r
#include <common/env.h>\r
#include <common/utility/string.h>\r
-#include <common/utility/param.h>\r
#include <common/memory/memshfl.h>\r
\r
#include <boost/algorithm/string.hpp>\r
}\r
}; \r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)\r
{\r
if(params.size() < 1 || params[0] != L"FILE")\r
return core::frame_consumer::empty();\r
\r
namespace core {\r
struct frame_consumer;\r
+ class parameters;\r
}\r
\r
namespace ffmpeg {\r
-\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
\r
#include <common/log/log.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/consumer/frame_consumer.h>\r
#include <core/producer/frame_producer.h>\r
\r
avcodec_init();\r
avcodec_register_all();\r
\r
- core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+ core::register_consumer_factory([](const core::parameters& params){return ffmpeg::create_consumer(params);});\r
core::register_producer_factory(create_producer);\r
core::register_thumbnail_producer_factory(create_thumbnail_producer);\r
}\r
\r
#include <common/env.h>\r
#include <common/utility/assert.h>\r
-#include <common/utility/param.h>\r
#include <common/diagnostics/graph.h>\r
\r
#include <core/monitor/monitor.h>\r
#include <core/video_format.h>\r
+#include <core/parameters/parameters.h>\r
#include <core/producer/frame_producer.h>\r
#include <core/producer/frame/frame_factory.h>\r
#include <core/producer/frame/basic_frame.h>\r
\r
safe_ptr<core::frame_producer> create_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{ \r
static const std::vector<std::wstring> invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c")(L".swf")(L".ct");\r
\r
// Infer the resource type from the resource_name\r
auto resource_type = FFMPEG_FILE;\r
- auto tokens = caspar::core::protocol_split(original_case_params[0]);\r
- auto filename = params[0];\r
+ auto tokens = core::parameters::protocol_split(params.at_original(0));\r
+ auto filename = params.at_original(0);\r
if (!tokens[0].empty())\r
{\r
if (tokens[0] == L"dshow")\r
{\r
// Stream\r
resource_type = FFMPEG_STREAM;\r
- filename = original_case_params[0];\r
+ filename = params.at_original(0);\r
}\r
} else\r
{\r
if(filename.empty())\r
return core::frame_producer::empty();\r
\r
- auto loop = boost::range::find(params, L"LOOP") != params.end();\r
- auto start = get_param(L"SEEK", params, static_cast<uint32_t>(0));\r
- auto length = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());\r
- auto filter_str = get_param(L"FILTER", params, L""); \r
- auto custom_channel_order = get_param(L"CHANNEL_LAYOUT", params, L"");\r
+ auto loop = params.has(L"LOOP");\r
+ auto start = params.get(L"SEEK", static_cast<uint32_t>(0));\r
+ auto length = params.get(L"LENGTH", std::numeric_limits<uint32_t>::max());\r
+ auto filter_str = params.get(L"FILTER", L""); \r
+ auto custom_channel_order = params.get(L"CHANNEL_LAYOUT", L"");\r
\r
boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");\r
boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");\r
\r
ffmpeg_params vid_params;\r
- vid_params.size_str = get_param(L"SIZE", params, L"");\r
- vid_params.pixel_format = get_param(L"PIXFMT", params, L"");\r
- vid_params.frame_rate = get_param(L"FRAMERATE", params, L"");\r
+ vid_params.size_str = params.get(L"SIZE", L"");\r
+ vid_params.pixel_format = params.get(L"PIXFMT", L"");\r
+ vid_params.frame_rate = params.get(L"FRAMERATE", L"");\r
\r
return create_producer_destroy_proxy(make_safe<ffmpeg_producer>(frame_factory, filename, resource_type, filter_str, loop, start, length, false, custom_channel_order, vid_params));\r
}\r
\r
safe_ptr<core::frame_producer> create_thumbnail_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{ \r
static const std::vector<std::wstring> invalid_exts = boost::assign::list_of\r
(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c")(L".swf")(L".ct")\r
\r
namespace core {\r
\r
+class parameters;\r
struct frame_producer;\r
struct frame_factory;\r
\r
\r
safe_ptr<core::frame_producer> create_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
safe_ptr<core::frame_producer> create_thumbnail_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
\r
}}
\ No newline at end of file
\r
#include <common/env.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/mixer/mixer.h>\r
\r
#include <boost/filesystem.hpp>\r
\r
safe_ptr<core::frame_producer> create_ct_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params) \r
+ const core::parameters& params) \r
{\r
return create_cg_producer_and_autoplay_file(frame_factory, params, env::media_folder() + L"\\" + params[0] + L".ct");\r
}\r
\r
safe_ptr<core::frame_producer> create_cg_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params) \r
+ const core::parameters& params) \r
{\r
if(params.empty() || params.at(0) != L"[CG]")\r
return core::frame_producer::empty();\r
\r
#include <string>\r
\r
-namespace caspar { namespace flash {\r
+namespace caspar {\r
+namespace core {\r
+ class parameters;\r
+}\r
+namespace flash {\r
\r
class cg_producer : public core::frame_producer\r
{\r
\r
safe_ptr<core::frame_producer> create_ct_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
safe_ptr<core::frame_producer> create_cg_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
\r
}}
\ No newline at end of file
#include <core/video_format.h>\r
\r
#include <core/monitor/monitor.h>\r
+#include <core/parameters/parameters.h>\r
#include <core/producer/frame/basic_frame.h>\r
#include <core/producer/frame/frame_factory.h>\r
#include <core/mixer/write_frame.h>\r
\r
safe_ptr<core::frame_producer> create_swf_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params) \r
+ const core::parameters& params) \r
{\r
- auto filename = env::media_folder() + L"\\" + params.at(0) + L".swf";\r
+ auto filename = env::media_folder() + L"\\" + params.at_original(0) + L".swf";\r
\r
if(!boost::filesystem::exists(filename))\r
return core::frame_producer::empty();\r
safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
safe_ptr<core::frame_producer> create_swf_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
\r
std::wstring find_template(const std::wstring& templateName);\r
\r
#include <common/utility/string.h>\r
#include <common/concurrency/future_util.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/consumer/frame_consumer.h>\r
#include <core/video_format.h>\r
#include <core/mixer/read_frame.h>\r
}\r
};\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)\r
{\r
if(params.size() < 1 || params[0] != L"IMAGE")\r
return core::frame_consumer::empty();\r
\r
namespace core {\r
struct frame_consumer;\r
+ class parameters;\r
class read_frame;\r
struct video_format_desc;\r
}\r
int width,\r
int height);\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
\r
}}
\ No newline at end of file
#include "producer/image_scroll_producer.h"\r
#include "consumer/image_consumer.h"\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/producer/frame_producer.h>\r
#include <core/consumer/frame_consumer.h>\r
\r
core::register_producer_factory(create_scroll_producer);\r
core::register_producer_factory(create_producer);\r
core::register_thumbnail_producer_factory(create_thumbnail_producer);\r
- core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+ core::register_consumer_factory([](const core::parameters& params){return image::create_consumer(params);});\r
}\r
\r
std::wstring get_version()\r
\r
#include <core/video_format.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/monitor/monitor.h>\r
#include <core/producer/frame/basic_frame.h>\r
#include <core/producer/frame/frame_factory.h>\r
}\r
};\r
\r
-safe_ptr<core::frame_producer> create_raw_producer(const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+safe_ptr<core::frame_producer> create_raw_producer(\r
+ const safe_ptr<core::frame_factory>& frame_factory,\r
+ const core::parameters& params)\r
{\r
if (params[0] == L"[PNG_BASE64]")\r
{\r
if (params.size() < 2)\r
return core::frame_producer::empty();\r
\r
- auto png_data = from_base64(narrow(original_case_params[1]));\r
+ auto png_data = from_base64(narrow(params.at_original(1)));\r
\r
return make_safe<image_producer>(frame_factory, png_data.data(), png_data.size());\r
}\r
\r
safe_ptr<core::frame_producer> create_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{\r
- auto raw_producer = create_raw_producer(frame_factory, params, original_case_params);\r
+ auto raw_producer = create_raw_producer(frame_factory, params);\r
\r
if (raw_producer == core::frame_producer::empty())\r
return raw_producer;\r
\r
safe_ptr<core::frame_producer> create_thumbnail_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{\r
- return create_raw_producer(frame_factory, params, original_case_params);\r
+ return create_raw_producer(frame_factory, params);\r
}\r
\r
}}
\ No newline at end of file
#include <string>\r
#include <vector>\r
\r
-namespace caspar { namespace image {\r
+namespace caspar { \r
+namespace core {\r
+ class parameters;\r
+}\r
+namespace image {\r
\r
safe_ptr<core::frame_producer> create_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
safe_ptr<core::frame_producer> create_thumbnail_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
\r
}}
\ No newline at end of file
\r
#include <core/video_format.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/monitor/monitor.h>\r
#include <core/producer/frame/basic_frame.h>\r
#include <core/producer/frame/frame_factory.h>\r
\r
safe_ptr<core::frame_producer> create_scroll_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params)\r
+ const core::parameters& params)\r
{\r
static const std::vector<std::wstring> extensions = list_of(L"png")(L"tga")(L"bmp")(L"jpg")(L"jpeg")(L"gif")(L"tiff")(L"tif")(L"jp2")(L"jpx")(L"j2k")(L"j2c");\r
std::wstring filename = env::media_folder() + L"\\" + params[0];\r
#include <string>\r
#include <vector>\r
\r
-namespace caspar { namespace image {\r
+namespace caspar { \r
+namespace core {\r
+ class parameters;\r
+}\r
+namespace image {\r
\r
safe_ptr<core::frame_producer> create_scroll_producer(\r
const safe_ptr<core::frame_factory>& frame_factory,\r
- const std::vector<std::wstring>& params,\r
- const std::vector<std::wstring>& original_case_params);\r
+ const core::parameters& params);\r
\r
}}
\ No newline at end of file
#include <common/utility/string.h>
#include <common/concurrency/future_util.h>
+#include <core/parameters/parameters.h>
#include <core/consumer/frame_consumer.h>
#include <core/mixer/audio/audio_util.h>
#include <core/video_format.h>
}
};
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)
{
if(params.size() < 1 || params[0] != L"AUDIO")
return core::frame_consumer::empty();
\r
namespace core {\r
struct frame_consumer;\r
+ class parameters;\r
} \r
\r
namespace oal {\r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
safe_ptr<core::frame_consumer> create_consumer();\r
\r
}}
\ No newline at end of file
\r
#include "consumer/oal_consumer.h"\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/consumer/frame_consumer.h>\r
\r
namespace caspar { namespace oal {\r
\r
void init()\r
{\r
- core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+ core::register_consumer_factory([](const core::parameters& params){ return oal::create_consumer(params); });\r
}\r
\r
}}
\ No newline at end of file
\r
#include <ffmpeg/producer/filter/filter.h>\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/video_format.h>\r
#include <core/mixer/read_frame.h>\r
#include <core/consumer/frame_consumer.h>\r
}\r
}; \r
\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params)\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params)\r
{\r
if(params.size() < 1 || params[0] != L"SCREEN")\r
return core::frame_consumer::empty();\r
\r
namespace core {\r
struct frame_consumer;\r
+ class parameters;\r
}\r
\r
namespace ogl {\r
\r
-\r
-safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_consumer> create_consumer(const core::parameters& params);\r
safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::wptree& ptree);\r
\r
}}
\ No newline at end of file
\r
#include "consumer/ogl_consumer.h"\r
\r
+#include <core/parameters/parameters.h>\r
#include <core/consumer/frame_consumer.h>\r
\r
namespace caspar { namespace ogl {\r
\r
void init()\r
{\r
- caspar::core::register_consumer_factory([](const std::vector<std::wstring>& params){return create_consumer(params);});\r
+ caspar::core::register_consumer_factory([](const core::parameters& params){return ogl::create_consumer(params);});\r
}\r
\r
}}
\ No newline at end of file
#include "../util/clientinfo.h"\r
\r
#include <core/consumer/frame_consumer.h>\r
+#include <core/parameters/parameters.h>\r
#include <core/video_channel.h>\r
#include <core/thumbnail_generator.h>\r
\r
#include <boost/algorithm/string.hpp>\r
\r
-namespace caspar { namespace protocol {\r
+namespace caspar {\r
+namespace protocol {\r
namespace amcp {\r
\r
enum AMCPCommandScheduling\r
\r
void AddParameter(const std::wstring& param){_parameters.push_back(param);}\r
\r
+ void SetParameters(const core::parameters& p) {\r
+ _parameters = p;\r
+ }\r
+\r
void SetClientInfo(IO::ClientInfoPtr& s){pClientInfo_ = s;}\r
IO::ClientInfoPtr GetClientInfo(){return pClientInfo_;}\r
\r
void SetReplyString(const std::wstring& str){replyString_ = str;}\r
\r
protected:\r
- std::vector<std::wstring> _parameters;\r
- std::vector<std::wstring> _parameters2;\r
+ core::parameters _parameters;\r
+ std::vector<std::wstring> _parameters2; // TODO this can be deprecated with a small amount of coding CP 2013-01\r
\r
private:\r
unsigned int channelIndex_;\r
public:\r
virtual bool Execute()\r
{\r
- _parameters2 = _parameters;\r
- for(size_t n = 0; n < _parameters.size(); ++n)\r
- _parameters[n] = boost::to_upper_copy(_parameters[n]);\r
+ _parameters2 = _parameters; // TODO Refactor this in terms of the new parameters class CP 2013-01\r
+ _parameters.to_upper();\r
return (TNeedChannel && !GetChannel()) || _parameters.size() < TMinParameters ? false : DoExecute();\r
}\r
\r
virtual int GetMinimumParameters(){return TMinParameters;}\r
protected:\r
~AMCPCommandBase(){}\r
+\r
private:\r
virtual bool DoExecute() = 0;\r
}; \r
//Perform loading of the clip\r
try\r
{\r
- _parameters[0] = _parameters[0];\r
- auto pFP = create_producer(GetChannel()->mixer(), _parameters, _parameters2); \r
+ //_parameters[0] = _parameters[0]; // REVIEW: Why is this assignment done? CP 2013-01\r
+ auto pFP = create_producer(GetChannel()->mixer(), _parameters); \r
GetChannel()->stage()->load(GetLayerIndex(), pFP, true);\r
\r
SetReplyString(TEXT("202 LOAD OK\r\n"));\r
//Perform loading of the clip\r
try\r
{\r
- _parameters[0] = _parameters[0];\r
- auto pFP = create_producer(GetChannel()->mixer(), _parameters, _parameters2);\r
+ //_parameters[0] = _parameters[0]; // REVIEW: Why is this assignment done? CP 2013-01\r
+ auto pFP = create_producer(GetChannel()->mixer(), _parameters);\r
if(pFP == frame_producer::empty())\r
BOOST_THROW_EXCEPTION(file_not_found() << msg_info(_parameters.size() > 0 ? narrow(_parameters[0]) : ""));\r
\r
lbg.SetChannelIndex(GetChannelIndex());\r
lbg.SetLayerIntex(GetLayerIndex());\r
lbg.SetClientInfo(GetClientInfo());\r
- for(auto it = _parameters2.begin(); it != _parameters2.end(); ++it)\r
- lbg.AddParameter(*it);\r
+ lbg.SetParameters(_parameters);\r
if(!lbg.Execute())\r
throw std::exception();\r
}\r
\r
bool PrintCommand::DoExecute()\r
{\r
- GetChannel()->output()->add(create_consumer(boost::assign::list_of(L"IMAGE")));\r
+ parameters params;
+ params.push_back(L"IMAGE");
+ GetChannel()->output()->add(create_consumer(params));
\r
SetReplyString(TEXT("202 PRINT OK\r\n"));\r
\r
on_consumer(bluefish::create_consumer(xml_consumer.second)); \r
else if (name == L"decklink") \r
on_consumer(decklink::create_consumer(xml_consumer.second)); \r
- else if (name == L"file") \r
+ else if (name == L"file" || name ==L"stream") \r
on_consumer(ffmpeg::create_consumer(xml_consumer.second)); \r
else if (name == L"system-audio")\r
on_consumer(oal::create_consumer());\r