Patch Detail
Show a patch.
GET /api/1.1/patches/2472/?format=api
{ "id": 2472, "url": "https://patchwork.libcamera.org/api/1.1/patches/2472/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2472/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20191230120510.938333-23-niklas.soderlund@ragnatech.se>", "date": "2019-12-30T12:05:07", "name": "[libcamera-devel,v2,22/25] libcamera: Remove dead code after switch to FrameBuffer", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0d26ebac6ca8129820234e64f5ea5711e3fbb86c", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2472/mbox/", "series": [ { "id": 593, "url": "https://patchwork.libcamera.org/api/1.1/series/593/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=593", "date": "2019-12-30T12:04:45", "name": "libcamera: Rework buffer API", "version": 2, "mbox": "https://patchwork.libcamera.org/series/593/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2472/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2472/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 57AFF6046A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Dec 2019 13:06:12 +0100 (CET)", "from bismarck.berto.se (p4fca2fd0.dip0.t-ipconnect.de\n\t[79.202.47.208]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid c47032a7-2afc-11ea-a00b-005056917a89;\n\tMon, 30 Dec 2019 13:06:10 +0100 (CET)" ], "X-Halon-ID": "c47032a7-2afc-11ea-a00b-005056917a89", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 30 Dec 2019 13:05:07 +0100", "Message-Id": "<20191230120510.938333-23-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.24.1", "In-Reply-To": "<20191230120510.938333-1-niklas.soderlund@ragnatech.se>", "References": "<20191230120510.938333-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 22/25] libcamera: Remove dead code\n\tafter switch to FrameBuffer", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Mon, 30 Dec 2019 12:06:12 -0000" }, "content": "Delete all dead code after switching to the FrameBuffer interface.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/buffer.h | 61 ---------\n include/libcamera/stream.h | 23 ----\n src/android/camera_device.cpp | 1 -\n src/libcamera/buffer.cpp | 189 -------------------------\n src/libcamera/stream.cpp | 250 +---------------------------------\n 5 files changed, 2 insertions(+), 522 deletions(-)", "diff": "diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h\nindex 8bd61f786748af5f..9d4443cf56d4b60b 100644\n--- a/include/libcamera/buffer.h\n+++ b/include/libcamera/buffer.h\n@@ -7,7 +7,6 @@\n #ifndef __LIBCAMERA_BUFFER_H__\n #define __LIBCAMERA_BUFFER_H__\n \n-#include <array>\n #include <stdint.h>\n #include <vector>\n \n@@ -16,7 +15,6 @@\n namespace libcamera {\n \n class Request;\n-class Stream;\n \n struct FrameMetadata {\n \tenum Status {\n@@ -65,65 +63,6 @@ private:\n \tunsigned int cookie_;\n };\n \n-class BufferMemory final\n-{\n-public:\n-\tconst std::vector<FrameBuffer::Plane> &planes() const { return planes_; }\n-\tstd::vector<FrameBuffer::Plane> &planes() { return planes_; }\n-\n-private:\n-\tstd::vector<FrameBuffer::Plane> planes_;\n-};\n-\n-class BufferPool final\n-{\n-public:\n-\t~BufferPool();\n-\n-\tvoid createBuffers(unsigned int count);\n-\tvoid destroyBuffers();\n-\n-\tunsigned int count() const { return buffers_.size(); }\n-\tstd::vector<BufferMemory> &buffers() { return buffers_; }\n-\n-private:\n-\tstd::vector<BufferMemory> buffers_;\n-};\n-\n-class Buffer final\n-{\n-public:\n-\tBuffer(unsigned int index = -1, const Buffer *metadata = nullptr);\n-\tBuffer(const Buffer &) = delete;\n-\tBuffer &operator=(const Buffer &) = delete;\n-\n-\tunsigned int index() const { return index_; }\n-\tconst std::array<int, 3> &dmabufs() const { return dmabuf_; }\n-\tBufferMemory *mem() { return mem_; }\n-\n-\tconst FrameMetadata &metadata() const { return metadata_; };\n-\n-\tRequest *request() const { return request_; }\n-\tStream *stream() const { return stream_; }\n-\n-private:\n-\tfriend class Camera;\n-\tfriend class Request;\n-\tfriend class Stream;\n-\tfriend class V4L2VideoDevice;\n-\n-\tvoid cancel();\n-\n-\tunsigned int index_;\n-\tstd::array<int, 3> dmabuf_;\n-\tBufferMemory *mem_;\n-\n-\tFrameMetadata metadata_;\n-\n-\tRequest *request_;\n-\tStream *stream_;\n-};\n-\n } /* namespace libcamera */\n \n #endif /* __LIBCAMERA_BUFFER_H__ */\ndiff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex a404eccf34d9c93b..29a8030dff71d58f 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -36,11 +36,6 @@ private:\n \tstd::map<PixelFormat, std::vector<SizeRange>> formats_;\n };\n \n-enum MemoryType {\n-\tInternalMemory,\n-\tExternalMemory,\n-};\n-\n struct StreamConfiguration {\n \tStreamConfiguration();\n \tStreamConfiguration(const StreamFormats &formats);\n@@ -48,7 +43,6 @@ struct StreamConfiguration {\n \tPixelFormat pixelFormat;\n \tSize size;\n \n-\tMemoryType memoryType;\n \tunsigned int bufferCount;\n \n \tStream *stream() const { return stream_; }\n@@ -75,29 +69,12 @@ class Stream\n public:\n \tStream();\n \n-\tstd::unique_ptr<Buffer> createBuffer(unsigned int index);\n-\tstd::unique_ptr<Buffer> createBuffer(const std::array<int, 3> &fds);\n-\n-\tBufferPool &bufferPool() { return bufferPool_; }\n-\tstd::vector<BufferMemory> &buffers() { return bufferPool_.buffers(); }\n \tconst StreamConfiguration &configuration() const { return configuration_; }\n-\tMemoryType memoryType() const { return memoryType_; }\n \n protected:\n \tfriend class Camera;\n \n-\tint mapBuffer(const Buffer *buffer);\n-\tvoid unmapBuffer(const Buffer *buffer);\n-\n-\tvoid createBuffers(MemoryType memory, unsigned int count);\n-\tvoid destroyBuffers();\n-\n-\tBufferPool bufferPool_;\n \tStreamConfiguration configuration_;\n-\tMemoryType memoryType_;\n-\n-private:\n-\tstd::vector<std::pair<std::array<int, 3>, unsigned int>> bufferCache_;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 21417aba19135de5..cf2cd2ea9d1aa619 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -641,7 +641,6 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)\n \tStreamConfiguration *streamConfiguration = &config_->at(0);\n \tstreamConfiguration->size.width = camera3Stream->width;\n \tstreamConfiguration->size.height = camera3Stream->height;\n-\tstreamConfiguration->memoryType = ExternalMemory;\n \n \t/*\n \t * \\todo We'll need to translate from Android defined pixel format codes\ndiff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp\nindex 686d0412bf54b2c1..7200a24d4b90cc88 100644\n--- a/src/libcamera/buffer.cpp\n+++ b/src/libcamera/buffer.cpp\n@@ -85,195 +85,6 @@ LOG_DEFINE_CATEGORY(Buffer)\n * \\brief Array holding plane specific metadata\n */\n \n-/**\n- * \\class BufferMemory\n- * \\brief A memory buffer to store an image\n- *\n- * The BufferMemory class represents the memory buffers used to store full frame\n- * images, which may contain multiple separate memory Plane objects if the\n- * image format is multi-planar.\n- */\n-\n-/**\n- * \\fn BufferMemory::planes() const\n- * \\brief Retrieve the planes within the buffer\n- * \\return A const reference to a vector holding all planes within the buffer\n- */\n-\n-/**\n- * \\fn BufferMemory::planes()\n- * \\brief Retrieve the planes within the buffer\n- * \\return A reference to a vector holding all planes within the buffer\n- */\n-\n-/**\n- * \\class BufferPool\n- * \\brief A pool of buffers\n- *\n- * The BufferPool class groups together a collection of Buffers to store frames.\n- * The buffers must be exported by a device before they can be imported into\n- * another device for further use.\n- */\n-\n-BufferPool::~BufferPool()\n-{\n-\tdestroyBuffers();\n-}\n-\n-/**\n- * \\brief Create buffers in the Pool\n- * \\param[in] count The number of buffers to create\n- */\n-void BufferPool::createBuffers(unsigned int count)\n-{\n-\tbuffers_.resize(count);\n-}\n-\n-/**\n- * \\brief Release all buffers from pool\n- *\n- * If no buffers have been created or if buffers have already been released no\n- * operation is performed.\n- */\n-void BufferPool::destroyBuffers()\n-{\n-\tbuffers_.resize(0);\n-}\n-\n-/**\n- * \\fn BufferPool::count()\n- * \\brief Retrieve the number of buffers contained within the pool\n- * \\return The number of buffers contained in the pool\n- */\n-\n-/**\n- * \\fn BufferPool::buffers()\n- * \\brief Retrieve all the buffers in the pool\n- * \\return A vector containing all the buffers in the pool.\n- */\n-\n-/**\n- * \\class Buffer\n- * \\brief A buffer handle and dynamic metadata\n- *\n- * The Buffer class references a buffer memory and associates dynamic metadata\n- * related to the frame contained in the buffer. It allows referencing buffer\n- * memory through a single interface regardless of whether the memory is\n- * allocated internally in libcamera or provided externally through dmabuf.\n- *\n- * Buffer instances are allocated dynamically for a stream through\n- * Stream::createBuffer(), added to a request with Request::addBuffer() and\n- * deleted automatically after the request complete handler returns.\n- */\n-\n-/**\n- * \\brief Construct a buffer not associated with any stream\n- *\n- * This method constructs an orphaned buffer not associated with any stream. It\n- * is not meant to be called by applications, they should instead create buffers\n- * for a stream with Stream::createBuffer().\n- */\n-Buffer::Buffer(unsigned int index, const Buffer *metadata)\n-\t: index_(index), dmabuf_({ -1, -1, -1 }), request_(nullptr),\n-\t stream_(nullptr)\n-{\n-\tmetadata_.status = FrameMetadata::FrameSuccess;\n-\n-\tif (metadata) {\n-\t\tmetadata_.sequence = metadata->metadata().sequence;\n-\t\tmetadata_.timestamp = metadata->metadata().timestamp;\n-\t\tmetadata_.planes = metadata->metadata().planes;\n-\t} else {\n-\t\tmetadata_.sequence = 0;\n-\t\tmetadata_.timestamp = 0;\n-\t\tmetadata_.planes = { { 0 } };\n-\t}\n-}\n-\n-/**\n- * \\fn Buffer::index()\n- * \\brief Retrieve the Buffer index\n- * \\return The buffer index\n- */\n-\n-/**\n- * \\fn Buffer::dmabufs()\n- * \\brief Retrieve the dmabuf file descriptors for all buffer planes\n- *\n- * The dmabufs array contains one dmabuf file descriptor per plane. Unused\n- * entries are set to -1.\n- *\n- * \\return The dmabuf file descriptors\n- */\n-\n-/**\n- * \\fn Buffer::mem()\n- * \\brief Retrieve the BufferMemory this buffer is associated with\n- *\n- * The association between the buffer and a BufferMemory instance is valid from\n- * the time the request containing this buffer is queued to a camera to the end\n- * of that request's completion handler.\n- *\n- * \\return The BufferMemory this buffer is associated with\n- */\n-\n-/**\n- * \\fn Buffer::metadata()\n- * \\brief Retrieve the buffer metadata\n- *\n- * The buffer metadata is update every time the buffer contained are changed,\n- * for example when it is dequeued from hardware.\n- *\n- * \\return Metadata for the buffer\n- */\n-\n-/**\n- * \\fn Buffer::request()\n- * \\brief Retrieve the request this buffer belongs to\n- *\n- * The intended callers of this method are buffer completion handlers that\n- * need to associate a buffer to the request it belongs to.\n- *\n- * A Buffer is associated to a request by Request::prepare() and the\n- * association is valid until the buffer completes. The returned request\n- * pointer is valid only during that interval.\n- *\n- * \\return The Request the Buffer belongs to, or nullptr if the buffer is\n- * either completed or not associated with a request\n- */\n-\n-/**\n- * \\fn Buffer::stream()\n- * \\brief Retrieve the stream this buffer is associated with\n- *\n- * A Buffer is associated to the stream that created it with\n- * Stream::createBuffer() and the association is valid until the buffer is\n- * destroyed. Buffer instances that are created directly are not associated\n- * with any stream.\n- *\n- * \\return The Stream the Buffer is associated with, or nullptr if the buffer\n- * is not associated with a stream\n- */\n-\n-/**\n- * \\brief Mark a buffer as cancel by setting its status to BufferCancelled\n- */\n-void Buffer::cancel()\n-{\n-\tmetadata_.status = FrameMetadata::FrameCancelled;\n-\tmetadata_.sequence = 0;\n-\tmetadata_.timestamp = 0;\n-\tmetadata_.planes = {};\n-}\n-\n-/**\n- * \\var Buffer::request_\n- * \\brief The request this buffer belongs to\n- *\n- * This member is intended to be set by Request::prepare() and\n- * Request::completeBuffer().\n- */\n-\n /**\n * \\class FrameBuffer\n * \\brief A buffer handle and dynamic metadata\ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex a6adc0de5da40063..13789e9eb344f95c 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -266,17 +266,6 @@ SizeRange StreamFormats::range(PixelFormat pixelformat) const\n \treturn range;\n }\n \n-/**\n- * \\enum MemoryType\n- * \\brief Define the memory type used by a Stream\n- * \\var MemoryType::InternalMemory\n- * The Stream uses memory allocated internally by the library and exported to\n- * applications.\n- * \\var MemoryType::ExternalMemory\n- * The Stream uses memory allocated externally by application and imported in\n- * the library.\n- */\n-\n /**\n * \\struct StreamConfiguration\n * \\brief Configuration parameters for a stream\n@@ -290,7 +279,7 @@ SizeRange StreamFormats::range(PixelFormat pixelformat) const\n * handlers provied StreamFormats.\n */\n StreamConfiguration::StreamConfiguration()\n-\t: pixelFormat(0), memoryType(InternalMemory), stream_(nullptr)\n+\t: pixelFormat(0), stream_(nullptr)\n {\n }\n \n@@ -298,8 +287,7 @@ StreamConfiguration::StreamConfiguration()\n * \\brief Construct a configuration with stream formats\n */\n StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n-\t: pixelFormat(0), memoryType(InternalMemory), stream_(nullptr),\n-\t formats_(formats)\n+\t: pixelFormat(0), stream_(nullptr), formats_(formats)\n {\n }\n \n@@ -313,11 +301,6 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n * \\brief Stream pixel format\n */\n \n-/**\n- * \\var StreamConfiguration::memoryType\n- * \\brief The memory type the stream shall use\n- */\n-\n /**\n * \\var StreamConfiguration::bufferCount\n * \\brief Requested number of buffers to allocate for the stream\n@@ -420,236 +403,12 @@ Stream::Stream()\n {\n }\n \n-/**\n- * \\brief Create a Buffer instance referencing the memory buffer \\a index\n- * \\param[in] index The desired buffer index\n- *\n- * This method creates a Buffer instance that references a BufferMemory from\n- * the stream's buffers pool by its \\a index. The index shall be lower than the\n- * number of buffers in the pool.\n- *\n- * This method is only valid for streams that use the InternalMemory type. It\n- * will return a null pointer when called on streams using the ExternalMemory\n- * type.\n- *\n- * \\return A newly created Buffer on success or nullptr otherwise\n- */\n-std::unique_ptr<Buffer> Stream::createBuffer(unsigned int index)\n-{\n-\tif (memoryType_ != InternalMemory) {\n-\t\tLOG(Stream, Error) << \"Invalid stream memory type\";\n-\t\treturn nullptr;\n-\t}\n-\n-\tif (index >= bufferPool_.count()) {\n-\t\tLOG(Stream, Error) << \"Invalid buffer index \" << index;\n-\t\treturn nullptr;\n-\t}\n-\n-\tBuffer *buffer = new Buffer();\n-\tbuffer->index_ = index;\n-\tbuffer->stream_ = this;\n-\n-\treturn std::unique_ptr<Buffer>(buffer);\n-}\n-\n-/**\n- * \\brief Create a Buffer instance that represents a memory area identified by\n- * dmabuf file descriptors\n- * \\param[in] fds The dmabuf file descriptors for each plane\n- *\n- * This method creates a Buffer instance that references buffer memory\n- * allocated outside of libcamera through dmabuf file descriptors. The \\a\n- * dmabuf array shall contain a file descriptor for each plane in the buffer,\n- * and unused entries shall be set to -1.\n- *\n- * The buffer is created without a valid index, as it does not yet map to any of\n- * the stream's BufferMemory instances. An index will be assigned at the time\n- * the buffer is queued to the camera in a request. Applications may thus\n- * create any number of Buffer instances, providing that no more than the\n- * number of buffers allocated for the stream are queued at any given time.\n- *\n- * This method is only valid for streams that use the ExternalMemory type. It\n- * will return a null pointer when called on streams using the InternalMemory\n- * type.\n- *\n- * \\sa Stream::mapBuffer()\n- *\n- * \\return A newly created Buffer on success or nullptr otherwise\n- */\n-std::unique_ptr<Buffer> Stream::createBuffer(const std::array<int, 3> &fds)\n-{\n-\tif (memoryType_ != ExternalMemory) {\n-\t\tLOG(Stream, Error) << \"Invalid stream memory type\";\n-\t\treturn nullptr;\n-\t}\n-\n-\tBuffer *buffer = new Buffer();\n-\tbuffer->dmabuf_ = fds;\n-\tbuffer->stream_ = this;\n-\n-\treturn std::unique_ptr<Buffer>(buffer);\n-}\n-\n-/**\n- * \\fn Stream::bufferPool()\n- * \\brief Retrieve the buffer pool for the stream\n- *\n- * The buffer pool handles the memory buffers used to store frames for the\n- * stream. It is initially created empty and shall be populated with\n- * buffers before being used.\n- *\n- * \\return A reference to the buffer pool\n- */\n-\n-/**\n- * \\fn Stream::buffers()\n- * \\brief Retrieve the memory buffers in the Stream's buffer pool\n- * \\return The list of stream's memory buffers\n- */\n-\n /**\n * \\fn Stream::configuration()\n * \\brief Retrieve the active configuration of the stream\n * \\return The active configuration of the stream\n */\n \n-/**\n- * \\fn Stream::memoryType()\n- * \\brief Retrieve the stream memory type\n- * \\return The memory type used by the stream\n- */\n-\n-/**\n- * \\brief Map a Buffer to a buffer memory index\n- * \\param[in] buffer The buffer to map to a buffer memory index\n- *\n- * Streams configured to use externally allocated memory need to maintain a\n- * best-effort association between the memory area the \\a buffer represents\n- * and the associated buffer memory in the Stream's pool.\n- *\n- * The buffer memory to use, once the \\a buffer reaches the video device,\n- * is selected using the index assigned to the \\a buffer and to minimize\n- * relocations in the V4L2 back-end, this operation provides a best-effort\n- * caching mechanism that associates to the dmabuf file descriptors contained\n- * in the \\a buffer the index of the buffer memory that was lastly queued with\n- * those file descriptors set.\n- *\n- * If the Stream uses internally allocated memory, the index of the memory\n- * buffer to use will match the one request at Stream::createBuffer(unsigned int)\n- * time, and no mapping is thus required.\n- *\n- * \\return The buffer memory index for the buffer on success, or a negative\n- * error code otherwise\n- * \\retval -ENOMEM No buffer memory was available to map the buffer\n- */\n-int Stream::mapBuffer(const Buffer *buffer)\n-{\n-\tASSERT(memoryType_ == ExternalMemory);\n-\n-\tif (bufferCache_.empty())\n-\t\treturn -ENOMEM;\n-\n-\tconst std::array<int, 3> &dmabufs = buffer->dmabufs();\n-\n-\t/*\n-\t * Try to find a previously mapped buffer in the cache. If we miss, use\n-\t * the oldest entry in the cache.\n-\t */\n-\tauto map = std::find_if(bufferCache_.begin(), bufferCache_.end(),\n-\t\t\t\t[&](std::pair<std::array<int, 3>, unsigned int> &entry) {\n-\t\t\t\t\treturn entry.first == dmabufs;\n-\t\t\t\t});\n-\tif (map == bufferCache_.end())\n-\t\tmap = bufferCache_.begin();\n-\n-\t/*\n-\t * Update the dmabuf file descriptors of the entry. We can't assume that\n-\t * identical file descriptor numbers refer to the same dmabuf object as\n-\t * it may have been closed and its file descriptor reused. We thus need\n-\t * to update the plane's internally cached mmap()ed memory.\n-\t */\n-\tunsigned int index = map->second;\n-\tBufferMemory *mem = &bufferPool_.buffers()[index];\n-\tmem->planes().clear();\n-\n-\tfor (unsigned int i = 0; i < dmabufs.size(); ++i) {\n-\t\tif (dmabufs[i] == -1)\n-\t\t\tbreak;\n-\n-\t\tFrameBuffer::Plane plane;\n-\t\tplane.fd = FileDescriptor(dmabufs[i]);\n-\t\tplane.length = 0;\n-\t\tmem->planes().emplace_back(plane);\n-\t}\n-\n-\t/* Remove the buffer from the cache and return its index. */\n-\tbufferCache_.erase(map);\n-\treturn index;\n-}\n-\n-/**\n- * \\brief Unmap a Buffer from its buffer memory\n- * \\param[in] buffer The buffer to unmap\n- *\n- * This method releases the buffer memory entry that was mapped by mapBuffer(),\n- * making it available for new mappings.\n- */\n-void Stream::unmapBuffer(const Buffer *buffer)\n-{\n-\tASSERT(memoryType_ == ExternalMemory);\n-\n-\tbufferCache_.emplace_back(buffer->dmabufs(), buffer->index());\n-}\n-\n-/**\n- * \\brief Create buffers for the stream\n- * \\param[in] count The number of buffers to create\n- * \\param[in] memory The stream memory type\n- *\n- * Create \\a count empty buffers in the Stream's buffer pool.\n- */\n-void Stream::createBuffers(MemoryType memory, unsigned int count)\n-{\n-\tdestroyBuffers();\n-\tif (count == 0)\n-\t\treturn;\n-\n-\tmemoryType_ = memory;\n-\tbufferPool_.createBuffers(count);\n-\n-\t/* Streams with internal memory usage do not need buffer mapping. */\n-\tif (memoryType_ == InternalMemory)\n-\t\treturn;\n-\n-\t/*\n-\t * Prepare for buffer mapping by adding all buffer memory entries to the\n-\t * cache.\n-\t */\n-\tbufferCache_.clear();\n-\tfor (unsigned int i = 0; i < bufferPool_.count(); ++i)\n-\t\tbufferCache_.emplace_back(std::array<int, 3>{ -1, -1, -1 }, i);\n-}\n-\n-/**\n- * \\brief Destroy buffers in the stream\n- *\n- * If no buffers have been created or if buffers have already been destroyed no\n- * operation is performed.\n- */\n-void Stream::destroyBuffers()\n-{\n-\tbufferPool_.destroyBuffers();\n-}\n-\n-/**\n- * \\var Stream::bufferPool_\n- * \\brief The pool of buffers associated with the stream\n- *\n- * The stream buffer pool is populated by the Camera class after a successful\n- * stream configuration.\n- */\n-\n /**\n * \\var Stream::configuration_\n * \\brief The stream configuration\n@@ -659,9 +418,4 @@ void Stream::destroyBuffers()\n * next call to Camera::configure() regardless of if it includes the stream.\n */\n \n-/**\n- * \\var Stream::memoryType_\n- * \\brief The stream memory type\n- */\n-\n } /* namespace libcamera */\n", "prefixes": [ "libcamera-devel", "v2", "22/25" ] }