Message ID | 20250721104622.1550908-23-barnabas.pocze@ideasonboard.com |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
I'll be happy to see this, it's a huge API break indeed though Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> On Mon, Jul 21, 2025 at 12:46:22PM +0200, Barnabás Pőcze wrote: > Swap `metadata_` and `metadata2_`, so `MetadataList` is used as the primary > metadata list of a request. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > include/libcamera/internal/pipeline_handler.h | 6 +++--- > include/libcamera/request.h | 8 ++++---- > src/android/camera_device.cpp | 2 +- > src/apps/cam/camera_session.cpp | 7 +++---- > src/apps/cam/file_sink.cpp | 2 +- > src/apps/cam/file_sink.h | 4 ++-- > src/apps/common/dng_writer.cpp | 2 +- > src/apps/common/dng_writer.h | 4 ++-- > src/apps/qcam/main_window.cpp | 2 +- > src/apps/qcam/main_window.h | 3 ++- > src/gstreamer/gstlibcamera-controls.cpp.in | 4 ++-- > src/libcamera/pipeline_handler.cpp | 4 ++-- > src/libcamera/request.cpp | 10 +++++----- > src/py/libcamera/py_helpers.cpp | 4 ++-- > src/py/libcamera/py_helpers.h | 2 +- > src/py/libcamera/py_main.cpp | 2 +- > 16 files changed, 33 insertions(+), 33 deletions(-) > > diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h > index 49c907178..8fe20c544 100644 > --- a/include/libcamera/internal/pipeline_handler.h > +++ b/include/libcamera/internal/pipeline_handler.h > @@ -69,11 +69,11 @@ public: > void metadataAvailable(Request *request, const Control<T> &ctrl, > const details::cxx20::type_identity_t<T> &value) > { > - auto &m = request->metadata2(); > + auto &m = request->metadata(); > const auto c = m.checkpoint(); > > m.set(ctrl, value); > - request->metadata().set(ctrl, value); > + request->metadata2().set(ctrl, value); > > const auto d = c.diffSince(); > if (d) > @@ -99,7 +99,7 @@ public: > #endif > void metadataAvailable(Request *request, Func func) > { > - const auto c = request->metadata2().checkpoint(); > + const auto c = request->metadata().checkpoint(); > > std::invoke(func, MetadataSetter{ request }); > > diff --git a/include/libcamera/request.h b/include/libcamera/request.h > index 196557865..a41869473 100644 > --- a/include/libcamera/request.h > +++ b/include/libcamera/request.h > @@ -51,9 +51,9 @@ public: > void reuse(ReuseFlag flags = Default); > > ControlList &controls() { return *controls_; } > - ControlList &metadata() { return *metadata_; } > + [[nodiscard]] MetadataList &metadata() { return metadata_; } > #ifndef __DOXYGEN__ > - [[nodiscard]] MetadataList &metadata2() { return metadata2_; } > + ControlList &metadata2() { return *metadata2_; } > #endif > const BufferMap &buffers() const { return bufferMap_; } > int addBuffer(const Stream *stream, FrameBuffer *buffer, > @@ -72,8 +72,8 @@ private: > LIBCAMERA_DISABLE_COPY(Request) > > ControlList *controls_; > - ControlList *metadata_; > - MetadataList metadata2_; > + MetadataList metadata_; > + ControlList *metadata2_; > BufferMap bufferMap_; > > const uint64_t cookie_; > diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp > index 80ff248c2..fa0cf1d23 100644 > --- a/src/android/camera_device.cpp > +++ b/src/android/camera_device.cpp > @@ -1423,7 +1423,7 @@ void CameraDevice::notifyError(uint32_t frameNumber, camera3_stream_t *stream, > std::unique_ptr<CameraMetadata> > CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) const > { > - const ControlList &metadata = descriptor.request_->metadata(); > + const MetadataList &metadata = descriptor.request_->metadata(); > const CameraMetadata &settings = descriptor.settings_; > camera_metadata_ro_entry_t entry; > bool found; > diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp > index 16c735ef4..deec09be3 100644 > --- a/src/apps/cam/camera_session.cpp > +++ b/src/apps/cam/camera_session.cpp > @@ -534,19 +534,18 @@ void CameraSession::processRequest(Request *request) > std::cout << info.str() << std::endl; > > if (printMetadata_) { > - const ControlList &requestMetadata = request->metadata(); > + const MetadataList &requestMetadata = request->metadata(); > std::cout << "Metadata (" << requestMetadata.size() << " entries):\n"; > for (const auto &[key, value] : requestMetadata) { > const ControlId *id = controls::controls.at(key); > - std::cout << "\t" << id->name() << " = " > - << value.toString() << std::endl; > + std::cout << '\t' << id->name() << " = " << value << std::endl; > } > > const auto &requestMetadata2 = request->metadata2(); > std::cout << "Metadata2 (" << requestMetadata2.size() << " entries):\n"; > for (const auto &[key, value] : requestMetadata2) { > const ControlId *id = controls::controls.at(key); > - std::cout << '\t' << id->name() << " = " << value << std::endl; > + std::cout << '\t' << id->name() << " = " << value.toString() << std::endl; > } > } > > diff --git a/src/apps/cam/file_sink.cpp b/src/apps/cam/file_sink.cpp > index 65794a2f9..7149d782c 100644 > --- a/src/apps/cam/file_sink.cpp > +++ b/src/apps/cam/file_sink.cpp > @@ -102,7 +102,7 @@ bool FileSink::processRequest(Request *request) > } > > void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer, > - [[maybe_unused]] const ControlList &metadata) > + [[maybe_unused]] const MetadataList &metadata) > { > std::string filename = pattern_; > size_t pos; > diff --git a/src/apps/cam/file_sink.h b/src/apps/cam/file_sink.h > index 26cd61b36..1f973f2e6 100644 > --- a/src/apps/cam/file_sink.h > +++ b/src/apps/cam/file_sink.h > @@ -11,7 +11,7 @@ > #include <memory> > #include <string> > > -#include <libcamera/controls.h> > +#include <libcamera/metadata_list.h> > #include <libcamera/stream.h> > > #include "frame_sink.h" > @@ -44,7 +44,7 @@ private: > > void writeBuffer(const libcamera::Stream *stream, > libcamera::FrameBuffer *buffer, > - const libcamera::ControlList &metadata); > + const libcamera::MetadataList &metadata); > > #ifdef HAVE_TIFF > const libcamera::Camera *camera_; > diff --git a/src/apps/common/dng_writer.cpp b/src/apps/common/dng_writer.cpp > index ac4619511..d8884548c 100644 > --- a/src/apps/common/dng_writer.cpp > +++ b/src/apps/common/dng_writer.cpp > @@ -521,7 +521,7 @@ const std::map<PixelFormat, FormatInfo> formatInfo = { > > int DNGWriter::write(const char *filename, const Camera *camera, > const StreamConfiguration &config, > - const ControlList &metadata, > + const MetadataList &metadata, > [[maybe_unused]] const FrameBuffer *buffer, > const void *data) > { > diff --git a/src/apps/common/dng_writer.h b/src/apps/common/dng_writer.h > index aaa8a852b..741f78a75 100644 > --- a/src/apps/common/dng_writer.h > +++ b/src/apps/common/dng_writer.h > @@ -10,8 +10,8 @@ > #ifdef HAVE_TIFF > > #include <libcamera/camera.h> > -#include <libcamera/controls.h> > #include <libcamera/framebuffer.h> > +#include <libcamera/metadata_list.h> > #include <libcamera/stream.h> > > class DNGWriter > @@ -19,7 +19,7 @@ class DNGWriter > public: > static int write(const char *filename, const libcamera::Camera *camera, > const libcamera::StreamConfiguration &config, > - const libcamera::ControlList &metadata, > + const libcamera::MetadataList &metadata, > const libcamera::FrameBuffer *buffer, const void *data); > }; > > diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp > index 7e3f3da60..95d545f7c 100644 > --- a/src/apps/qcam/main_window.cpp > +++ b/src/apps/qcam/main_window.cpp > @@ -643,7 +643,7 @@ void MainWindow::captureRaw() > } > > void MainWindow::processRaw(FrameBuffer *buffer, > - [[maybe_unused]] const ControlList &metadata) > + [[maybe_unused]] const MetadataList &metadata) > { > #ifdef HAVE_TIFF > QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); > diff --git a/src/apps/qcam/main_window.h b/src/apps/qcam/main_window.h > index 81fcf915a..278de1d44 100644 > --- a/src/apps/qcam/main_window.h > +++ b/src/apps/qcam/main_window.h > @@ -15,6 +15,7 @@ > #include <libcamera/controls.h> > #include <libcamera/framebuffer.h> > #include <libcamera/framebuffer_allocator.h> > +#include <libcamera/metadata_list.h> > #include <libcamera/request.h> > #include <libcamera/stream.h> > > @@ -66,7 +67,7 @@ private Q_SLOTS: > void saveImageAs(); > void captureRaw(); > void processRaw(libcamera::FrameBuffer *buffer, > - const libcamera::ControlList &metadata); > + const libcamera::MetadataList &metadata); > > void renderComplete(libcamera::FrameBuffer *buffer); > > diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in > index 2a16b39a9..6a2a989a3 100644 > --- a/src/gstreamer/gstlibcamera-controls.cpp.in > +++ b/src/gstreamer/gstlibcamera-controls.cpp.in > @@ -322,6 +322,6 @@ void GstCameraControls::applyControls(std::unique_ptr<libcamera::Request> &reque > > void GstCameraControls::readMetadata(libcamera::Request *request) > { > - controls_acc_.merge(request->metadata(), > - ControlList::MergePolicy::OverwriteExisting); > + for (const auto &[k, v] : request->metadata()) > + controls_acc_.set(k, ControlValue(v)); > } > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp > index c8ac7a673..ce538aa7c 100644 > --- a/src/libcamera/pipeline_handler.cpp > +++ b/src/libcamera/pipeline_handler.cpp > @@ -559,9 +559,9 @@ void PipelineHandler::doQueueRequests(Camera *camera) > */ > void PipelineHandler::metadataAvailable(Request *request, const ControlList &metadata) > { > - request->metadata().merge(metadata); > + request->metadata2().merge(metadata); > > - const auto d = request->metadata2().merge(metadata); > + const auto d = request->metadata().merge(metadata); > if (d) > request->_d()->camera()->metadataAvailable.emit(request, d); > } > diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp > index 17ca67d08..4681eb960 100644 > --- a/src/libcamera/request.cpp > +++ b/src/libcamera/request.cpp > @@ -354,7 +354,7 @@ void Request::Private::timeout() > */ > Request::Request(Camera *camera, uint64_t cookie) > : Extensible(std::make_unique<Private>(camera)), > - metadata2_(camera->_d()->metadataPlan_), > + metadata_(camera->_d()->metadataPlan_), > cookie_(cookie), status_(RequestPending) > { > controls_ = new ControlList(controls::controls, > @@ -363,7 +363,7 @@ Request::Request(Camera *camera, uint64_t cookie) > /** > * \todo Add a validator for metadata controls. > */ > - metadata_ = new ControlList(controls::controls); > + metadata2_ = new ControlList(controls::controls); > > LIBCAMERA_TRACEPOINT(request_construct, this); > > @@ -374,7 +374,7 @@ Request::~Request() > { > LIBCAMERA_TRACEPOINT(request_destroy, this); > > - delete metadata_; > + delete metadata2_; > delete controls_; > } > > @@ -407,8 +407,8 @@ void Request::reuse(ReuseFlag flags) > status_ = RequestPending; > > controls_->clear(); > - metadata_->clear(); > - metadata2_.clear(); > + metadata_.clear(); > + metadata2_->clear(); > } > > /** > diff --git a/src/py/libcamera/py_helpers.cpp b/src/py/libcamera/py_helpers.cpp > index 1ad1d4c1a..32f5cdaa6 100644 > --- a/src/py/libcamera/py_helpers.cpp > +++ b/src/py/libcamera/py_helpers.cpp > @@ -16,7 +16,7 @@ namespace py = pybind11; > using namespace libcamera; > > template<typename T> > -static py::object valueOrTuple(const ControlValue &cv) > +static py::object valueOrTuple(const ControlValueView &cv) > { > if (cv.isArray()) { > const T *v = reinterpret_cast<const T *>(cv.data().data()); > @@ -31,7 +31,7 @@ static py::object valueOrTuple(const ControlValue &cv) > return py::cast(cv.get<T>()); > } > > -py::object controlValueToPy(const ControlValue &cv) > +py::object controlValueToPy(const ControlValueView &cv) > { > switch (cv.type()) { > case ControlTypeNone: > diff --git a/src/py/libcamera/py_helpers.h b/src/py/libcamera/py_helpers.h > index 983969dff..895006d0c 100644 > --- a/src/py/libcamera/py_helpers.h > +++ b/src/py/libcamera/py_helpers.h > @@ -9,5 +9,5 @@ > > #include <pybind11/pybind11.h> > > -pybind11::object controlValueToPy(const libcamera::ControlValue &cv); > +pybind11::object controlValueToPy(const libcamera::ControlValueView &cv); > libcamera::ControlValue pyToControlValue(const pybind11::object &ob, libcamera::ControlType type); > diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp > index 441a70ab4..eb47f9dd3 100644 > --- a/src/py/libcamera/py_main.cpp > +++ b/src/py/libcamera/py_main.cpp > @@ -460,7 +460,7 @@ PYBIND11_MODULE(_libcamera, m) > self.controls().set(id.id(), pyToControlValue(value, id.type())); > }) > .def_property_readonly("metadata", [](Request &self) { > - /* Convert ControlList to std container */ > + /* Convert MetadataList to std container */ > > std::unordered_map<const ControlId *, py::object> ret; > > -- > 2.50.1 >
diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 49c907178..8fe20c544 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -69,11 +69,11 @@ public: void metadataAvailable(Request *request, const Control<T> &ctrl, const details::cxx20::type_identity_t<T> &value) { - auto &m = request->metadata2(); + auto &m = request->metadata(); const auto c = m.checkpoint(); m.set(ctrl, value); - request->metadata().set(ctrl, value); + request->metadata2().set(ctrl, value); const auto d = c.diffSince(); if (d) @@ -99,7 +99,7 @@ public: #endif void metadataAvailable(Request *request, Func func) { - const auto c = request->metadata2().checkpoint(); + const auto c = request->metadata().checkpoint(); std::invoke(func, MetadataSetter{ request }); diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 196557865..a41869473 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -51,9 +51,9 @@ public: void reuse(ReuseFlag flags = Default); ControlList &controls() { return *controls_; } - ControlList &metadata() { return *metadata_; } + [[nodiscard]] MetadataList &metadata() { return metadata_; } #ifndef __DOXYGEN__ - [[nodiscard]] MetadataList &metadata2() { return metadata2_; } + ControlList &metadata2() { return *metadata2_; } #endif const BufferMap &buffers() const { return bufferMap_; } int addBuffer(const Stream *stream, FrameBuffer *buffer, @@ -72,8 +72,8 @@ private: LIBCAMERA_DISABLE_COPY(Request) ControlList *controls_; - ControlList *metadata_; - MetadataList metadata2_; + MetadataList metadata_; + ControlList *metadata2_; BufferMap bufferMap_; const uint64_t cookie_; diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 80ff248c2..fa0cf1d23 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1423,7 +1423,7 @@ void CameraDevice::notifyError(uint32_t frameNumber, camera3_stream_t *stream, std::unique_ptr<CameraMetadata> CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) const { - const ControlList &metadata = descriptor.request_->metadata(); + const MetadataList &metadata = descriptor.request_->metadata(); const CameraMetadata &settings = descriptor.settings_; camera_metadata_ro_entry_t entry; bool found; diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index 16c735ef4..deec09be3 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -534,19 +534,18 @@ void CameraSession::processRequest(Request *request) std::cout << info.str() << std::endl; if (printMetadata_) { - const ControlList &requestMetadata = request->metadata(); + const MetadataList &requestMetadata = request->metadata(); std::cout << "Metadata (" << requestMetadata.size() << " entries):\n"; for (const auto &[key, value] : requestMetadata) { const ControlId *id = controls::controls.at(key); - std::cout << "\t" << id->name() << " = " - << value.toString() << std::endl; + std::cout << '\t' << id->name() << " = " << value << std::endl; } const auto &requestMetadata2 = request->metadata2(); std::cout << "Metadata2 (" << requestMetadata2.size() << " entries):\n"; for (const auto &[key, value] : requestMetadata2) { const ControlId *id = controls::controls.at(key); - std::cout << '\t' << id->name() << " = " << value << std::endl; + std::cout << '\t' << id->name() << " = " << value.toString() << std::endl; } } diff --git a/src/apps/cam/file_sink.cpp b/src/apps/cam/file_sink.cpp index 65794a2f9..7149d782c 100644 --- a/src/apps/cam/file_sink.cpp +++ b/src/apps/cam/file_sink.cpp @@ -102,7 +102,7 @@ bool FileSink::processRequest(Request *request) } void FileSink::writeBuffer(const Stream *stream, FrameBuffer *buffer, - [[maybe_unused]] const ControlList &metadata) + [[maybe_unused]] const MetadataList &metadata) { std::string filename = pattern_; size_t pos; diff --git a/src/apps/cam/file_sink.h b/src/apps/cam/file_sink.h index 26cd61b36..1f973f2e6 100644 --- a/src/apps/cam/file_sink.h +++ b/src/apps/cam/file_sink.h @@ -11,7 +11,7 @@ #include <memory> #include <string> -#include <libcamera/controls.h> +#include <libcamera/metadata_list.h> #include <libcamera/stream.h> #include "frame_sink.h" @@ -44,7 +44,7 @@ private: void writeBuffer(const libcamera::Stream *stream, libcamera::FrameBuffer *buffer, - const libcamera::ControlList &metadata); + const libcamera::MetadataList &metadata); #ifdef HAVE_TIFF const libcamera::Camera *camera_; diff --git a/src/apps/common/dng_writer.cpp b/src/apps/common/dng_writer.cpp index ac4619511..d8884548c 100644 --- a/src/apps/common/dng_writer.cpp +++ b/src/apps/common/dng_writer.cpp @@ -521,7 +521,7 @@ const std::map<PixelFormat, FormatInfo> formatInfo = { int DNGWriter::write(const char *filename, const Camera *camera, const StreamConfiguration &config, - const ControlList &metadata, + const MetadataList &metadata, [[maybe_unused]] const FrameBuffer *buffer, const void *data) { diff --git a/src/apps/common/dng_writer.h b/src/apps/common/dng_writer.h index aaa8a852b..741f78a75 100644 --- a/src/apps/common/dng_writer.h +++ b/src/apps/common/dng_writer.h @@ -10,8 +10,8 @@ #ifdef HAVE_TIFF #include <libcamera/camera.h> -#include <libcamera/controls.h> #include <libcamera/framebuffer.h> +#include <libcamera/metadata_list.h> #include <libcamera/stream.h> class DNGWriter @@ -19,7 +19,7 @@ class DNGWriter public: static int write(const char *filename, const libcamera::Camera *camera, const libcamera::StreamConfiguration &config, - const libcamera::ControlList &metadata, + const libcamera::MetadataList &metadata, const libcamera::FrameBuffer *buffer, const void *data); }; diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index 7e3f3da60..95d545f7c 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -643,7 +643,7 @@ void MainWindow::captureRaw() } void MainWindow::processRaw(FrameBuffer *buffer, - [[maybe_unused]] const ControlList &metadata) + [[maybe_unused]] const MetadataList &metadata) { #ifdef HAVE_TIFF QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); diff --git a/src/apps/qcam/main_window.h b/src/apps/qcam/main_window.h index 81fcf915a..278de1d44 100644 --- a/src/apps/qcam/main_window.h +++ b/src/apps/qcam/main_window.h @@ -15,6 +15,7 @@ #include <libcamera/controls.h> #include <libcamera/framebuffer.h> #include <libcamera/framebuffer_allocator.h> +#include <libcamera/metadata_list.h> #include <libcamera/request.h> #include <libcamera/stream.h> @@ -66,7 +67,7 @@ private Q_SLOTS: void saveImageAs(); void captureRaw(); void processRaw(libcamera::FrameBuffer *buffer, - const libcamera::ControlList &metadata); + const libcamera::MetadataList &metadata); void renderComplete(libcamera::FrameBuffer *buffer); diff --git a/src/gstreamer/gstlibcamera-controls.cpp.in b/src/gstreamer/gstlibcamera-controls.cpp.in index 2a16b39a9..6a2a989a3 100644 --- a/src/gstreamer/gstlibcamera-controls.cpp.in +++ b/src/gstreamer/gstlibcamera-controls.cpp.in @@ -322,6 +322,6 @@ void GstCameraControls::applyControls(std::unique_ptr<libcamera::Request> &reque void GstCameraControls::readMetadata(libcamera::Request *request) { - controls_acc_.merge(request->metadata(), - ControlList::MergePolicy::OverwriteExisting); + for (const auto &[k, v] : request->metadata()) + controls_acc_.set(k, ControlValue(v)); } diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index c8ac7a673..ce538aa7c 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -559,9 +559,9 @@ void PipelineHandler::doQueueRequests(Camera *camera) */ void PipelineHandler::metadataAvailable(Request *request, const ControlList &metadata) { - request->metadata().merge(metadata); + request->metadata2().merge(metadata); - const auto d = request->metadata2().merge(metadata); + const auto d = request->metadata().merge(metadata); if (d) request->_d()->camera()->metadataAvailable.emit(request, d); } diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 17ca67d08..4681eb960 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -354,7 +354,7 @@ void Request::Private::timeout() */ Request::Request(Camera *camera, uint64_t cookie) : Extensible(std::make_unique<Private>(camera)), - metadata2_(camera->_d()->metadataPlan_), + metadata_(camera->_d()->metadataPlan_), cookie_(cookie), status_(RequestPending) { controls_ = new ControlList(controls::controls, @@ -363,7 +363,7 @@ Request::Request(Camera *camera, uint64_t cookie) /** * \todo Add a validator for metadata controls. */ - metadata_ = new ControlList(controls::controls); + metadata2_ = new ControlList(controls::controls); LIBCAMERA_TRACEPOINT(request_construct, this); @@ -374,7 +374,7 @@ Request::~Request() { LIBCAMERA_TRACEPOINT(request_destroy, this); - delete metadata_; + delete metadata2_; delete controls_; } @@ -407,8 +407,8 @@ void Request::reuse(ReuseFlag flags) status_ = RequestPending; controls_->clear(); - metadata_->clear(); - metadata2_.clear(); + metadata_.clear(); + metadata2_->clear(); } /** diff --git a/src/py/libcamera/py_helpers.cpp b/src/py/libcamera/py_helpers.cpp index 1ad1d4c1a..32f5cdaa6 100644 --- a/src/py/libcamera/py_helpers.cpp +++ b/src/py/libcamera/py_helpers.cpp @@ -16,7 +16,7 @@ namespace py = pybind11; using namespace libcamera; template<typename T> -static py::object valueOrTuple(const ControlValue &cv) +static py::object valueOrTuple(const ControlValueView &cv) { if (cv.isArray()) { const T *v = reinterpret_cast<const T *>(cv.data().data()); @@ -31,7 +31,7 @@ static py::object valueOrTuple(const ControlValue &cv) return py::cast(cv.get<T>()); } -py::object controlValueToPy(const ControlValue &cv) +py::object controlValueToPy(const ControlValueView &cv) { switch (cv.type()) { case ControlTypeNone: diff --git a/src/py/libcamera/py_helpers.h b/src/py/libcamera/py_helpers.h index 983969dff..895006d0c 100644 --- a/src/py/libcamera/py_helpers.h +++ b/src/py/libcamera/py_helpers.h @@ -9,5 +9,5 @@ #include <pybind11/pybind11.h> -pybind11::object controlValueToPy(const libcamera::ControlValue &cv); +pybind11::object controlValueToPy(const libcamera::ControlValueView &cv); libcamera::ControlValue pyToControlValue(const pybind11::object &ob, libcamera::ControlType type); diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index 441a70ab4..eb47f9dd3 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -460,7 +460,7 @@ PYBIND11_MODULE(_libcamera, m) self.controls().set(id.id(), pyToControlValue(value, id.type())); }) .def_property_readonly("metadata", [](Request &self) { - /* Convert ControlList to std container */ + /* Convert MetadataList to std container */ std::unordered_map<const ControlId *, py::object> ret;
Swap `metadata_` and `metadata2_`, so `MetadataList` is used as the primary metadata list of a request. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- include/libcamera/internal/pipeline_handler.h | 6 +++--- include/libcamera/request.h | 8 ++++---- src/android/camera_device.cpp | 2 +- src/apps/cam/camera_session.cpp | 7 +++---- src/apps/cam/file_sink.cpp | 2 +- src/apps/cam/file_sink.h | 4 ++-- src/apps/common/dng_writer.cpp | 2 +- src/apps/common/dng_writer.h | 4 ++-- src/apps/qcam/main_window.cpp | 2 +- src/apps/qcam/main_window.h | 3 ++- src/gstreamer/gstlibcamera-controls.cpp.in | 4 ++-- src/libcamera/pipeline_handler.cpp | 4 ++-- src/libcamera/request.cpp | 10 +++++----- src/py/libcamera/py_helpers.cpp | 4 ++-- src/py/libcamera/py_helpers.h | 2 +- src/py/libcamera/py_main.cpp | 2 +- 16 files changed, 33 insertions(+), 33 deletions(-)