[libcamera-devel,v2] Expose the Request Sequence Number in Python Bindings
diff mbox series

Message ID 20221219132029.2228553-1-kieran.bingham@ideasonboard.com
State Accepted
Commit 3c70cae5e501ea2e74dc5813b58298c6cb28ac74
Headers show
Series
  • [libcamera-devel,v2] Expose the Request Sequence Number in Python Bindings
Related show

Commit Message

Kieran Bingham Dec. 19, 2022, 1:20 p.m. UTC
From: Matthew Goodman <matt@exclosure.io>

The python bindings are missing the ability to read the sequence number
of the Request object from the public API.

Expose the objects sequence number on the pybind11 surfaces to support
applications reading this value.

Signed-off-by: Matthew Goodman <matt@exclosure.io>
[Kieran: Revised commit message]
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---
v2:
 - Revised commit message.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

 src/py/libcamera/py_main.cpp | 1 +
 1 file changed, 1 insertion(+)

Comments

Tomi Valkeinen Dec. 19, 2022, 2:04 p.m. UTC | #1
On 19/12/2022 15:20, Kieran Bingham wrote:
> From: Matthew Goodman <matt@exclosure.io>
> 
> The python bindings are missing the ability to read the sequence number
> of the Request object from the public API.
> 
> Expose the objects sequence number on the pybind11 surfaces to support
> applications reading this value.
> 
> Signed-off-by: Matthew Goodman <matt@exclosure.io>
> [Kieran: Revised commit message]
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> ---
> v2:
>   - Revised commit message.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
>   src/py/libcamera/py_main.cpp | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
> index 75947889f7b1..d14e18e25f3f 100644
> --- a/src/py/libcamera/py_main.cpp
> +++ b/src/py/libcamera/py_main.cpp
> @@ -335,6 +335,7 @@ PYBIND11_MODULE(_libcamera, m)
>   		.def_property_readonly("status", &Request::status)
>   		.def_property_readonly("buffers", &Request::buffers)
>   		.def_property_readonly("cookie", &Request::cookie)
> +		.def_property_readonly("sequence", &Request::sequence)
>   		.def_property_readonly("has_pending_buffers", &Request::hasPendingBuffers)
>   		.def("set_control", [](Request &self, const ControlId &id, py::object value) {
>   			self.controls().set(id.id(), pyToControlValue(value, id.type()));

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

  Tomi

Patch
diff mbox series

diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
index 75947889f7b1..d14e18e25f3f 100644
--- a/src/py/libcamera/py_main.cpp
+++ b/src/py/libcamera/py_main.cpp
@@ -335,6 +335,7 @@  PYBIND11_MODULE(_libcamera, m)
 		.def_property_readonly("status", &Request::status)
 		.def_property_readonly("buffers", &Request::buffers)
 		.def_property_readonly("cookie", &Request::cookie)
+		.def_property_readonly("sequence", &Request::sequence)
 		.def_property_readonly("has_pending_buffers", &Request::hasPendingBuffers)
 		.def("set_control", [](Request &self, const ControlId &id, py::object value) {
 			self.controls().set(id.id(), pyToControlValue(value, id.type()));