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
14struct ContextImpl;
15
16namespace ob {
17class Device;
18class DeviceInfo;
19class DeviceList;
20
22private:
23 std::unique_ptr<ContextImpl> impl_;
24
25public:
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
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
#define OB_DEFAULT_DECRYPT_KEY
The default Decrypt Key.
Definition ObTypes.h:1817
enum UVC_BACKEND OBUvcBackend
#define OB_EXTENSION_API
Definition ObTypes.h:28
OBLogSeverity
log level, the higher the level, the stronger the log filter
Definition ObTypes.h:120
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
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...
static void setLoggerToConsole(OBLogSeverity severity)
Set log output to the terminal.
virtual ~Context() noexcept
static void loadLicense(const char *filePath, const char *key=OB_DEFAULT_DECRYPT_KEY)
Loads a license file.
static void setLoggerToCallback(OBLogSeverity severity, LogCallback callback)
Set the logger to callback.
std::function< void(std::shared_ptr< DeviceList > removedList, std::shared_ptr< DeviceList > addedList)> DeviceChangedCallback
Definition Context.hpp:69
std::function< void(OBLogSeverity severity, const char *logMsg)> LogCallback
Log output callback function.
Definition Context.hpp:120
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...
Context(const char *configPath="")
The Context class is a management class that describes the runtime of the SDK. It is responsible for ...
static void loadLicenseFromData(const char *data, uint32_t dataLen, const char *key=OB_DEFAULT_DECRYPT_KEY)
Loads a license from data.
static void setLoggerToFile(OBLogSeverity severity, const char *directory)
Set log output to a file.
A class describing device information, representing the name, id, serial number and other basic infor...
Definition Device.hpp:640
Class representing a list of devices.
Definition Device.hpp:757
Definition Context.hpp:16
IP address configuration for network devices (IPv4)
Definition ObTypes.h:1121