std::wstring filename = env::media_folder() + L"\\" + params[0] + L".ct";\r
if(!boost::filesystem::exists(filename))\r
return core::frame_producer::empty();\r
- \r
- boost::algorithm::replace_all(filename, L"\\", L"/");\r
- boost::algorithm::replace_all(filename, L"//", L"/");\r
- boost::algorithm::replace_all(filename, L"///", L"/");\r
- \r
+ \r
+ boost::filesystem2::wpath path(filename);\r
+ path = boost::filesystem2::complete(path);\r
+ filename = path.file_string();\r
+\r
auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>()); \r
auto producer = make_safe<cg_producer>(flash_producer);\r
producer->add(0, filename, 1);\r
\r
template_host get_template_host(const core::video_format_desc& desc)\r
{\r
- std::vector<template_host> template_hosts;\r
- BOOST_FOREACH(auto& xml_mapping, env::properties().get_child("configuration.producers.template-hosts"))\r
+ try\r
{\r
- try\r
+ std::vector<template_host> template_hosts;\r
+ BOOST_FOREACH(auto& xml_mapping, env::properties().get_child("configuration.producers.template-hosts"))\r
{\r
- template_host template_host;\r
- template_host.field_mode = xml_mapping.second.get("video-mode", narrow(desc.name));\r
- template_host.filename = xml_mapping.second.get("filename", "cg.fth");\r
- template_host.width = xml_mapping.second.get("width", desc.width);\r
- template_host.height = xml_mapping.second.get("height", desc.height);\r
- template_hosts.push_back(template_host);\r
+ try\r
+ {\r
+ template_host template_host;\r
+ template_host.field_mode = xml_mapping.second.get("video-mode", narrow(desc.name));\r
+ template_host.filename = xml_mapping.second.get("filename", "cg.fth");\r
+ template_host.width = xml_mapping.second.get("width", desc.width);\r
+ template_host.height = xml_mapping.second.get("height", desc.height);\r
+ template_hosts.push_back(template_host);\r
+ }\r
+ catch(...){}\r
}\r
- catch(...){}\r
- }\r
\r
- auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == narrow(desc.name);});\r
- if(template_host_it == template_hosts.end())\r
- template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == "";});\r
+ auto template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == narrow(desc.name);});\r
+ if(template_host_it == template_hosts.end())\r
+ template_host_it = boost::find_if(template_hosts, [&](template_host template_host){return template_host.field_mode == "";});\r
+\r
+ if(template_host_it != template_hosts.end())\r
+ return *template_host_it;\r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG(info) << L" Found no correct template-host configuration. Using cg.fth.";\r
+ }\r
\r
- if(template_host_it != template_hosts.end())\r
- return *template_host_it;\r
- \r
template_host template_host;\r
template_host.filename = "cg.fth";\r
template_host.width = desc.width;\r
<diagnostics>\r
<graphs>true</graphs>\r
</diagnostics>\r
- <consumers>\r
- <buffer-depth>3</buffer-depth>\r
- </consumers>\r
<mixers>\r
<blend-modes>false</blend-modes>\r
</mixers>\r
<producers>\r
- <buffer-depth>1</buffer-depth>\r
<auto-transcode>true</auto-transcode>\r
- <template-hosts>\r
- <template-host>\r
- <video-mode>1080i5994</video-mode>\r
- <filename>cg.fth.18.6000</filename>\r
- </template-host>\r
- <template-host>\r
- <video-mode>1080p5000</video-mode>\r
- <filename>cg.fth.18</filename>\r
- <width>1280</width>\r
- <height>720</height>\r
- </template-host>\r
- </template-hosts>\r
- </producers>\r
- <channels>\r
- <channel>\r
- <video-mode>1080p5000</video-mode>\r
- <consumers>\r
- <decklink>\r
- <device>1</device>\r
- <embedded-audio>true</embedded-audio>\r
- </decklink>\r
- </consumers>\r
- </channel>\r
- </channels>\r
+ </producers>\r
+ <channels>\r
+ <channel>\r
+ <video-mode>PAL</video-mode>\r
+ <consumers>\r
+ <bluefish>\r
+ <device>1</device>\r
+ <embedded-audio>true</embedded-audio>\r
+ </bluefish>\r
+ </consumers>\r
+ </channel>\r
+ <channel>\r
+ <video-mode>PAL</video-mode>\r
+ <consumers>\r
+ <screen>\r
+ <device>1</device>\r
+ </screen>\r
+ <system-audio/>\r
+ </consumers>\r
+ </channel>\r
+ </channels>\r
<controllers>\r
<tcp>\r
<port>5250</port>\r
</screen>\r
</consumers>\r
</channel> \r
---> \r
- \r
+-->\r
+\r
\r