]> git.sesse.net Git - casparcg/blob - server/frame/buffers/StaticFrameBuffer.h
e5f5b0ea587fb9416940c6a89424ae339b5eca32
[casparcg] / server / frame / buffers / StaticFrameBuffer.h
1 /*\r
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 *  This file is part of CasparCG.\r
5 *\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
10 *\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
15 \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
18 *\r
19 */\r
20  \r
21 #ifndef _STATIC_FRAME_BUFFER_\r
22 #define _STATIC_FRAME_BUFFER_\r
23 \r
24 #include "FrameBuffer.h"\r
25 #include "../Frame.h"\r
26 \r
27 #include <tbb/spin_mutex.h>\r
28 \r
29 namespace caspar\r
30 {\r
31 \r
32 class StaticFrameBuffer : public FrameBuffer, private utils::Noncopyable\r
33 {       \r
34 public:\r
35         StaticFrameBuffer();\r
36         virtual ~StaticFrameBuffer();\r
37 \r
38         virtual FramePtr front() const;\r
39         virtual FrameBufferFetchResult pop_front();\r
40         virtual void push_back(FramePtr);\r
41         virtual void clear();\r
42         virtual HANDLE GetWaitHandle() const;\r
43 \r
44 private:\r
45         utils::Event event_;\r
46         FramePtr pFrame_;\r
47         mutable tbb::spin_mutex mutex_;\r
48 };\r
49 \r
50 }\r
51 \r
52 #endif