diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/buffer.h | 61 | ||||
-rw-r--r-- | include/libcamera/stream.h | 23 |
2 files changed, 0 insertions, 84 deletions
diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index 0eb84c32..8e5ec699 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -7,7 +7,6 @@ #ifndef __LIBCAMERA_BUFFER_H__ #define __LIBCAMERA_BUFFER_H__ -#include <array> #include <stdint.h> #include <vector> @@ -16,7 +15,6 @@ namespace libcamera { class Request; -class Stream; struct FrameMetadata { enum Status { @@ -71,65 +69,6 @@ private: unsigned int cookie_; }; -class BufferMemory final -{ -public: - const std::vector<FrameBuffer::Plane> &planes() const { return planes_; } - std::vector<FrameBuffer::Plane> &planes() { return planes_; } - -private: - std::vector<FrameBuffer::Plane> planes_; -}; - -class BufferPool final -{ -public: - ~BufferPool(); - - void createBuffers(unsigned int count); - void destroyBuffers(); - - unsigned int count() const { return buffers_.size(); } - std::vector<BufferMemory> &buffers() { return buffers_; } - -private: - std::vector<BufferMemory> buffers_; -}; - -class Buffer final -{ -public: - Buffer(unsigned int index = -1, const Buffer *metadata = nullptr); - Buffer(const Buffer &) = delete; - Buffer &operator=(const Buffer &) = delete; - - unsigned int index() const { return index_; } - const std::array<int, 3> &dmabufs() const { return dmabuf_; } - BufferMemory *mem() { return mem_; } - - const FrameMetadata &metadata() const { return metadata_; }; - - Request *request() const { return request_; } - Stream *stream() const { return stream_; } - -private: - friend class Camera; - friend class Request; - friend class Stream; - friend class V4L2VideoDevice; - - void cancel(); - - unsigned int index_; - std::array<int, 3> dmabuf_; - BufferMemory *mem_; - - FrameMetadata metadata_; - - Request *request_; - Stream *stream_; -}; - } /* namespace libcamera */ #endif /* __LIBCAMERA_BUFFER_H__ */ diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index a404eccf..29a8030d 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -36,11 +36,6 @@ private: std::map<PixelFormat, std::vector<SizeRange>> formats_; }; -enum MemoryType { - InternalMemory, - ExternalMemory, -}; - struct StreamConfiguration { StreamConfiguration(); StreamConfiguration(const StreamFormats &formats); @@ -48,7 +43,6 @@ struct StreamConfiguration { PixelFormat pixelFormat; Size size; - MemoryType memoryType; unsigned int bufferCount; Stream *stream() const { return stream_; } @@ -75,29 +69,12 @@ class Stream public: Stream(); - std::unique_ptr<Buffer> createBuffer(unsigned int index); - std::unique_ptr<Buffer> createBuffer(const std::array<int, 3> &fds); - - BufferPool &bufferPool() { return bufferPool_; } - std::vector<BufferMemory> &buffers() { return bufferPool_.buffers(); } const StreamConfiguration &configuration() const { return configuration_; } - MemoryType memoryType() const { return memoryType_; } protected: friend class Camera; - int mapBuffer(const Buffer *buffer); - void unmapBuffer(const Buffer *buffer); - - void createBuffers(MemoryType memory, unsigned int count); - void destroyBuffers(); - - BufferPool bufferPool_; StreamConfiguration configuration_; - MemoryType memoryType_; - -private: - std::vector<std::pair<std::array<int, 3>, unsigned int>> bufferCache_; }; } /* namespace libcamera */ |