|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
4 #ifndef LIBREALSENSE_RS2_CONTEXT_HPP
5 #define LIBREALSENSE_RS2_CONTEXT_HPP
17 :_removed(removed), _added(added) {}
90 class software_device;
102 _context = std::shared_ptr<rs2_context>(
115 std::shared_ptr<rs2_device_list> list(
130 std::shared_ptr<rs2_device_list> list(
144 std::vector<sensor> results;
147 auto sensors = dev.query_sensors();
148 std::copy(sensors.begin(), sensors.end(), std::back_inserter(results));
157 std::shared_ptr<rs2_device> dev(
187 auto device = std::shared_ptr<rs2_device>(
212 explicit operator std::shared_ptr<rs2_context>() {
return _context; };
230 _device_hub = std::shared_ptr<rs2_device_hub>(
243 std::shared_ptr<rs2_device> dev(
262 return res > 0 ? true :
false;
266 explicit operator std::shared_ptr<rs2_device_hub>() {
return _device_hub; }
269 std::shared_ptr<rs2_device_hub> _device_hub;
273 #endif // LIBREALSENSE_RS2_CONTEXT_HPP
devices_changed_callback(T callback)
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API.
void unload_device(const std::string &file)
rs2_device * rs2_create_device_from_sensor(const rs2_sensor *sensor, rs2_error **error)
This is a helper function allowing the user to discover the device from one of its sensors.
playback load_device(const std::string &file)
Creates a device from a RealSense file.
void rs2_context_unload_tracking_module(rs2_context *ctx, rs2_error **error)
Removes tracking module.
rs2_device * rs2_device_hub_wait_for_device(const rs2_device_hub *hub, rs2_error **error)
If any device is connected return it, otherwise wait until next RealSense device connects.
device_hub(std::shared_ptr< rs2_device_hub > hub)
context(std::shared_ptr< rs2_context > ctx)
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
Checks if a specific device is contained inside a device list.
device_hub class - encapsulate the handling of connect and disconnect events
std::shared_ptr< rs2_context > _context
void rs2_delete_device_hub(const rs2_device_hub *hub)
Frees the relevant device hub object.
const rs2_device_list * get_list() const
const std::shared_ptr< rs2_device > & get() const
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
create a static snapshot of all connected devices at the time of the call
void rs2_delete_device_list(rs2_device_list *info_list)
Deletes device list, any devices created using this list will remain unaffected.
void on_devices_changed(rs2_device_list *removed, rs2_device_list *added) override
std::shared_ptr< rs2_sensor > _sensor
struct rs2_device_list rs2_device_list
constexpr absl::OTABSL_OPTION_NAMESPACE_NAME::remove_reference_t< T > && move(T &&t) noexcept
void unload_tracking_module()
void rs2_delete_device(rs2_device *device)
Delete RealSense device.
void rs2_set_devices_changed_callback_cpp(rs2_context *context, rs2_devices_changed_callback *callback, rs2_error **error)
set callback to get devices changed events these events will be raised by the context whenever new Re...
int rs2_device_hub_is_device_connected(const rs2_device_hub *hub, const rs2_device *device, rs2_error **error)
Checks if device is still connected.
rs2_device_list * rs2_query_devices_ex(const rs2_context *context, int product_mask, rs2_error **error)
create a static snapshot of all connected devices at the time of the call
device get_sensor_parent(const sensor &s) const
device_list query_devices(int mask) const
create a static snapshot of all connected devices at the time of the call
Extensions to the C++ standard library.
device_list query_devices() const
create a static snapshot of all connected devices at the time of the call
void rs2_context_remove_device(rs2_context *ctx, const char *file, rs2_error **error)
Removes a playback device from the context, if exists.
std::vector< sensor > query_all_sensors() const
Generate a flat list of all available sensors from all RealSense devices.
static void handle(rs2_error *e)
The pipeline simplifies the user interaction with the device and computer vision processing modules.
rs2_device_hub * rs2_create_device_hub(const rs2_context *context, rs2_error **error)
Creates RealSense device_hub .
void set_devices_changed_callback(T callback)
register devices changed callback
std::shared_ptr< rs2_device > _dev
bool is_connected(const device &dev) const
Checks if device is still connected.
device wait_for_device() const
If any device is connected return it, otherwise wait until next RealSense device connects.
rs2_device * rs2_context_add_device(rs2_context *ctx, const char *file, rs2_error **error)
Create a new device and add it to the context.
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
struct rs2_error rs2_error