Skip to content

Commit

Permalink
PR IntelRealSense#10920 from remibettan: adding gil_scoped_release to…
Browse files Browse the repository at this point in the history
… sensor open api methods
  • Loading branch information
Nir-Az authored Sep 20, 2022
2 parents 11b7e2e + 47d64aa commit 4302ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wrappers/python/pyrs_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void init_sensor(py::module &m) {

py::class_<rs2::sensor, rs2::options> sensor(m, "sensor"); // No docstring in C++
sensor.def("open", (void (rs2::sensor::*)(const rs2::stream_profile&) const) &rs2::sensor::open,
"Open sensor for exclusive access, by commiting to a configuration", "profile"_a)
"Open sensor for exclusive access, by commiting to a configuration", "profile"_a, py::call_guard<py::gil_scoped_release>())
.def("supports", (bool (rs2::sensor::*)(rs2_camera_info) const) &rs2::sensor::supports,
"Check if specific camera info is supported.", "info")
.def("supports", (bool (rs2::sensor::*)(rs2_option) const) &rs2::options::supports,
Expand All @@ -50,7 +50,7 @@ void init_sensor(py::module &m) {
}, "Register Notifications callback", "callback"_a)
.def("open", (void (rs2::sensor::*)(const std::vector<rs2::stream_profile>&) const) &rs2::sensor::open,
"Open sensor for exclusive access, by committing to a composite configuration, specifying one or "
"more stream profiles.", "profiles"_a)
"more stream profiles.", "profiles"_a, py::call_guard<py::gil_scoped_release>())
.def("close", &rs2::sensor::close, "Close sensor for exclusive access.", py::call_guard<py::gil_scoped_release>())
.def("start", [](const rs2::sensor& self, std::function<void(rs2::frame)> callback) {
self.start(callback);
Expand Down

0 comments on commit 4302ef6

Please sign in to comment.