// Copyright (c) 2012-2017 VideoStitch SAS // Copyright (c) 2018 stitchEm #pragma once #include "core/readerController.hpp" #include "panoPipeline.hpp" #include "libvideostitch/allocator.hpp" #include "libvideostitch/imageMergerFactory.hpp" #include "libvideostitch/imageWarperFactory.hpp" #include "libvideostitch/imageFlowFactory.hpp" #include "libvideostitch/inputFactory.hpp" #include "gpu/2dBuffer.hpp" #include #include namespace VideoStitch { namespace Core { /** A wrapper around ReaderController that simplifies the API just to get frames with the default reader. Additionally, frames are unpacked on the GPU, and then copied back to the host. TODO performance is probably terrible */ template class ControllerInputFrames { public: static Potential create(const Core::PanoDefinition* pano); ~ControllerInputFrames(); Status seek(frameid_t frame); // load a set of frames from the readers // memory is valid until the next load() call Status load(std::map>>& frames, mtime_t* date = nullptr); private: Status init(const Core::PanoDefinition*); Status processFrame(Buffer readerFrame, GPU::HostBuffer readbackDestination, readerid_t readerID); Core::ReaderController* readerController; std::vector> readbackFrames; GPU::Buffer devBuffer; GPU::Buffer2D grayscale; SourceSurface* surf = nullptr; GPU::Stream stream; }; } // namespace Core } // namespace VideoStitch