X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fframe%2Fframe_factory.h;h=ae575d1ea2888ced63b644e11d7106ac5df455f3;hb=d1a8a306f4ccb5350aeaf41057e78ef3afc0b39e;hp=ba799a3393eb444654df9c1e90deaf24aed12d29;hpb=5330bed3a2561cb356dbe530c5deb71ade0802e2;p=casparcg diff --git a/core/frame/frame_factory.h b/core/frame/frame_factory.h index ba799a339..ae575d1ea 100644 --- a/core/frame/frame_factory.h +++ b/core/frame/frame_factory.h @@ -1,25 +1,58 @@ +/* +* Copyright (c) 2011 Sveriges Television AB +* +* 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 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 "gpu_frame.h" -#include "frame_format.h" +#include "data_frame.h" + +#include -#include -#include +#include -namespace caspar { namespace core { - -struct frame_factory +namespace caspar { namespace core { + +class frame_factory : boost::noncopyable { + frame_factory(const frame_factory&); + frame_factory& operator=(const frame_factory&); +public: + /// Static Members + + //Constructors + + frame_factory(){} virtual ~frame_factory(){} - virtual void release_frames(void* tag) = 0; - virtual gpu_frame_ptr create_frame(size_t width, size_t height, void* tag) = 0; - virtual gpu_frame_ptr create_frame(const planar_frame_dimension& data_size, void* tag) = 0; - gpu_frame_ptr create_frame(const frame_format_desc format_desc, void* tag) + + /// Methods + + virtual spl::unique_ptr create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc, double frame_rate, core::field_mode field_mode) = 0; + spl::unique_ptr create_frame(const void* video_stream_tag, const struct pixel_format_desc& desc) { - return create_frame(format_desc.width, format_desc.height, tag); + auto format_desc = video_format_desc(); + return create_frame(video_stream_tag, desc, format_desc.fps, format_desc.field_mode); } -}; -typedef std::shared_ptr frame_factory_ptr; + /// Properties + + virtual struct video_format_desc video_format_desc() const = 0; +}; }} \ No newline at end of file