#include <Context.hpp>
|
typedef std::function< void(std::shared_ptr< DeviceList > removedList, std::shared_ptr< DeviceList > addedList)> | DeviceChangedCallback |
| Type definition for the device changed callback function.
|
|
typedef std::function< void(OBLogSeverity severity, const char *logMsg)> | LogCallback |
| Type definition for the log output callback function.
|
|
Definition at line 26 of file Context.hpp.
◆ DeviceChangedCallback
Type definition for the device changed callback function.
- Parameters
-
removedList | The list of removed devices. |
addedList | The list of added devices. |
Definition at line 34 of file Context.hpp.
◆ LogCallback
Type definition for the log output callback function.
- Parameters
-
severity | The current callback log level. |
logMsg | The log message. |
Definition at line 42 of file Context.hpp.
◆ Context()
ob::Context::Context |
( |
const char * | configPath = "" | ) |
|
|
inlineexplicit |
Context constructor.
The Context class is a management class that describes the runtime of the SDK. It is responsible for applying and releasing resources for the SDK. The context has the ability to manage multiple devices, enumerate devices, monitor device callbacks, and enable functions such as multi-device synchronization.
- Parameters
-
[in] | configPath | The path to the configuration file. If the path is empty, the default configuration will be used. |
Definition at line 58 of file Context.hpp.
◆ ~Context()
ob::Context::~Context |
( |
| ) |
|
|
inlinenoexcept |
◆ queryDeviceList()
std::shared_ptr< DeviceList > ob::Context::queryDeviceList |
( |
| ) |
const |
|
inline |
Queries the enumerated device list.
- Returns
- std::shared_ptr<DeviceList> A pointer to the device list class.
Definition at line 78 of file Context.hpp.
◆ enableNetDeviceEnumeration()
void ob::Context::enableNetDeviceEnumeration |
( |
bool | enable | ) |
const |
|
inline |
enable or disable net device enumeration.
after enable, the net device will be discovered automatically and can be retrieved by queryDeviceList. The default state can be set in the configuration file.
- Attention
- Net device enumeration by gvcp protocol, if the device is not in the same subnet as the host, it will be discovered but cannot be connected.
- Parameters
-
[in] | enable | true to enable, false to disable |
Definition at line 94 of file Context.hpp.
◆ createNetDevice()
std::shared_ptr< Device > ob::Context::createNetDevice |
( |
const char * | address, |
|
|
uint16_t | port ) const |
|
inline |
Creates a network device with the specified IP address and port.
- Parameters
-
[in] | address | The IP address, ipv4 only. such as "192.168.1.10" |
[in] | port | The port number, currently only support 8090 |
- Returns
- std::shared_ptr<Device> The created device object.
Definition at line 107 of file Context.hpp.
◆ setDeviceChangedCallback()
Set the device plug-in callback function.
- Parameters
-
callback | The function triggered when the device is plugged and unplugged. |
Definition at line 119 of file Context.hpp.
◆ enableDeviceClockSync()
void ob::Context::enableDeviceClockSync |
( |
uint64_t | repeatIntervalMsec | ) |
const |
|
inline |
Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
- Parameters
-
repeatInterval | The interval for auto-repeated synchronization, in milliseconds. If the value is 0, synchronization is performed only once. |
Definition at line 131 of file Context.hpp.
◆ freeIdleMemory()
void ob::Context::freeIdleMemory |
( |
| ) |
const |
|
inline |
Frees idle memory from the internal frame memory pool.
The SDK includes an internal frame memory pool that caches memory allocated for frames received from devices.
Definition at line 141 of file Context.hpp.
◆ setUvcBackendType()
For linux, there are two ways to enable the UVC backend: libuvc and libusb. This function is used to set the backend type.
It is effective when the new device is created.
- Attention
- This interface is only available for Linux.
- Parameters
-
[in] | backend_type | The backend type to be used. |
Definition at line 155 of file Context.hpp.
◆ setLoggerSeverity()
static void ob::Context::setLoggerSeverity |
( |
OBLogSeverity | severity | ) |
|
|
inlinestatic |
Set the level of the global log, which affects both the log level output to the console, output to the file and output the user defined callback.
- Parameters
-
severity | The log output level. |
Definition at line 167 of file Context.hpp.
◆ setLoggerToFile()
static void ob::Context::setLoggerToFile |
( |
OBLogSeverity | severity, |
|
|
const char * | directory ) |
|
inlinestatic |
Set log output to a file.
- Parameters
-
severity | The log level output to the file. |
directory | The log file output path. 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). |
Definition at line 180 of file Context.hpp.
◆ setLoggerToConsole()
static void ob::Context::setLoggerToConsole |
( |
OBLogSeverity | severity | ) |
|
|
inlinestatic |
Set log output to the console.
- Parameters
-
severity | The log level output to the console. |
Definition at line 191 of file Context.hpp.
◆ setLoggerToCallback()
Set the logger to callback.
- Parameters
-
severity | The callback log level. |
callback | The callback function. |
Definition at line 203 of file Context.hpp.
◆ setExtensionsDirectory()
static void ob::Context::setExtensionsDirectory |
( |
const char * | directory | ) |
|
|
inlinestatic |
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.
- Attention
- Should be called before creating the context and pipeline, otherwise the default extensions directory (./extensions) will be used.
- Parameters
-
directory | Path to the extensions directory. If the path is empty, the existing settings will continue to be used (if the existing |
Definition at line 218 of file Context.hpp.
The documentation for this class was generated from the following file:
- D:/program/gitlab_repository/package/openorbbecsdkgroup/OpenOrbbecSDK/include/libobsensor/hpp/Context.hpp