Example #1
0
safe_ptr<core::frame_producer> create_swf_producer(
		const safe_ptr<core::frame_factory>& frame_factory,
		const core::parameters& params) 
{
	auto filename = env::media_folder() + L"\\" + params.at_original(0) + L".swf";
	
	if(!boost::filesystem::exists(filename))
		return core::frame_producer::empty();

	swf_t::header_t header(filename);

	return create_producer_destroy_proxy(
		   create_producer_print_proxy(
			make_safe<flash_producer>(frame_factory, filename, header.frame_width, header.frame_height)));
}
Example #2
0
safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)
{
	if(params.empty() || !boost::iequals(params[0], "decklink"))
		return core::frame_producer::empty();

	auto device_index	= get_param(L"DEVICE", params, -1);
	if(device_index == -1)
		device_index = boost::lexical_cast<int>(params.at(1));
	auto filter_str		= get_param(L"FILTER", params); 	
	auto length			= get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max()); 	
	auto format_desc	= core::video_format_desc::get(get_param(L"FORMAT", params, L"INVALID"));
	
	boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");
	boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");
	
	if(format_desc.format == core::video_format::invalid)
		format_desc = frame_factory->get_video_format_desc();
			
	return create_producer_print_proxy(
		   create_producer_destroy_proxy(
			make_safe<decklink_producer_proxy>(frame_factory, format_desc, device_index, filter_str, length)));
}