Exemple #1
0
safe_ptr<core::frame_producer> create_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params)
{
	auto raw_producer = create_raw_producer(frame_factory, params);

	if (raw_producer == core::frame_producer::empty())
		return raw_producer;

	return create_producer_print_proxy(raw_producer);
}
Exemple #2
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)));
}
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)));
}
safe_ptr<frame_producer> create_channel_producer(const safe_ptr<core::frame_factory>& frame_factory, const safe_ptr<video_channel>& channel)
{
	return create_producer_print_proxy(
			make_safe<channel_producer>(frame_factory, channel));
}
safe_ptr<frame_producer> create_separated_producer(const safe_ptr<frame_producer>& fill, const safe_ptr<frame_producer>& key)
{
	return create_producer_print_proxy(
			make_safe<separated_producer>(fill, key));
}
safe_ptr<frame_producer> create_layer_producer(const safe_ptr<core::frame_factory>& frame_factory,
								const safe_ptr<stage>& stage, int layer)
{
	return create_producer_print_proxy(make_safe<layer_producer>(frame_factory, stage, layer));
}
safe_ptr<frame_producer> create_transition_producer(const field_mode::type& mode, const safe_ptr<frame_producer>& destination, const transition_info& info)
{
	return create_producer_print_proxy(
			make_safe<transition_producer>(mode, destination, info));
}