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 <BlueVelvet4.h>
28 #include <common/os/page_locked_allocator.h>
32 namespace caspar { namespace bluefish {
34 static const size_t MAX_HANC_BUFFER_SIZE = 256*1024;
35 static const size_t MAX_VBI_BUFFER_SIZE = 36*1920*4;
37 struct blue_dma_buffer
40 blue_dma_buffer(int image_size, int id)
42 , image_size_(image_size)
43 , hanc_size_(MAX_HANC_BUFFER_SIZE)
44 , image_buffer_(image_size_)
45 , hanc_buffer_(hanc_size_){}
47 int id() const {return id_;}
49 PBYTE image_data() { return image_buffer_.data(); }
50 PBYTE hanc_data() { return hanc_buffer_.data(); }
52 size_t image_size() const { return image_size_; }
53 size_t hanc_size() const { return hanc_size_; }
59 std::vector<BYTE, page_locked_allocator<BYTE>> image_buffer_;
60 std::vector<BYTE, page_locked_allocator<BYTE>> hanc_buffer_;
62 typedef std::shared_ptr<blue_dma_buffer> blue_dma_buffer_ptr;