2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG.
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
21 #include "../../stdafx.h"
\r
23 #include "ct_producer.h"
\r
25 #include "cg_producer.h"
\r
27 #include "../../../common/utility/find_file.h"
\r
28 #include "../../frame/gpu_frame.h"
\r
29 #include "../../server.h"
\r
31 #include <boost/assign/list_of.hpp>
\r
33 using namespace boost::assign;
\r
35 namespace caspar { namespace flash {
\r
37 frame_producer_ptr create_ct_producer(const std::vector<std::wstring>& params, const frame_format_desc& format_desc)
\r
39 std::wstring filename = params[0];
\r
40 std::wstring result_filename = common::find_file(server::media_folder() + filename, list_of(L"ct"));
\r
41 if(result_filename.empty())
\r
44 std::wstring fixed_filename = result_filename;
\r
45 std::wstring::size_type pos = 0;
\r
46 while((pos = fixed_filename.find(TEXT('\\'), pos)) != std::wstring::npos)
\r
47 fixed_filename[pos] = TEXT('/');
\r
49 cg_producer_ptr cg_producer(new cg_producer(format_desc));
\r
50 cg_producer->add(0, filename, 1);
\r