| OrbbecSDK 1.10.18 OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras

Loading...
Searching...
No Matches
Context.hpp
Go to the documentation of this file.
1
7#pragma once
8
9#include "Types.hpp"
10
11#include <functional>
12#include <memory>
13
14 struct ContextImpl;
15
16 namespace ob {
17 class Device;
18 class DeviceInfo;
19 class DeviceList;
20
21 class OB_EXTENSION_API Context {
22 private:
23 std::unique_ptr<ContextImpl> impl_;
24
25 public:
31 Context(const char *configPath = "");
32 virtual ~Context() noexcept;
33
39 std::shared_ptr<DeviceList> queryDeviceList();
40
50 void enableNetDeviceEnumeration(bool enable);
51
59 std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port);
60
67 void changeNetDeviceIpConfig(const char *deviceUid, const OBNetIpConfig &config);
68
69 using DeviceChangedCallback = std::function<void(std::shared_ptr<DeviceList> removedList, std::shared_ptr<DeviceList> addedList)>;
70
76 void setDeviceChangedCallback(DeviceChangedCallback callback);
77
83 void enableDeviceClockSync(uint64_t repeatInterval);
84#define enableMultiDeviceSync enableDeviceClockSync
85
89 void freeIdleMemory();
90
96 static void setLoggerSeverity(OBLogSeverity severity);
97
105 static void setLoggerToFile(OBLogSeverity severity, const char *directory);
106
112 static void setLoggerToConsole(OBLogSeverity severity);
113
120 using LogCallback = std::function<void(OBLogSeverity severity, const char *logMsg)>;
121
128 static void setLoggerToCallback(OBLogSeverity severity, LogCallback callback);
129
136 static void loadLicense(const char *filePath, const char *key = OB_DEFAULT_DECRYPT_KEY);
137
145 static void loadLicenseFromData(const char *data, uint32_t dataLen, const char *key = OB_DEFAULT_DECRYPT_KEY);
146
162 void setUVCBackend(OBUvcBackend uvcBackend);
163};
164} // namespace ob
OB_DEFAULT_DECRYPT_KEY
#define OB_DEFAULT_DECRYPT_KEY
The default Decrypt Key.
Definition ObTypes.h:1817
OBUvcBackend
enum UVC_BACKEND OBUvcBackend
OB_EXTENSION_API
#define OB_EXTENSION_API
Definition ObTypes.h:28
OBLogSeverity
OBLogSeverity
log level, the higher the level, the stronger the log filter
Definition ObTypes.h:120
Types.hpp
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
ob::Context
Definition Context.hpp:21
ob::Context::setLoggerSeverity
static void setLoggerSeverity(OBLogSeverity severity)
Set the level of the global log, which affects both the log level output to the terminal and output t...
ob::Context::setLoggerToConsole
static void setLoggerToConsole(OBLogSeverity severity)
Set log output to the terminal.
ob::Context::~Context
virtual ~Context() noexcept
ob::Context::loadLicense
static void loadLicense(const char *filePath, const char *key=OB_DEFAULT_DECRYPT_KEY)
Loads a license file.
ob::Context::setLoggerToCallback
static void setLoggerToCallback(OBLogSeverity severity, LogCallback callback)
Set the logger to callback.
ob::Context::DeviceChangedCallback
std::function< void(std::shared_ptr< DeviceList > removedList, std::shared_ptr< DeviceList > addedList)> DeviceChangedCallback
Definition Context.hpp:69
ob::Context::LogCallback
std::function< void(OBLogSeverity severity, const char *logMsg)> LogCallback
Log output callback function.
Definition Context.hpp:120
ob::Context::freeIdleMemory
void freeIdleMemory()
Frees idle memory from the internal frame memory pool.
ob::Context::setUVCBackend
void setUVCBackend(OBUvcBackend uvcBackend)
Set the UVC backend for the specified context This function configures the Universal Video Class (UVC...
ob::Context::Context
Context(const char *configPath="")
The Context class is a management class that describes the runtime of the SDK. It is responsible for ...
ob::Context::loadLicenseFromData
static void loadLicenseFromData(const char *data, uint32_t dataLen, const char *key=OB_DEFAULT_DECRYPT_KEY)
Loads a license from data.
ob::Context::setLoggerToFile
static void setLoggerToFile(OBLogSeverity severity, const char *directory)
Set log output to a file.
ob::DeviceInfo
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:640
ob::DeviceList
Class representing a list of devices.
Definition Device.hpp:757
ob::Device
Definition Device.hpp:29
ob
Definition Context.hpp:16
OBNetIpConfig
IP address configuration for network devices (IPv4)
Definition ObTypes.h:1121