/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
*\r
-* This ffmpeg 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
#include "../StdAfx.h"\r
\r
#include <common/concurrency/executor.h>\r
#include <common/diagnostics/graph.h>\r
-#include <common/utility/string.h>\r
#include <common/env.h>\r
+#include <common/utility/string.h>\r
+#include <common/utility/param.h>\r
\r
#include <boost/algorithm/string.hpp>\r
#include <boost/timer.hpp>\r
-#include <boost/thread/once.hpp>\r
-#include <boost/thread.hpp>\r
#include <boost/property_tree/ptree.hpp>\r
\r
#include <tbb/cache_aligned_allocator.h>\r
#include <tbb/parallel_invoke.h>\r
\r
-#include <cstdio>\r
-\r
#if defined(_MSC_VER)\r
#pragma warning (push)\r
#pragma warning (disable : 4244)\r
if(params.size() < 1 || params[0] != L"FILE")\r
return core::frame_consumer::empty();\r
\r
- auto filename = (params.size() > 1 ? params[1] : L"");\r
-\r
- bool key_only = std::find(params.begin(), params.end(), L"KEY_ONLY") != params.end();\r
-\r
- std::wstring codec = L"libx264";\r
- auto codec_it = std::find(params.begin(), params.end(), L"CODEC");\r
- if(codec_it != params.end() && codec_it++ != params.end())\r
- codec = *codec_it;\r
-\r
+ auto filename = (params.size() > 1 ? params[1] : L"");\r
+ bool key_only = get_param(L"KEY_ONLY", params, false);\r
+ auto codec = get_param(L"CODEC", params, L"libx264");\r
+ auto options = get_param(L"OPTIONS", params);\r
+ \r
if(codec == L"H264")\r
codec = L"libx264";\r
\r
if(codec == L"DVCPRO")\r
codec = L"dvvideo";\r
\r
- std::wstring options = L"";\r
- auto options_it = std::find(params.begin(), params.end(), L"OPTIONS");\r
- if(options_it != params.end() && options_it++ != params.end())\r
- options = *options_it;\r
+ boost::to_lower(options);\r
\r
- return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, boost::to_lower_copy(options));\r
+ return make_safe<ffmpeg_consumer_proxy>(env::media_folder() + filename, key_only, codec, options);\r
}\r
\r
safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree)\r