2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG (www.casparcg.com).
\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
19 * Author: Robert Nagy, ronag89@gmail.com
\r
24 #include "host_buffer.h"
\r
25 #include "device_buffer.h"
\r
27 #include <common/spl/memory.h>
\r
29 #include <boost/noncopyable.hpp>
\r
30 #include <boost/thread/future.hpp>
\r
32 #include <common/concurrency/executor.h>
\r
34 namespace caspar { namespace accelerator { namespace ogl {
\r
36 class device : public std::enable_shared_from_this<device>, boost::noncopyable
\r
42 spl::shared_ptr<device_buffer> create_device_buffer(int width, int height, int stride);
\r
43 spl::shared_ptr<host_buffer> create_host_buffer(int size, host_buffer::usage usage);
\r
45 boost::unique_future<spl::shared_ptr<device_buffer>> copy_async(spl::shared_ptr<host_buffer>& source, int width, int height, int stride);
\r
47 std::wstring version();
\r
49 template<typename Func>
\r
50 auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> boost::unique_future<decltype(func())> // noexcept
\r
52 return executor_.begin_invoke(std::forward<Func>(func), priority);
\r
55 template<typename Func>
\r
56 auto invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> decltype(func())
\r
58 return executor_.invoke(std::forward<Func>(func), priority);
\r
62 spl::shared_ptr<impl> impl_;
\r