#include <Context.hpp>
|
| Context (const char *configPath="") |
| 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.
|
|
virtual | ~Context () noexcept |
|
std::shared_ptr< DeviceList > | queryDeviceList () |
| Queries the enumerated device list.
|
|
void | enableNetDeviceEnumeration (bool enable) |
| enable or disable net device enumeration.
|
|
std::shared_ptr< Device > | createNetDevice (const char *address, uint16_t port) |
| Creates a network device object.
|
|
void | changeNetDeviceIpConfig (const char *deviceUid, const OBNetIpConfig &config) |
| Changes the IP configuration of a network device.
|
|
void | setDeviceChangedCallback (DeviceChangedCallback callback) |
| Set the device plug-in callback function.
|
|
void | enableDeviceClockSync (uint64_t repeatInterval) |
| Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
|
|
void | freeIdleMemory () |
| Frees idle memory from the internal frame memory pool.
|
|
void | setUVCBackend (OBUvcBackend uvcBackend) |
| Set the UVC backend for the specified context This function configures the Universal Video Class (UVC) backend for the given context, allowing the selection of a specific backend for video capture operations.
|
|
Definition at line 21 of file Context.hpp.
◆ DeviceChangedCallback
◆ LogCallback
Log output callback function.
- Parameters
-
severity | The current callback log level. |
logMsg | The log message. |
Definition at line 120 of file Context.hpp.
◆ Context()
ob::Context::Context |
( |
const char * |
configPath = "" | ) |
|
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.
◆ ~Context()
virtual ob::Context::~Context |
( |
| ) |
|
|
virtualnoexcept |
◆ queryDeviceList()
std::shared_ptr< DeviceList > ob::Context::queryDeviceList |
( |
| ) |
|
Queries the enumerated device list.
- Returns
- std::shared_ptr<DeviceList> A pointer to the device list class.
◆ enableNetDeviceEnumeration()
void ob::Context::enableNetDeviceEnumeration |
( |
bool |
enable | ) |
|
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
-
[out] | enable | true to enable, false to disable |
◆ createNetDevice()
std::shared_ptr< Device > ob::Context::createNetDevice |
( |
const char * |
address, |
|
|
uint16_t |
port |
|
) |
| |
Creates a network device object.
- Parameters
-
address | The IP address. |
port | The port. |
- Returns
- std::shared_ptr<Device> The created device object.
◆ changeNetDeviceIpConfig()
void ob::Context::changeNetDeviceIpConfig |
( |
const char * |
deviceUid, |
|
|
const OBNetIpConfig & |
config |
|
) |
| |
Changes the IP configuration of a network device.
- Parameters
-
deviceUid | The device unique ID, which is the network device MAC address. It can be obtained through the DeviceList::uid() function. |
config | The new IP configuration. |
◆ setDeviceChangedCallback()
Set the device plug-in callback function.
- Parameters
-
callback | The function triggered when the device is plugged and unplugged. |
◆ enableDeviceClockSync()
void ob::Context::enableDeviceClockSync |
( |
uint64_t |
repeatInterval | ) |
|
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. |
◆ freeIdleMemory()
void ob::Context::freeIdleMemory |
( |
| ) |
|
Frees idle memory from the internal frame memory pool.
◆ setLoggerSeverity()
static void ob::Context::setLoggerSeverity |
( |
OBLogSeverity |
severity | ) |
|
|
static |
Set the level of the global log, which affects both the log level output to the terminal and output to the file.
- Parameters
-
severity | The log output level. |
◆ setLoggerToFile()
static void ob::Context::setLoggerToFile |
( |
OBLogSeverity |
severity, |
|
|
const char * |
directory |
|
) |
| |
|
static |
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). |
◆ setLoggerToConsole()
static void ob::Context::setLoggerToConsole |
( |
OBLogSeverity |
severity | ) |
|
|
static |
Set log output to the terminal.
- Parameters
-
severity | The log level output to the terminal. |
◆ setLoggerToCallback()
Set the logger to callback.
- Parameters
-
severity | The callback log level. |
callback | The callback function. |
◆ loadLicense()
Loads a license file.
- Parameters
-
filePath | The license file path. |
key | The decryption key. |
◆ loadLicenseFromData()
static void ob::Context::loadLicenseFromData |
( |
const char * |
data, |
|
|
uint32_t |
dataLen, |
|
|
const char * |
key = OB_DEFAULT_DECRYPT_KEY |
|
) |
| |
|
static |
Loads a license from data.
- Parameters
-
data | The license data. |
dataLen | The license data length. |
key | The decryption key. |
◆ setUVCBackend()
Set the UVC backend for the specified context This function configures the Universal Video Class (UVC) backend for the given context, allowing the selection of a specific backend for video capture operations.
- Attention
- This function is only supported on Linux (ARM) platforms. Some devices, like the Dabai series, do not support V4L2. Therefore, the default backend is LIBUVC. Ensure that the device supports V4L2 before setting it as the backend.
- Parameters
-
[in] | uvcBackend | Specifies the UVC backend to use:
UVC_BACKEND_AUTO : Automatically selects between V4L2 or libuvc based on metadata support.
UVC_BACKEND_LIBUVC : Forces the use of libuvc.
UVC_BACKEND_V4L2 : Forces the use of V4L2.
|
The documentation for this class was generated from the following file:
- E:/Projects/Jenkins/workspace/OrbbecSDK/libobsensor/include/libobsensor/hpp/Context.hpp