3 #if defined(PROF_ENABLED) 4 #include "Profiler.inl" 7 namespace oni {
namespace driver {
11 DriverBase(driverServices),
26 DeviceConnectedCallback connectedCallback,
27 DeviceDisconnectedCallback disconnectedCallback,
28 DeviceStateChangedCallback deviceStateChangedCallback,
43 if (DriverBase::initialize(connectedCallback, disconnectedCallback, deviceStateChangedCallback, cookie) != ONI_STATUS_OK)
71 return ONI_STATUS_ERROR;
82 for (
auto iter =
m_devices.begin(); iter !=
m_devices.end(); ++iter) {
delete(iter->second); }
112 ((
Rs2Driver*)param)->devicesChanged(removed, added);
117 rsTraceFunc(
"removed=%p added=%p", removed, added);
124 std::list<Rs2Device*> removedList;
130 removedList.push_back(iter->second);
134 for (
auto iter = removedList.begin(); iter != removedList.end(); ++iter)
137 deviceDisconnected((*iter)->getInfo());
156 deviceConnected(&info);
208 if (strcmp(uri, serial) == 0)
253 return ONI_STATUS_ERROR;
269 #define XN_NEW(type, arg) new type(arg) 272 #if !defined(XN_DELETE) 273 #define XN_DELETE(arg) delete arg static const textual_icon lock
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
static OniStatus queryDeviceInfo(rs2_device *device, OniDeviceInfo *deviceInfo)
virtual OniStatus initialize(DeviceConnectedCallback connectedCallback, DeviceDisconnectedCallback disconnectedCallback, DeviceStateChangedCallback deviceStateChangedCallback, void *cookie)
void rs2_delete_device(rs2_device *device)
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API.
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
rs2_device * rs2_create_device(const rs2_device_list *info_list, int index, rs2_error **error)
virtual void disableFrameSync(void *frameSyncGroup)
#define rsTraceError(format,...)
def info(name, value, persistent=False)
virtual DeviceBase * deviceOpen(const char *uri, const char *mode)
static void devicesChangedCallback(rs2_device_list *removed, rs2_device_list *added, void *param)
virtual void deviceClose(DeviceBase *deviceBase)
const char * get_message() const
#define rsLogDebug(format,...)
#define rsTraceFunc(format,...)
std::lock_guard< std::mutex > Rs2ScopedMutex
virtual OniStatus tryDevice(const char *uri)
OniDeviceInfo * getInfo()
virtual void * enableFrameSync(StreamBase **streams, int streamCount)
void rs2_set_devices_changed_callback(const rs2_context *context, rs2_devices_changed_callback_ptr callback, void *user, rs2_error **error)
virtual void devicesChanged(rs2_device_list *removed, rs2_device_list *added)
ONI_EXPORT_DRIVER(Rs2Driver)
void rs2_delete_device_list(rs2_device_list *info_list)
std::map< std::string, class Rs2Device * > m_devices
int rs2_get_device_count(const rs2_device_list *info_list, rs2_error **error)
Rs2Driver(OniDriverServices *driverServices)
const char * rs2_get_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)