]> git.sesse.net Git - casparcg/blobdiff - core/producer/frame_producer.h
2.0.0.2: Moved ATL init to shell.
[casparcg] / core / producer / frame_producer.h
index 9e36deedddbd8768b09d18d64e3c699b5ad04f81..2b399e49693ab86628193d8eaf3ccdc5e4a11dfc 100644 (file)
 */\r
 #pragma once\r
 \r
-#include "../processor/draw_frame.h"\r
-#include "../processor/frame_processor_device.h"\r
+#include "../mixer/frame/draw_frame.h"\r
+#include "../mixer/frame_factory.h"\r
 \r
-#include <common/utility/safe_ptr.h>\r
+#include <common/memory/safe_ptr.h>\r
 \r
 #include <boost/noncopyable.hpp>\r
 \r
@@ -66,27 +66,27 @@ public:
        virtual void set_leading_producer(const safe_ptr<frame_producer>& /*producer*/) {}  // nothrow\r
        \r
        ////////////////////////////////////////////////////////////////////////////////////////////////////\r
-       /// \fn virtual void :::initialize(const safe_ptr<frame_processor_device>& frame_processor) = 0;\r
+       /// \fn virtual void :::initialize(const safe_ptr<frame_factory>& frame_factory) = 0;\r
        ///\r
-       /// \brief      Provides the frame frame_processor used to create frames and initializes the producer. \r
+       /// \brief      Provides the frame frame_factory used to create frames and initializes the producer. \r
        ///\r
-       /// \param      frame_processor The frame frame_processor\r
+       /// \param      frame_factory   The frame frame_factory\r
        ////////////////////////////////////////////////////////////////////////////////////////////////////\r
-       virtual void initialize(const safe_ptr<frame_processor_device>& frame_processor) = 0;\r
+       virtual void initialize(const safe_ptr<frame_factory>& frame_factory) = 0;\r
 \r
-       static safe_ptr<frame_producer> empty()  // nothrow\r
+       static const safe_ptr<frame_producer>& empty()  // nothrow\r
        {\r
                struct empty_frame_producer : public frame_producer\r
                {\r
-                       virtual safe_ptr<draw_frame> receive(){return draw_frame::eof();}\r
-                       virtual void initialize(const safe_ptr<frame_processor_device>&){}\r
+                       virtual safe_ptr<draw_frame> receive(){return draw_frame::empty();}\r
+                       virtual void initialize(const safe_ptr<frame_factory>&){}\r
                        virtual std::wstring print() const { return L"empty";}\r
                };\r
                static safe_ptr<frame_producer> producer = make_safe<empty_frame_producer>();\r
                return producer;\r
        }\r
 \r
-       virtual std::wstring print() const = 0;\r
+       virtual std::wstring print() const = 0; // nothrow\r
 };\r
 \r
 inline std::wostream& operator<<(std::wostream& out, const frame_producer& producer)\r
@@ -95,4 +95,10 @@ inline std::wostream& operator<<(std::wostream& out, const frame_producer& produ
        return out;\r
 }\r
 \r
+inline std::wostream& operator<<(std::wostream& out, const safe_ptr<const frame_producer>& producer)\r
+{\r
+       out << producer->print().c_str();\r
+       return out;\r
+}\r
+\r
 }}\r