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 "../../processor/frame.h"
\r
28 #include "../../server.h"
\r
30 #include <boost/assign/list_of.hpp>
\r
32 using namespace boost::assign;
\r
34 namespace caspar { namespace core { namespace flash {
\r
36 struct ct_producer : public cg_producer
\r
38 ct_producer(const std::wstring& filename) : filename_(filename), initialized_(false){}
\r
40 frame_ptr render_frame()
\r
44 cg_producer::add(0, filename_, 1);
\r
45 initialized_ = true;
\r
47 return cg_producer::render_frame();
\r
50 std::wstring print() const
\r
52 return L"ct_producer. filename: " + filename_;
\r
56 std::wstring filename_;
\r
59 frame_producer_ptr create_ct_producer(const std::vector<std::wstring>& params)
\r
61 std::wstring filename = server::media_folder() + L"\\" + params[0] + L".ct";
\r
62 return boost::filesystem::exists(filename) ? std::make_shared<ct_producer>(filename) : nullptr;
\r