]> git.sesse.net Git - casparcg/blobdiff - core/consumer/frame/read_frame.h
2.0. core: Simplified layer and frame_producer logic.
[casparcg] / core / consumer / frame / read_frame.h
index 422f099c4d4ccf260de47f9dde6e8c75385531fe..02369f8a75b310ccb2494c7ef7f507f4762f718e 100644 (file)
@@ -1,24 +1,46 @@
+/*\r
+* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+*\r
+*  This file is part of CasparCG.\r
+*\r
+*    CasparCG is free software: you can redistribute it and/or modify\r
+*    it under the terms of the GNU General Public License as published by\r
+*    the Free Software Foundation, either version 3 of the License, or\r
+*    (at your option) any later version.\r
+*\r
+*    CasparCG is distributed in the hope that it will be useful,\r
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+*    GNU General Public License for more details.\r
+\r
+*    You should have received a copy of the GNU General Public License\r
+*    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
+*\r
+*/\r
 #pragma once\r
 \r
+#include <common/memory/safe_ptr.h>\r
+\r
 #include <boost/noncopyable.hpp>\r
 #include <boost/range/iterator_range.hpp>\r
 \r
-#include <memory>\r
-#include <vector>\r
-\r
-#include <common/memory/safe_ptr.h>\r
-\r
 namespace caspar { namespace core {\r
        \r
-class read_frame\r
+class read_frame : boost::noncopyable\r
 {\r
 public:\r
-       virtual const boost::iterator_range<const unsigned char*> image_data() const {return boost::iterator_range<const unsigned char*>();}\r
-       virtual const boost::iterator_range<const short*> audio_data() const {return boost::iterator_range<const short*>();}\r
+       virtual const boost::iterator_range<const unsigned char*> image_data() const = 0;\r
+       virtual const boost::iterator_range<const short*> audio_data() const = 0;\r
 \r
        static safe_ptr<const read_frame> empty()\r
        {\r
-               return safe_ptr<const read_frame>();\r
+               struct empty : public read_frame\r
+               {                       \r
+                       virtual const boost::iterator_range<const unsigned char*> image_data() const {return boost::iterator_range<const unsigned char*>();}\r
+                       virtual const boost::iterator_range<const short*> audio_data() const {return boost::iterator_range<const short*>();}\r
+               };\r
+               static safe_ptr<const empty> frame;\r
+               return frame;\r
        }\r
 };\r
 \r