|
OrbbecSDK 2.5.5
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
|
Context is a management class that describes the runtime of the SDK and is responsible for resource allocation and release of the SDK. Context has the ability to manage multiple devices. It is responsible for enumerating devices, monitoring device callbacks, and enabling multi-device synchronization. More...
#include "ObTypes.h"Go to the source code of this file.
Macros | |
| #define | ob_enable_multi_device_sync ob_enable_device_clock_sync |
| #define | ob_set_logger_callback ob_set_logger_to_callback |
Functions | |
| OB_EXPORT ob_context * | ob_create_context (ob_error **error) |
| Create a context object with the default configuration file. | |
| OB_EXPORT ob_context * | ob_create_context_with_config (const char *config_file_path, ob_error **error) |
| Create a context object with a specified configuration file. | |
| OB_EXPORT void | ob_delete_context (ob_context *context, ob_error **error) |
| Delete a context object. | |
| OB_EXPORT ob_device_list * | ob_query_device_list (ob_context *context, ob_error **error) |
| Get a list of enumerated devices. | |
| OB_EXPORT void | ob_enable_net_device_enumeration (ob_context *context, bool enable, ob_error **error) |
| Enable or disable network device enumeration. | |
| OB_EXPORT bool | ob_force_ip_config (const char *deviceUid, ob_net_ip_config config, ob_error **error) |
| "Force" a static IP address configuration in a device identified by its MAC Address. | |
| OB_EXPORT ob_device * | ob_create_net_device (ob_context *context, const char *address, uint16_t port, ob_error **error) |
| Create a network device object. | |
| OB_EXPORT void | ob_set_device_changed_callback (ob_context *context, ob_device_changed_callback callback, void *user_data, ob_error **error) |
| Set a device plug-in callback function. | |
| OB_EXPORT void | ob_enable_device_clock_sync (ob_context *context, uint64_t repeat_interval_msec, ob_error **error) |
| Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported). | |
| OB_EXPORT void | ob_free_idle_memory (ob_context *context, ob_error **error) |
| Free idle memory from the internal frame memory pool. | |
| OB_EXPORT void | ob_set_uvc_backend_type (ob_context *context, ob_uvc_backend_type backend_type, ob_error **error) |
| For linux, there are two ways to enable the UVC backend: libuvc and v4l2. This function is used to set the backend type. | |
| OB_EXPORT void | ob_set_logger_severity (ob_log_severity severity, ob_error **error) |
| Set the global log level. | |
| OB_EXPORT void | ob_set_logger_to_file (ob_log_severity severity, const char *directory, ob_error **error) |
| Set the log output to a file. | |
| OB_EXPORT void | ob_set_logger_to_callback (ob_log_severity severity, ob_log_callback callback, void *user_data, ob_error **error) |
| Set the log callback function. | |
| OB_EXPORT void | ob_set_logger_to_console (ob_log_severity severity, ob_error **error) |
| Set the log output to the console. | |
| OB_EXPORT void | ob_set_extensions_directory (const char *directory, ob_error **error) |
| Set the extensions directory. | |
Context is a management class that describes the runtime of the SDK and is responsible for resource allocation and release of the SDK. Context has the ability to manage multiple devices. It is responsible for enumerating devices, monitoring device callbacks, and enabling multi-device synchronization.
Definition in file Context.h.
| #define ob_enable_multi_device_sync ob_enable_device_clock_sync |
| #define ob_set_logger_callback ob_set_logger_to_callback |
| OB_EXPORT ob_context * ob_create_context | ( | ob_error ** | error | ) |
Create a context object with the default configuration file.
| [out] | error | Pointer to an error object that will be populated if an error occurs during context creation |
| OB_EXPORT ob_context * ob_create_context_with_config | ( | const char * | config_file_path, |
| ob_error ** | error ) |
Create a context object with a specified configuration file.
| [in] | config_file_path | Path to the configuration file. If NULL, the default configuration file will be used. |
| [out] | error | Pointer to an error object that will be populated if an error occurs during context creation |
Referenced by ob::Context::Context().
| OB_EXPORT void ob_delete_context | ( | ob_context * | context, |
| ob_error ** | error ) |
Delete a context object.
| [in] | context | Pointer to the context object to be deleted |
| [out] | error | Pointer to an error object that will be populated if an error occurs during context deletion |
Referenced by ob::Context::~Context().
| OB_EXPORT ob_device_list * ob_query_device_list | ( | ob_context * | context, |
| ob_error ** | error ) |
Get a list of enumerated devices.
| [in] | context | Pointer to the context object |
| [out] | error | Pointer to an error object that will be populated if an error occurs during device enumeration |
Referenced by ob::Context::queryDeviceList().
| OB_EXPORT void ob_enable_net_device_enumeration | ( | ob_context * | context, |
| bool | enable, | ||
| ob_error ** | error ) |
Enable or disable network device enumeration.
After enabling, the network device will be automatically discovered and can be retrieved through ob_query_device_list. The default state can be set in the configuration file.
| [in] | context | Pointer to the context object |
| [in] | enable | true to enable, false to disable |
| [out] | error | Pointer to an error object that will be populated if an error occurs. |
Referenced by ob::Context::enableNetDeviceEnumeration().
| OB_EXPORT bool ob_force_ip_config | ( | const char * | deviceUid, |
| ob_net_ip_config | config, | ||
| ob_error ** | error ) |
"Force" a static IP address configuration in a device identified by its MAC Address.
| [in] | macAddress | MAC address of the network device. You can obtain it from DeviceList::uid(), or specify it manually in the format xx:xx:xx:xx:xx:xx, where each xx is a two-digit hexadecimal value. |
| [in] | config | The new IP configuration. |
| [out] | error | Pointer to an error object that will be populated if an error occurs. |
Referenced by ob::Context::forceIp().
| OB_EXPORT ob_device * ob_create_net_device | ( | ob_context * | context, |
| const char * | address, | ||
| uint16_t | port, | ||
| ob_error ** | error ) |
Create a network device object.
| [in] | context | Pointer to the context object |
| [in] | address | IP address of the device |
| [in] | port | Port number of the device |
| [out] | error | Pointer to an error object that will be populated if an error occurs during device creation |
Referenced by ob::Context::createNetDevice().
| OB_EXPORT void ob_set_device_changed_callback | ( | ob_context * | context, |
| ob_device_changed_callback | callback, | ||
| void * | user_data, | ||
| ob_error ** | error ) |
Set a device plug-in callback function.
| [in] | context | Pointer to the context object |
| [in] | callback | Pointer to the callback function triggered when a device is plugged or unplugged |
| [in] | user_data | Pointer to user data that can be passed to and retrieved from the callback function |
| [out] | error | Pointer to an error object that will be populated if an error occurs during callback function setting |
Referenced by ob::Context::setDeviceChangedCallback().
| OB_EXPORT void ob_enable_device_clock_sync | ( | ob_context * | context, |
| uint64_t | repeat_interval_msec, | ||
| ob_error ** | error ) |
Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
| [in] | context | Pointer to the context object |
| [in] | repeat_interval_msec | The interval for auto-repeated synchronization, in milliseconds. If the value is 0, synchronization is performed only once. |
| [out] | error | Pointer to an error object that will be populated if an error occurs during execution |
Referenced by ob::Context::enableDeviceClockSync().
| OB_EXPORT void ob_free_idle_memory | ( | ob_context * | context, |
| ob_error ** | error ) |
Free idle memory from the internal frame memory pool.
| [in] | context | Pointer to the context object |
| [out] | error | Pointer to an error object that will be populated if an error occurs during memory freeing |
Referenced by ob::Context::freeIdleMemory().
| OB_EXPORT void ob_set_uvc_backend_type | ( | ob_context * | context, |
| ob_uvc_backend_type | backend_type, | ||
| ob_error ** | error ) |
For linux, there are two ways to enable the UVC backend: libuvc and v4l2. This function is used to set the backend type.
It is effective when the new device is created.
| [in] | context | Pointer to the context object |
| [in] | backend_type | The backend type to be used. |
| [out] | error | Pointer to an error object that will be populated if an error occurs during backend type setting |
Referenced by ob::Context::setUvcBackendType().
| OB_EXPORT void ob_set_logger_severity | ( | ob_log_severity | severity, |
| ob_error ** | error ) |
Set the global log level.
| [in] | severity | Log level to set |
| [out] | error | Pointer to an error object that will be populated if an error occurs during log level setting |
Referenced by ob::Context::setLoggerSeverity().
| OB_EXPORT void ob_set_logger_to_file | ( | ob_log_severity | severity, |
| const char * | directory, | ||
| ob_error ** | error ) |
Set the log output to a file.
| [in] | severity | Log level to output to file |
| [in] | directory | Path to the log file output directory. If the path is empty, the existing settings will continue to be used (if the existing configuration is also empty, the log will not be output to the file) |
| [out] | error | Pointer to an error object that will be populated if an error occurs during log output setting |
Referenced by ob::Context::setLoggerToFile().
| OB_EXPORT void ob_set_logger_to_callback | ( | ob_log_severity | severity, |
| ob_log_callback | callback, | ||
| void * | user_data, | ||
| ob_error ** | error ) |
Set the log callback function.
| [in] | severity | Log level to set for the callback function |
| [in] | callback | Pointer to the callback function |
| [in] | user_data | Pointer to user data that can be passed to and retrieved from the callback function |
| [out] | error | Pointer to an error object that will be populated if an error occurs during log callback function setting |
Referenced by ob::Context::setLoggerToCallback().
| OB_EXPORT void ob_set_logger_to_console | ( | ob_log_severity | severity, |
| ob_error ** | error ) |
Set the log output to the console.
| [in] | severity | Log level to output to the console |
| [out] | error | Pointer to an error object that will be populated if an error occurs during log output setting |
Referenced by ob::Context::setLoggerToConsole().
Set the extensions directory.
The extensions directory is used to search for dynamic libraries that provide additional functionality to the SDK, such as the Frame filters.
| directory | Path to the extensions directory. If the path is empty, extensions path will be set to the current working directory. |
| error | Pointer to an error object that will be populated if an error occurs during extensions directory setting |
Referenced by ob::Context::setExtensionsDirectory().