<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">true</ExcludedFromBuild>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Develop|Win32'">true</ExcludedFromBuild>\r
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
</ClCompile>\r
<ClCompile Include="StdAfx.cpp">\r
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">Create</PrecompiledHeader>\r
#include "../util/util.h"\r
\r
#include "../../ffmpeg/producer/filter/filter.h"\r
-#include "../../ffmpeg/producer/util.h"\r
-#include "../../ffmpeg/producer/frame_muxer.h"\r
+#include "../../ffmpeg/producer/util/util.h"\r
+#include "../../ffmpeg/producer/muxer/frame_muxer.h"\r
\r
#include <common/log/log.h>\r
#include <common/diagnostics/graph.h>\r
\r
#pragma warning(push)\r
\r
+#include <algorithm>\r
#include <functional>\r
\r
namespace caspar { namespace decklink {\r
\r
class decklink_producer_proxy : public Concurrency::agent, public core::frame_producer\r
{ \r
+ safe_ptr<diagnostics::graph> graph_;\r
+\r
Concurrency::unbounded_buffer<ffmpeg::frame_muxer2::video_source_element_t> video_frames_;\r
Concurrency::unbounded_buffer<ffmpeg::frame_muxer2::audio_source_element_t> audio_buffers_;\r
Concurrency::overwrite_buffer<ffmpeg::frame_muxer2::target_element_t> muxed_frames_;\r
\r
mutable Concurrency::single_assignment<std::wstring> print_;\r
\r
- volatile bool is_running_;\r
+ tbb::atomic<bool> is_running_;\r
public:\r
\r
explicit decklink_producer_proxy(const safe_ptr<core::frame_factory>& frame_factory, const core::video_format_desc& format_desc, size_t device_index, const std::wstring& filter_str, int64_t length)\r
, last_frame_(core::basic_frame::empty())\r
, length_(length)\r
, muxer_(&video_frames_, &audio_buffers_, muxed_frames_, format_desc.fps, frame_factory)\r
- , is_running_(true)\r
{\r
+ diagnostics::register_graph(graph_);\r
+ is_running_ = true;\r
agent::start();\r
}\r
\r
\r
try\r
{\r
- last_frame_ = frame = Concurrency::receive(muxed_frames_, 10);\r
+ last_frame_ = frame = Concurrency::receive(muxed_frames_, 10).first;\r
}\r
catch(Concurrency::operation_timed_out&)\r
{ \r
- //graph_->add_tag("underflow"); \r
+ graph_->add_tag("underflow"); \r
}\r
\r
return frame;\r
{\r
if(params.empty() || !boost::iequals(params[0], "decklink"))\r
return core::frame_producer::empty();\r
+ \r
+ std::vector<std::wstring> params2 = params;\r
+ std::for_each(std::begin(params2), std::end(params2), std::bind(&boost::to_upper<std::wstring>, std::placeholders::_1, std::locale()));\r
\r
- auto device_index = core::get_param(L"DEVICE", params, 1);\r
- auto filter_str = core::get_param<std::wstring>(L"FILTER", params, L""); \r
- auto length = core::get_param(L"LENGTH", params, std::numeric_limits<int64_t>::max()); \r
+ auto device_index = core::get_param(L"DEVICE", params2, 1);\r
+ auto filter_str = core::get_param<std::wstring>(L"FILTER", params2, L""); \r
+ auto length = core::get_param(L"LENGTH", params2, std::numeric_limits<int64_t>::max()); \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
- auto format_desc = core::video_format_desc::get(core::get_param<std::wstring>(L"FORMAT", params, L"INVALID"));\r
+ auto format_desc = core::video_format_desc::get(core::get_param<std::wstring>(L"FORMAT", params2, L"INVALID"));\r
\r
if(format_desc.format == core::video_format::invalid)\r
format_desc = frame_factory->get_video_format_desc();\r
if(ext == extensions.end())\r
return core::frame_producer::empty();\r
\r
+ std::vector<std::wstring> params2 = params;\r
+ std::for_each(std::begin(params2), std::end(params2), std::bind(&boost::to_upper<std::wstring>, std::placeholders::_1, std::locale()));\r
+\r
auto path = filename + L"." + *ext;\r
- auto loop = boost::range::find(params, L"LOOP") != params.end();\r
- auto start = core::get_param(L"SEEK", params, 0);\r
- auto length = core::get_param(L"LENGTH", params, std::numeric_limits<size_t>::max());\r
- auto filter_str = core::get_param<std::wstring>(L"FILTER", params, L""); \r
+ auto loop = boost::range::find(params2, L"LOOP") != params2.end();\r
+ auto start = core::get_param(L"SEEK", params2, 0);\r
+ auto length = core::get_param(L"LENGTH", params2, std::numeric_limits<size_t>::max());\r
+ auto filter_str = core::get_param<std::wstring>(L"FILTER", params2, 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