Items with no label
3335 Discussions

Get realsense camera status

GMari3
Beginner
1,154 Views

Hello,

I'm using librealsense 2.16.0.221 and a D430 camera model. I'd like to know, from my application, wheter or not the camera is already in use (e.g., opened inside the RealSense Viewer or by another app).

Is there a camera option for this purpose?

I was not able to find anything in this regard, the only thing I found is the option RS2_CAMERA_INFO_CAMERA_LOCKED but it is not supported by my device (I checked it with the rs2::device::supports() call).

Thanks for your support!

0 Kudos
3 Replies
MartyG
Honored Contributor III
320 Views

get_active_profile looks like it would meet your needs.

https://intelrealsense.github.io/librealsense/doxygen/classrs2_1_1pipeline.html# a5b51c8a6bde3067f5efbfa63c125332f Intel® RealSense™ Cross Platform API: rs2::pipeline Class Reference

0 Kudos
GMari3
Beginner
320 Views

Thanks! It can help even if it doesn't entirely fit my needs. I was searching for a way to access to that info before starting a streaming. get_active_profile(), instead, can only be used after a rs2::pipeline::start() call.

0 Kudos
MartyG
Honored Contributor III
320 Views

Maybe use a config class instruction that precedes the pipeline instruction, like Resolve.

https://intelrealsense.github.io/librealsense/doxygen/classrs2_1_1config.html# ae9e55d91bbee3658c4bbf865dec352d3 Intel® RealSense™ Cross Platform API: rs2::config Class Reference

0 Kudos
Reply