2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
19 * Author: Robert Nagy, ronag89@gmail.com
26 #include <common/os/page_locked_allocator.h>
30 namespace caspar { namespace bluefish {
32 static const size_t MAX_HANC_BUFFER_SIZE = 256*1024;
33 static const size_t MAX_VBI_BUFFER_SIZE = 36*1920*4;
35 struct blue_dma_buffer
38 blue_dma_buffer(int image_size, int id)
40 , image_size_(image_size)
41 , hanc_size_(MAX_HANC_BUFFER_SIZE)
42 , image_buffer_(image_size_)
43 , hanc_buffer_(hanc_size_){}
45 int id() const {return id_;}
47 PBYTE image_data() { return image_buffer_.data(); }
48 PBYTE hanc_data() { return hanc_buffer_.data(); }
50 size_t image_size() const { return image_size_; }
51 size_t hanc_size() const { return hanc_size_; }
57 std::vector<BYTE, page_locked_allocator<BYTE>> image_buffer_;
58 std::vector<BYTE, page_locked_allocator<BYTE>> hanc_buffer_;
60 typedef std::shared_ptr<blue_dma_buffer> blue_dma_buffer_ptr;