X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fconsumer%2Fframe_consumer.h;h=be4215349d95d4f9ba24e00080f87cec9dff9527;hb=f11a9a8f6a62a0adabba8aa485802df974085db5;hp=a5fe5d4e4a4e03141a340c823e1d4a7202969d65;hpb=ff6d30a547b05bcc55d2c8201e70bb016c7c8afd;p=casparcg diff --git a/core/consumer/frame_consumer.h b/core/consumer/frame_consumer.h index a5fe5d4e4..be4215349 100644 --- a/core/consumer/frame_consumer.h +++ b/core/consumer/frame_consumer.h @@ -1,27 +1,30 @@ /* -* copyright (c) 2010 Sveriges Television AB +* Copyright (c) 2011 Sveriges Television AB * -* This file is part of CasparCG. +* This file is part of CasparCG (www.casparcg.com). * -* CasparCG is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. * -* CasparCG is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. - -* You should have received a copy of the GNU General Public License -* along with CasparCG. If not, see . +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . * +* Author: Robert Nagy, ronag89@gmail.com */ + #pragma once #include #include +#include #include #include @@ -29,35 +32,25 @@ namespace caspar { namespace core { -class read_frame; -struct video_format_desc; - struct frame_consumer : boost::noncopyable { + frame_consumer(){} virtual ~frame_consumer() {} - virtual void send(const safe_ptr& frame) = 0; - virtual size_t buffer_depth() const = 0; - virtual void initialize(const video_format_desc& format_desc) = 0; + virtual bool send(const safe_ptr& frame) = 0; + virtual void initialize(const struct video_format_desc& format_desc, int channel_index) = 0; virtual std::wstring print() const = 0; + virtual boost::property_tree::wptree info() const = 0; + virtual bool has_synchronization_clock() const {return true;} + virtual int buffer_depth() const = 0; + virtual int index() const = 0; - static const safe_ptr& empty() - { - struct empty_frame_consumer : public frame_consumer - { - virtual void send(const safe_ptr&){} - virtual size_t buffer_depth() const{return 0;} - virtual void initialize(const video_format_desc&){} - virtual std::wstring print() const {return L"empty";} - }; - static safe_ptr consumer = make_safe(); - return consumer; - } + static const safe_ptr& empty(); }; -typedef std::function(const std::vector&)> consumer_factory_t; +typedef std::function(const std::vector&)> consumer_factory_t; void register_consumer_factory(const consumer_factory_t& factory); -safe_ptr create_consumer(const std::vector& params); +safe_ptr create_consumer(const std::vector& params); }} \ No newline at end of file