mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-10 10:20:19 +08:00
update OrbbecSDK version to 2.9.2
This commit is contained in:
@@ -78,6 +78,20 @@ typedef enum {
|
||||
*/
|
||||
OB_EXPORT ob_application_config *ob_device_get_application_config(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the application configuration carried by an externally imported preset, by preset name.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] preset_name The preset name to query.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_application_config* The application configuration imported with the given preset, or NULL for
|
||||
* built-in presets or presets that carry no application configuration.
|
||||
* @attention The returned config is owned by the device; it should still be released by calling
|
||||
* @ref ob_delete_application_config (releasing the handle does not destroy the cached object).
|
||||
*/
|
||||
OB_EXPORT ob_application_config *ob_device_get_application_config_by_preset(ob_device *device, const char *preset_name, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete an application configuration object.
|
||||
*
|
||||
|
||||
@@ -163,6 +163,76 @@ OB_EXPORT void ob_device_set_structured_data(ob_device *device, ob_property_id p
|
||||
*/
|
||||
OB_EXPORT void ob_device_get_structured_data(ob_device *device, ob_property_id property_id, uint8_t *data, uint32_t *data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check whether the device supports license authorization.
|
||||
*
|
||||
* This function only reports whether the device provides the license authorization
|
||||
* capability. It does not read or validate the license information.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return true if the device supports license authorization, false otherwise.
|
||||
*/
|
||||
OB_EXPORT bool ob_device_is_license_authorization_supported(const ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Write signed device license information.
|
||||
*
|
||||
* The license_info_json is a UTF-8 JSON string with the following structure. All
|
||||
* binary fields are lowercase hex strings without a "0x" prefix and with a fixed
|
||||
* length. Before writing, the SDK reads the currently connected device and compares
|
||||
* it against "devInfo" to prevent writing a license to the wrong device; it does NOT
|
||||
* verify the signature or recompute deviceHash (signature and device-binding checks
|
||||
* are performed by the consumer/filter at runtime).
|
||||
*
|
||||
* {
|
||||
* "formatVersion": 1, // license_info envelope version
|
||||
* "devInfo": { // plaintext, NOT signed; used only to
|
||||
* "deviceSn": "SN123456789", // guard against mis-writing to the
|
||||
* "vid": "2BC5", // wrong device. vid/pid are 4-char
|
||||
* "pid": "0660" // uppercase hex.
|
||||
* },
|
||||
* "licenseInfo": { // signed authorization credential
|
||||
* "schemaVersion": 1, // credential schema version
|
||||
* "keyVersion": 1, // 16-bit signing public key id
|
||||
* "featureFlags": "0000000000000001",// 8 bytes, 16-char lowercase hex
|
||||
* "expireDate": 4294967295, // YYYYMMDD; 0xFFFFFFFF = permanent
|
||||
* "deviceHash": "00112233445566778899aabbccddeeff", // 16 bytes, 32-char hex
|
||||
* "signature": "...", // ECDSA P-256 r||s, 64 bytes, 128-char hex
|
||||
* "vendorLicense": "..." // third-party vendor blob, lowercase hex (235 bytes)
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] license_info_json The SDK license_info JSON string described above.
|
||||
* @param[in] license_info_json_size The byte size of license_info_json, excluding any trailing null terminator.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_write_license_info(ob_device *device, const char *license_info_json, uint32_t license_info_json_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Read signed device license information as SDK license_info JSON.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] license_info_json The output buffer for SDK license_info JSON, null-terminated on success.
|
||||
* @param[in] license_info_json_size Size of the output buffer in bytes. Must be large enough to hold the JSON string and a trailing null terminator; 512
|
||||
* bytes is sufficient for the current schema.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_read_license_info(const ob_device *device, char *license_info_json, uint32_t license_info_json_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Clear license information stored on the device.
|
||||
*
|
||||
* Erases the device license storage area so that the device returns to the
|
||||
* "no license" state. Intended for internal repair, re-activation or debugging
|
||||
* builds and should be gated by caller-side confirmation.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_clear_license_info(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get raw data of a device property.
|
||||
*
|
||||
@@ -286,6 +356,19 @@ OB_EXPORT void ob_device_update_firmware_from_data(ob_device *device, const uint
|
||||
OB_EXPORT void ob_device_update_optional_depth_presets(ob_device *device, const char file_path_list[][OB_PATH_MAX], uint8_t path_count,
|
||||
ob_device_fw_update_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Update the device optional depth presets from data loaded in memory.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] data_list A list of preset data blocks, each holding a data pointer and its size.
|
||||
* @param[in] count The number of the preset data blocks.
|
||||
* @param[in] callback The preset upgrade progress callback.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_update_optional_depth_presets_from_data(ob_device *device, const ob_data_view *data_list, uint8_t count,
|
||||
ob_device_fw_update_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Device reboot
|
||||
* @attention The device will be disconnected and reconnected. After the device is disconnected, the interface access to the device handle may be abnormal.
|
||||
@@ -337,6 +420,16 @@ OB_EXPORT void ob_device_enable_heartbeat(ob_device *device, bool enable, ob_err
|
||||
*/
|
||||
OB_EXPORT void ob_device_enable_firmware_log(ob_device *device, bool enable, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check whether the device firmware log is enabled.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return bool Whether the firmware log is enabled.
|
||||
*/
|
||||
OB_EXPORT bool ob_device_is_firmware_log_enabled(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Synchronize the device time (synchronize hardwarePPS time to device)
|
||||
*
|
||||
@@ -426,7 +519,7 @@ OB_EXPORT const char *ob_device_info_get_uid(const ob_device_info *info, ob_erro
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* return device serial number
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_serial_number(const ob_device_info *info, ob_error **error);
|
||||
@@ -436,7 +529,7 @@ OB_EXPORT const char *ob_device_info_get_serial_number(const ob_device_info *inf
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return int return the firmware version number
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_firmware_version(const ob_device_info *info, ob_error **error);
|
||||
@@ -458,7 +551,7 @@ OB_EXPORT const char *ob_device_info_get_connection_type(const ob_device_info *i
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* The IP address, such as "192.168.1.10"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_ip_address(const ob_device_info *info, ob_error **error);
|
||||
@@ -520,7 +613,7 @@ OB_EXPORT const char *ob_device_get_extension_info(const ob_device *device, cons
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* The minimum SDK version number supported by the device
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_supported_min_sdk_version(const ob_device_info *info, ob_error **error);
|
||||
@@ -530,7 +623,7 @@ OB_EXPORT const char *ob_device_info_get_supported_min_sdk_version(const ob_devi
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* The ASIC name
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_asicName(const ob_device_info *info, ob_error **error);
|
||||
@@ -540,7 +633,7 @@ OB_EXPORT const char *ob_device_info_get_asicName(const ob_device_info *info, ob
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return ob_device_type The device type
|
||||
*/
|
||||
OB_EXPORT ob_device_type ob_device_info_get_device_type(const ob_device_info *info, ob_error **error);
|
||||
@@ -558,7 +651,7 @@ OB_EXPORT void ob_delete_device_list(ob_device_list *list, ob_error **error);
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return uint32_t return the number of devices
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_device_list_get_count(const ob_device_list *list, ob_error **error);
|
||||
@@ -569,7 +662,7 @@ OB_EXPORT uint32_t ob_device_list_get_count(const ob_device_list *list, ob_error
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* return device name
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_name(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
@@ -580,7 +673,7 @@ OB_EXPORT const char *ob_device_list_get_device_name(const ob_device_list *list,
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return int return the device pid
|
||||
*/
|
||||
OB_EXPORT int ob_device_list_get_device_pid(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
@@ -763,6 +856,46 @@ OB_EXPORT ob_ip_source_type ob_device_list_get_device_ip_source_type(const ob_de
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_user_name(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Query the current device access state without opening the device.
|
||||
*
|
||||
* @attention This is a non-invasive GVCP CCP query for supported Ethernet devices. It reports device-side CCP state, not the owner process or host.
|
||||
* For non-Ethernet devices or Ethernet devices without CCP support, it returns OB_DEVICE_ACCESS_STATE_UNSUPPORTED.
|
||||
* CONTROLLED means monitor access may still be available, while default/control access may still fail.
|
||||
* This call is synchronous and blocks while waiting for the device's GVCP response over the network; querying an unreachable device blocks until the
|
||||
* underlying retry logic gives up, so prefer calling it off the UI thread when querying multiple devices.
|
||||
* The returned state reflects the device access state only at the moment of the query and does not guarantee that a subsequent access (such as creating or
|
||||
* opening the device) will succeed, as another client may change the state in between.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] index The index of the device.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The current access state of the device.
|
||||
*/
|
||||
OB_EXPORT ob_device_access_state ob_device_list_query_device_access_state(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Query the current device access state by serial number without opening the device.
|
||||
*
|
||||
* @attention This is a non-invasive GVCP CCP query for supported Ethernet devices. It reports device-side CCP state, not the owner process or host.
|
||||
* For non-Ethernet devices or Ethernet devices without CCP support, it returns OB_DEVICE_ACCESS_STATE_UNSUPPORTED.
|
||||
* CONTROLLED means monitor access may still be available, while default/control access may still fail.
|
||||
* This call is synchronous and blocks while waiting for the device's GVCP response over the network; querying an unreachable device blocks until the
|
||||
* underlying retry logic gives up, so prefer calling it off the UI thread when querying multiple devices.
|
||||
* The returned state reflects the device access state only at the moment of the query and does not guarantee that a subsequent access (such as creating or
|
||||
* opening the device) will succeed, as another client may change the state in between.
|
||||
* If no device in the list matches the given serial number, an error is set via the error parameter.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] serial_number The serial number of the device.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The current access state of the device.
|
||||
*/
|
||||
OB_EXPORT ob_device_access_state ob_device_list_query_device_access_state_by_serial_number(const ob_device_list *list, const char *serial_number,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
|
||||
@@ -56,6 +56,16 @@ OB_EXPORT const char *ob_filter_get_vendor_specific_code(const char *name, ob_er
|
||||
*/
|
||||
OB_EXPORT ob_filter *ob_create_private_filter(const char *name, const char *activation_key, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Activate a private filter object with a specific device.
|
||||
*
|
||||
* @param[in] filter The private filter object.
|
||||
* @param[in] device The device to associate with the activation.
|
||||
* @param[in] options Optional extensible activation options (may be NULL). See @ref ob_priv_filter_activate_options.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_filter_activate_private_ex(ob_filter *filter, ob_device *device, const ob_priv_filter_activate_options *options, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the filter.
|
||||
*
|
||||
|
||||
@@ -397,6 +397,35 @@ OB_EXPORT ob_sensor *ob_frame_get_sensor(const ob_frame *frame, ob_error **error
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_frame_get_device(const ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the auth token carried by the frame.
|
||||
*
|
||||
* @param[in] frame Frame object.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return uint64_t The auth token value.
|
||||
*/
|
||||
OB_EXPORT uint64_t ob_frame_get_token(const ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the auth token carried by the frame.
|
||||
*
|
||||
* @param[in] frame Frame object.
|
||||
* @param[in] token The auth token value.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_frame_set_token(ob_frame *frame, uint64_t token, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device information attached to the frame.
|
||||
*
|
||||
* @param[in] frame Frame object.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_device_info* Return the attached device information, or NULL if not available.
|
||||
*/
|
||||
OB_EXPORT ob_device_info *ob_frame_get_device_info(const ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get video frame width
|
||||
*
|
||||
|
||||
@@ -152,6 +152,7 @@ typedef enum {
|
||||
OB_EXCEPTION_TYPE_INVALID_DATA, /**< Runtime data is invalid, check data content or size */
|
||||
OB_EXCEPTION_TYPE_NOT_FOUND, /**< The requested item was not found */
|
||||
OB_EXCEPTION_TYPE_RESOURCE_BUSY, /**< Resource is busy or locked by another operation */
|
||||
OB_EXCEPTION_TYPE_LICENSE_VERIFY_FAILED, /**< License verification failed, the device/feature license is missing, invalid or expired */
|
||||
} OBExceptionType,
|
||||
ob_exception_type;
|
||||
|
||||
@@ -384,6 +385,14 @@ typedef struct {
|
||||
uint32_t fullDataSize; ///< Size of full data
|
||||
} OBDataChunk, ob_data_chunk;
|
||||
|
||||
/**
|
||||
* @brief A read-only, non-owning view over a byte buffer (a data pointer plus its size)
|
||||
*/
|
||||
typedef struct {
|
||||
const uint8_t *data; ///< Pointer to the data
|
||||
uint32_t dataSize; ///< Size of the data in bytes
|
||||
} OBDataView, ob_data_view;
|
||||
|
||||
/**
|
||||
* @brief Structure for integer range
|
||||
*/
|
||||
@@ -1727,6 +1736,18 @@ typedef struct {
|
||||
const char *desc; ///< Description of the configuration item
|
||||
} OBFilterConfigSchemaItem, ob_filter_config_schema_item;
|
||||
|
||||
/**
|
||||
* @brief Extensible options for activating a private filter instance.
|
||||
* @brief Passed to @ref ob_filter_activate_private_ex / @ref ob_priv_filter_activate_ex. New fields must only be
|
||||
* appended at the end. The caller sets @ref struct_size to sizeof(ob_priv_filter_activate_options); the callee
|
||||
* uses it to detect which fields a (possibly older) caller actually provided, keeping the ABI compatible as the
|
||||
* struct grows. This is the single extension point for future activation parameters.
|
||||
*/
|
||||
typedef struct ob_priv_filter_activate_options {
|
||||
uint32_t struct_size; ///< Size of this struct in bytes, set by the caller to sizeof(ob_priv_filter_activate_options).
|
||||
const char *model_path; ///< Path to the inference model file. NULL or empty selects the filter's default model.
|
||||
}OBPrivFilterActivateOptions, ob_priv_filter_activate_options;
|
||||
|
||||
/**
|
||||
* @brief struct of serial number
|
||||
*/
|
||||
@@ -2025,6 +2046,20 @@ typedef enum {
|
||||
} ob_device_access_mode,
|
||||
OBDeviceAccessMode;
|
||||
|
||||
/**
|
||||
* @brief Device access state queried from GVCP CCP without opening the device.
|
||||
*/
|
||||
typedef enum {
|
||||
OB_DEVICE_ACCESS_STATE_UNKNOWN = 0, ///< The access state cannot be determined
|
||||
OB_DEVICE_ACCESS_STATE_UNSUPPORTED = 1, ///< The device or current build does not support access-state query
|
||||
OB_DEVICE_ACCESS_STATE_AVAILABLE = 2, ///< The device is available for control access
|
||||
OB_DEVICE_ACCESS_STATE_CONTROLLED = 3, ///< The device has a controller; monitor access may still be available
|
||||
OB_DEVICE_ACCESS_STATE_EXCLUSIVE = 4, ///< The device is held exclusively and cannot be accessed
|
||||
OB_DEVICE_ACCESS_STATE_UNREACHABLE = 5, ///< The device did not respond or the network path is unreachable
|
||||
OB_DEVICE_ACCESS_STATE_FW_NOT_SUPPORTED = 6, ///< The device supports CCP, but the firmware version is too old
|
||||
} ob_device_access_state,
|
||||
OBDeviceAccessState;
|
||||
|
||||
typedef enum {
|
||||
OB_IP_SOURCE_NONE = 0, ///< No IP configuration active (e.g. USB device).
|
||||
OB_IP_SOURCE_LLA = 1, ///< LLA (Link-Local Address / Auto IP).
|
||||
|
||||
@@ -672,6 +672,16 @@ typedef enum {
|
||||
*/
|
||||
OB_PROP_CURRENT_DISP_SEARCH_OFFSET_INT = 272,
|
||||
|
||||
/**
|
||||
* @brief Enable FPS boost in trigger mode
|
||||
*/
|
||||
OB_PROP_FPS_BOOST_BOOL = 275,
|
||||
|
||||
/**
|
||||
* @brief MJPEG encoding quality factor
|
||||
*/
|
||||
OB_PROP_MJPEG_QUALITY_INT = 277,
|
||||
|
||||
/**
|
||||
* @brief Baseline calibration parameters
|
||||
*/
|
||||
|
||||
@@ -184,6 +184,20 @@ public:
|
||||
return std::make_shared<ApplicationConfig>(handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the application config carried by an externally imported preset, by preset name.
|
||||
* @return nullptr for built-in presets or presets that carry no application config.
|
||||
*/
|
||||
static std::shared_ptr<ApplicationConfig> get(const std::shared_ptr<Device> &device, const std::string &presetName) {
|
||||
ob_error *error = nullptr;
|
||||
auto handle = ob_device_get_application_config_by_preset(device->getImpl(), presetName.c_str(), &error);
|
||||
Error::handle(&error);
|
||||
if(!handle) {
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<ApplicationConfig>(handle);
|
||||
}
|
||||
|
||||
explicit ApplicationConfig(ob_application_config *handle) : handle_(handle) {}
|
||||
|
||||
~ApplicationConfig() noexcept {
|
||||
|
||||
@@ -302,6 +302,51 @@ public:
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether the device supports license authorization.
|
||||
*
|
||||
* @return true if the device supports license authorization, false otherwise.
|
||||
*/
|
||||
bool isLicenseAuthorizationSupported() const {
|
||||
ob_error *error = nullptr;
|
||||
auto res = ob_device_is_license_authorization_supported(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write signed device license information.
|
||||
*
|
||||
* @param[in] licenseInfo SDK license_info JSON string
|
||||
*/
|
||||
void writeLicenseInfo(const std::string &licenseInfo) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_device_write_license_info(impl_, licenseInfo.c_str(), static_cast<uint32_t>(licenseInfo.size()), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear license information stored on the device.
|
||||
*/
|
||||
void clearLicenseInfo() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_device_clear_license_info(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Read signed device license information as SDK license_info JSON.
|
||||
*
|
||||
* @return std::string SDK license_info JSON string
|
||||
*/
|
||||
std::string readLicenseInfo() const {
|
||||
ob_error *error = nullptr;
|
||||
char buf[4096] = {};
|
||||
ob_device_read_license_info(impl_, buf, sizeof(buf), &error);
|
||||
Error::handle(&error);
|
||||
return std::string(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the customer data type of a device property
|
||||
*
|
||||
@@ -393,6 +438,8 @@ public:
|
||||
/**
|
||||
* @brief Update the device firmware
|
||||
*
|
||||
* @attention Only one firmware/preset update may run per device at a time
|
||||
*
|
||||
* @param[in] filePath Firmware path
|
||||
* @param[in] callback Firmware Update progress and status callback
|
||||
* @param[in] async Whether to execute asynchronously
|
||||
@@ -407,6 +454,8 @@ public:
|
||||
/**
|
||||
* @brief Update the device firmware from data
|
||||
*
|
||||
* @attention Only one firmware/preset update may run per device at a time
|
||||
*
|
||||
* @param[in] firmwareData Firmware data
|
||||
* @param[in] firmwareDataSize Firmware data size
|
||||
* @param[in] callback Firmware Update progress and status callback
|
||||
@@ -422,6 +471,8 @@ public:
|
||||
/**
|
||||
* @brief Update the device optional depth presets
|
||||
*
|
||||
* @attention Only one firmware/preset update may run per device at a time
|
||||
*
|
||||
* @param[in] filePathList A list(2D array) of preset file paths, each up to OB_PATH_MAX characters.
|
||||
* @param[in] pathCount The number of the preset file paths.
|
||||
* @param[in] callback Preset update progress and status callback
|
||||
@@ -433,6 +484,27 @@ public:
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update the device optional depth presets from data loaded in memory
|
||||
*
|
||||
* @attention Only one firmware/preset update may run per device at a time
|
||||
*
|
||||
* @param[in] dataList A list of preset data blocks, each holding the raw bytes of one preset.
|
||||
* @param[in] callback Preset update progress and status callback
|
||||
*/
|
||||
void updateOptionalDepthPresets(const std::vector<std::vector<uint8_t>> &dataList, DeviceFwUpdateCallback callback) {
|
||||
ob_error *error = nullptr;
|
||||
std::vector<OBDataView> presets;
|
||||
presets.reserve(dataList.size());
|
||||
for(const auto &data: dataList) {
|
||||
presets.push_back({data.data(), static_cast<uint32_t>(data.size())});
|
||||
}
|
||||
fwUpdateCallback_ = callback;
|
||||
auto count = static_cast<uint8_t>(presets.size());
|
||||
ob_device_update_optional_depth_presets_from_data(impl_, presets.data(), count, &Device::firmwareUpdateCallback, this, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the device state changed callbacks
|
||||
*
|
||||
@@ -620,6 +692,18 @@ public:
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether the device firmware log is enabled.
|
||||
*
|
||||
* @return bool Whether the firmware log is enabled.
|
||||
*/
|
||||
bool isFirmwareLogEnabled() const {
|
||||
ob_error *error = nullptr;
|
||||
bool enable = ob_device_is_firmware_log_enabled(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the supported multi device sync mode bitmap of the device.
|
||||
* @brief For example, if the return value is 0b00001100, it means the device supports @ref OB_MULTI_DEVICE_SYNC_MODE_PRIMARY and @ref
|
||||
@@ -1449,9 +1533,9 @@ public:
|
||||
*
|
||||
* @return const char* The host network interface name (e.g., "eth0", "en0").
|
||||
*/
|
||||
const char* getLocalNetInterfaceName(uint32_t index) const {
|
||||
ob_error *error = nullptr;
|
||||
auto netItfName = ob_device_list_get_device_local_net_if_name(impl_, index, &error);
|
||||
const char *getLocalNetInterfaceName(uint32_t index) const {
|
||||
ob_error *error = nullptr;
|
||||
auto netItfName = ob_device_list_get_device_local_net_if_name(impl_, index, &error);
|
||||
Error::handle(&error);
|
||||
return netItfName;
|
||||
}
|
||||
@@ -1488,6 +1572,49 @@ public:
|
||||
return userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Query the current device access state without opening the device.
|
||||
*
|
||||
* @attention This is a non-invasive GVCP CCP query for supported Ethernet devices. It reports device-side CCP state, not the owner process or host.
|
||||
* CONTROLLED means monitor access may still be available, while default/control access may still fail.
|
||||
* This call is synchronous and blocks while waiting for the device's GVCP response over the network; querying an unreachable device blocks until the
|
||||
* underlying retry logic gives up, so prefer calling it off the UI thread when querying multiple devices.
|
||||
* The returned state reflects the device access state only at the moment of the query and does not guarantee that a subsequent access (such as creating
|
||||
* or opening the device) will succeed, as another client may change the state in between.
|
||||
*
|
||||
* @param[in] index The index of the device.
|
||||
*
|
||||
* @return OBDeviceAccessState The current access state of the device.
|
||||
*/
|
||||
OBDeviceAccessState queryDeviceAccessState(uint32_t index) const {
|
||||
ob_error *error = nullptr;
|
||||
auto state = ob_device_list_query_device_access_state(impl_, index, &error);
|
||||
Error::handle(&error);
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Query the current device access state by serial number without opening the device.
|
||||
*
|
||||
* @attention This is a non-invasive GVCP CCP query for supported Ethernet devices. It reports device-side CCP state, not the owner process or host.
|
||||
* CONTROLLED means monitor access may still be available, while default/control access may still fail.
|
||||
* This call is synchronous and blocks while waiting for the device's GVCP response over the network; querying an unreachable device blocks until the
|
||||
* underlying retry logic gives up, so prefer calling it off the UI thread when querying multiple devices.
|
||||
* The returned state reflects the device access state only at the moment of the query and does not guarantee that a subsequent access (such as creating
|
||||
* or opening the device) will succeed, as another client may change the state in between.
|
||||
* If no device in the list matches the given serial number, this throws an ob::Error.
|
||||
*
|
||||
* @param[in] serialNumber The serial number of the device.
|
||||
*
|
||||
* @return OBDeviceAccessState The current access state of the device.
|
||||
*/
|
||||
OBDeviceAccessState queryDeviceAccessStateBySN(const char *serialNumber) const {
|
||||
ob_error *error = nullptr;
|
||||
auto state = ob_device_list_query_device_access_state_by_serial_number(impl_, serialNumber, &error);
|
||||
Error::handle(&error);
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the device object at the specified index
|
||||
*
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <typeinfo>
|
||||
#include <typeindex>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
|
||||
namespace ob {
|
||||
@@ -2081,6 +2082,175 @@ public:
|
||||
~DisparityTransform() noexcept override = default;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Enhanced depth filter that requires a device for activation.
|
||||
*
|
||||
* @note The constructor is a template so that Filter.hpp does not need to include Device.hpp.
|
||||
* The template is instantiated at the call site where the device type is complete.
|
||||
*/
|
||||
class EnhancedDepthFilter : public Filter {
|
||||
public:
|
||||
/**
|
||||
* @brief Construct an EnhancedDepthFilter and activate it for the given device.
|
||||
*
|
||||
* @param[in] device The device the filter is bound to.
|
||||
* @param[in] modelPath Optional path to the inference model file used during activation. When empty, the
|
||||
* filter falls back to its default model file at extensions/filters/enhanced_depth_filter/model.sm4
|
||||
* (located next to the filter library).
|
||||
*/
|
||||
template <typename T> explicit EnhancedDepthFilter(std::shared_ptr<T> device, const std::string &modelPath = "") {
|
||||
if(!device) {
|
||||
throw std::invalid_argument("device is null");
|
||||
}
|
||||
ob_error *error = nullptr;
|
||||
auto impl = ob_create_private_filter("EnhancedDepthFilter", "", &error);
|
||||
Error::handle(&error);
|
||||
|
||||
// Only pass options when a model path is provided; otherwise hand down nullptr so the filter uses its default.
|
||||
ob_priv_filter_activate_options options{};
|
||||
ob_priv_filter_activate_options *optionsPtr = nullptr;
|
||||
if(!modelPath.empty()) {
|
||||
options.struct_size = sizeof(options);
|
||||
options.model_path = modelPath.c_str();
|
||||
optionsPtr = &options;
|
||||
}
|
||||
ob_filter_activate_private_ex(impl, device->getImpl(), optionsPtr, &error);
|
||||
Error::handle(&error);
|
||||
init(impl);
|
||||
}
|
||||
|
||||
~EnhancedDepthFilter() noexcept override = default;
|
||||
|
||||
/**
|
||||
* @brief Get the resolutions supported by the enhanced depth filter for the constrained (aligned-to) stream.
|
||||
*
|
||||
* @return The list of supported {width, height} pairs. This is the single source of truth used by
|
||||
* @ref isSupportedResolution.
|
||||
*/
|
||||
static const std::vector<std::pair<uint32_t, uint32_t>> &getSupportedResolutions() {
|
||||
static const std::vector<std::pair<uint32_t, uint32_t>> supportedResolutions = {
|
||||
{ 640, 480 },
|
||||
{ 1280, 720 },
|
||||
{ 1280, 800 },
|
||||
};
|
||||
return supportedResolutions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the frame formats supported by the enhanced depth filter for a given stream type.
|
||||
*
|
||||
* @param[in] streamType The stream type. Only color and depth streams are supported.
|
||||
*
|
||||
* @return The list of supported formats (color: OB_FORMAT_RGB; depth: OB_FORMAT_Y10, OB_FORMAT_Y11,
|
||||
* OB_FORMAT_Y12, OB_FORMAT_Y14, OB_FORMAT_Y16, OB_FORMAT_Z16). Empty for unsupported stream types. This is the single
|
||||
* source of truth used by @ref isSupportedFormat.
|
||||
*/
|
||||
static std::vector<OBFormat> getSupportedFormats(OBStreamType streamType) {
|
||||
if(streamType == OB_STREAM_COLOR) {
|
||||
return { OB_FORMAT_RGB };
|
||||
}
|
||||
if(streamType == OB_STREAM_DEPTH) {
|
||||
return { OB_FORMAT_Y10, OB_FORMAT_Y11, OB_FORMAT_Y12, OB_FORMAT_Y14, OB_FORMAT_Y16, OB_FORMAT_Z16 };
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether a resolution is supported by the enhanced depth filter for a given stream alignment pair.
|
||||
*
|
||||
* @param[in] sourceStreamType The source stream type that provides the input frames.
|
||||
* @param[in] alignToStreamType The target stream type that the source stream is aligned to.
|
||||
* @param[in] width The frame width to validate.
|
||||
* @param[in] height The frame height to validate.
|
||||
*
|
||||
* @return true if the resolution is supported for the specified alignment combination, otherwise false.
|
||||
*/
|
||||
static bool isSupportedResolution(OBStreamType sourceStreamType, OBStreamType alignToStreamType, uint32_t width, uint32_t height) {
|
||||
if(sourceStreamType != alignToStreamType) {
|
||||
// If the source and target stream types are different, any resolution is supported.
|
||||
return true;
|
||||
}
|
||||
|
||||
for(const auto &res: getSupportedResolutions()) {
|
||||
if(res.first == width && res.second == height) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether a frame format is supported by the enhanced depth filter for a given stream type.
|
||||
*
|
||||
* @param[in] streamType The stream type to validate. Only color and depth streams are supported.
|
||||
* @param[in] format The frame format to validate.
|
||||
*
|
||||
* @return true if the format is supported for the given stream type, otherwise false.
|
||||
*/
|
||||
static bool isSupportedFormat(OBStreamType streamType, OBFormat format) {
|
||||
for(const auto &supported: getSupportedFormats(streamType)) {
|
||||
if(supported == format) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the working resolution of the enhanced depth filter.
|
||||
*
|
||||
* @param[in] width The target frame width.
|
||||
* @param[in] height The target frame height.
|
||||
*/
|
||||
void setResolution(uint32_t width, uint32_t height) {
|
||||
setConfigValue("width", static_cast<double>(width));
|
||||
setConfigValue("height", static_cast<double>(height));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the current configured frame width.
|
||||
*
|
||||
* @return uint32_t The current width.
|
||||
*/
|
||||
uint32_t getCurrentWidth() const {
|
||||
return static_cast<uint32_t>(getConfigValue("width"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the current configured frame height.
|
||||
*
|
||||
* @return uint32_t The current height.
|
||||
*/
|
||||
uint32_t getCurrentHeight() const {
|
||||
return static_cast<uint32_t>(getConfigValue("height"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the confidence threshold for depth values.
|
||||
*
|
||||
* @param value The confidence threshold.
|
||||
*/
|
||||
void setConfidenceThreshold(uint32_t value) {
|
||||
setConfigValue("confidence_threshold", static_cast<double>(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the property range of the confidence threshold range.
|
||||
*/
|
||||
OBIntPropertyRange getConfidenceThresholdRange() {
|
||||
OBIntPropertyRange range{};
|
||||
const auto &schemaVec = getConfigSchemaVec();
|
||||
for(const auto &item: schemaVec) {
|
||||
const char *name = "confidence_threshold";
|
||||
if(std::strcmp(item.name, name) == 0) {
|
||||
range = getPropertyRange<OBIntPropertyRange>(item, getConfigValue(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return range;
|
||||
}
|
||||
};
|
||||
|
||||
class OBFilterList {
|
||||
private:
|
||||
ob_filter_list_t *impl_;
|
||||
@@ -2151,6 +2321,7 @@ inline const std::unordered_map<std::string, std::type_index> &getFilterTypeMap(
|
||||
{ "MgcNoiseRemovalFilter", typeid(MgcNoiseRemovalFilter) },
|
||||
{ "LutNoiseRemovalFilter", typeid(LutNoiseRemovalFilter) },
|
||||
{ "UnDistortionFilter", typeid(UnDistortionFilter) },
|
||||
{ "EnhancedDepthFilter", typeid(EnhancedDepthFilter) },
|
||||
};
|
||||
return filterTypeMap;
|
||||
}
|
||||
|
||||
@@ -123,6 +123,32 @@ public:
|
||||
return index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the auth token carried by the frame.
|
||||
*
|
||||
* @return uint64_t The auth token value.
|
||||
*/
|
||||
uint64_t getToken() const {
|
||||
ob_error *error = nullptr;
|
||||
auto token = ob_frame_get_token(impl_, &error);
|
||||
Error::handle(&error);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the auth token carried by the frame.
|
||||
*
|
||||
* @param token The auth token value.
|
||||
*/
|
||||
void setToken(uint64_t token) {
|
||||
ob_error *error = nullptr;
|
||||
auto unConstImpl = const_cast<ob_frame *>(impl_);
|
||||
|
||||
ob_frame_set_token(unConstImpl, token, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get frame data
|
||||
*
|
||||
|
||||
@@ -70,10 +70,19 @@ public:
|
||||
|
||||
class PlaybackDevice : public Device {
|
||||
public:
|
||||
explicit PlaybackDevice(const std::string &file) : Device(nullptr) {
|
||||
/**
|
||||
* @brief Constructs a PlaybackDevice for playing back recorded device data.
|
||||
* @param[in] file Path to the playback file.
|
||||
* @param[in] presetPath Path to a preset JSON file to load after device creation. If empty, no preset is loaded.
|
||||
*/
|
||||
explicit PlaybackDevice(const std::string &file, const std::string &presetPath = "") : Device(nullptr) {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_playback_device(file.c_str(), &error);
|
||||
Error::handle(&error);
|
||||
|
||||
if(!presetPath.empty()) {
|
||||
loadPresetFromJsonFile(presetPath.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~PlaybackDevice() noexcept override = default;
|
||||
|
||||
@@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
# Import target "ob::OrbbecSDK" for configuration "Release"
|
||||
set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(ob::OrbbecSDK PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.1"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.2"
|
||||
IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2"
|
||||
)
|
||||
|
||||
list(APPEND _cmake_import_check_targets ob::OrbbecSDK )
|
||||
list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.1" )
|
||||
list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.2" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
|
||||
set(PACKAGE_VERSION "2.9.1")
|
||||
set(PACKAGE_VERSION "2.9.2")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
|
||||
if("2.9.1" MATCHES "^([0-9]+)\\.")
|
||||
if("2.9.2" MATCHES "^([0-9]+)\\.")
|
||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
|
||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
|
||||
endif()
|
||||
else()
|
||||
set(CVF_VERSION_MAJOR "2.9.1")
|
||||
set(CVF_VERSION_MAJOR "2.9.2")
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION_RANGE)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
libOrbbecSDK.so.2.9.1
|
||||
libOrbbecSDK.so.2.9.2
|
||||
BIN
Binary file not shown.
@@ -8,12 +8,12 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
|
||||
# Import target "ob::OrbbecSDK" for configuration "Release"
|
||||
set_property(TARGET ob::OrbbecSDK APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
||||
set_target_properties(ob::OrbbecSDK PROPERTIES
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.1"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.2"
|
||||
IMPORTED_SONAME_RELEASE "libOrbbecSDK.so.2"
|
||||
)
|
||||
|
||||
list(APPEND _cmake_import_check_targets ob::OrbbecSDK )
|
||||
list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.1" )
|
||||
list(APPEND _cmake_import_check_files_for_ob::OrbbecSDK "${_IMPORT_PREFIX}/lib/libOrbbecSDK.so.2.9.2" )
|
||||
|
||||
# Commands beyond this point should not need to know the version.
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
|
||||
set(PACKAGE_VERSION "2.9.1")
|
||||
set(PACKAGE_VERSION "2.9.2")
|
||||
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
|
||||
if("2.9.1" MATCHES "^([0-9]+)\\.")
|
||||
if("2.9.2" MATCHES "^([0-9]+)\\.")
|
||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
||||
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
|
||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
|
||||
endif()
|
||||
else()
|
||||
set(CVF_VERSION_MAJOR "2.9.1")
|
||||
set(CVF_VERSION_MAJOR "2.9.2")
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION_RANGE)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
libOrbbecSDK.so.2.9.1
|
||||
libOrbbecSDK.so.2.9.2
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user