X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fconsumer%2Fframe_consumer.h;h=531dee8edffe44822188e3087e173eb105c913bb;hb=3692d6cec6ad01b3786e25e7ff58ab82f066aa17;hp=090c2ff2181b8f7c661cbac0afe56d8a44a5c24f;hpb=f6a130bfe0eb0dd0c7c2d26908d358db3e2e8927;p=casparcg diff --git a/core/consumer/frame_consumer.h b/core/consumer/frame_consumer.h index 090c2ff21..531dee8ed 100644 --- a/core/consumer/frame_consumer.h +++ b/core/consumer/frame_consumer.h @@ -1,29 +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 "../video_format.h" +#pragma once #include #include +#include #include #include @@ -39,26 +40,18 @@ struct frame_consumer : boost::noncopyable virtual ~frame_consumer() {} virtual bool send(const safe_ptr& frame) = 0; - virtual void initialize(const video_format_desc& format_desc, int channel_index, int sub_index) = 0; + virtual void initialize(const 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 size_t buffer_depth() const = 0; + virtual int index() const = 0; - static const safe_ptr& empty() - { - struct empty_frame_consumer : public frame_consumer - { - virtual bool send(const safe_ptr&) override {return false;} - virtual void initialize(const video_format_desc&, int, int) override{} - virtual std::wstring print() const override {return L"empty";} - virtual bool has_synchronization_clock() const override {return false;} - virtual size_t buffer_depth() const override {return 0;}; - }; - static safe_ptr consumer = make_safe(); - return consumer; - } + static const safe_ptr& empty(); }; +safe_ptr create_consumer_cadence_guard(const safe_ptr& consumer); + typedef std::function(const std::vector&)> consumer_factory_t; void register_consumer_factory(const consumer_factory_t& factory);