X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fconsumer%2Fframe_consumer.h;h=be4215349d95d4f9ba24e00080f87cec9dff9527;hb=f11a9a8f6a62a0adabba8aa485802df974085db5;hp=8b01c6ffe609c39d29289641e2d09c499e4fe17f;hpb=d05fa92305a6781af12c76f7487e1d3a163c472c;p=casparcg diff --git a/core/consumer/frame_consumer.h b/core/consumer/frame_consumer.h index 8b01c6ffe..be4215349 100644 --- a/core/consumer/frame_consumer.h +++ b/core/consumer/frame_consumer.h @@ -1,38 +1,56 @@ /* -* 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 +#include +#include namespace caspar { namespace core { -class read_frame; - struct frame_consumer : boost::noncopyable { + frame_consumer(){} virtual ~frame_consumer() {} + + 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; - virtual void send(const safe_ptr& frame) = 0; - virtual size_t buffer_depth() const = 0; + static const safe_ptr& empty(); }; +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); + }} \ No newline at end of file