]> git.sesse.net Git - casparcg/blobdiff - core/frame/frame_factory.h
2.1.0: -draw_frame: Pass by value instead of shared_ptr. -Added some comments.
[casparcg] / core / frame / frame_factory.h
index ba799a3393eb444654df9c1e90deaf24aed12d29..ae575d1ea2888ced63b644e11d7106ac5df455f3 100644 (file)
@@ -1,25 +1,58 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\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
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
 #pragma once\r
 \r
-#include "gpu_frame.h"\r
-#include "frame_format.h"\r
+#include "data_frame.h"\r
+\r
+#include <common/spl/memory.h>\r
 \r
-#include <memory>\r
-#include <array>\r
+#include <core/video_format.h>\r
 \r
-namespace caspar { namespace core { \r
-       \r
-struct frame_factory\r
+namespace caspar { namespace core {\r
+                       \r
+class frame_factory : boost::noncopyable\r
 {\r
+       frame_factory(const frame_factory&);\r
+       frame_factory& operator=(const frame_factory&);\r
+public:\r
+       /// Static Members\r
+\r
+       //Constructors\r
+\r
+       frame_factory(){}\r
        virtual ~frame_factory(){}\r
-       virtual void release_frames(void* tag) = 0;\r
-       virtual gpu_frame_ptr create_frame(size_t width, size_t height, void* tag) = 0;\r
-       virtual gpu_frame_ptr create_frame(const planar_frame_dimension& data_size, void* tag) = 0;\r
-       gpu_frame_ptr create_frame(const frame_format_desc format_desc, void* tag)\r
+\r
+       /// Methods\r
+\r
+       virtual spl::unique_ptr<class data_frame>       create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) = 0;   \r
+       spl::unique_ptr<class data_frame>                       create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc)\r
        {\r
-               return create_frame(format_desc.width, format_desc.height, tag);\r
+               auto format_desc = video_format_desc();\r
+               return create_frame(video_stream_tag, desc, format_desc.fps, format_desc.field_mode);\r
        }\r
-};\r
 \r
-typedef std::shared_ptr<frame_factory> frame_factory_ptr;\r
+       /// Properties\r
+\r
+       virtual struct video_format_desc video_format_desc() const = 0; \r
+};\r
 \r
 }}
\ No newline at end of file