update OrbbecSDK version to 2.9.0

This commit is contained in:
ob-yalian
2026-06-18 12:20:49 +08:00
parent b775665850
commit 84b0f60a45
21 changed files with 724 additions and 15 deletions
@@ -0,0 +1,253 @@
// Copyright (c) Orbbec Inc. All Rights Reserved.
// Licensed under the MIT License.
#pragma once
#include "ObTypes.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Application configuration key.
* Each key has a fixed value type and item usage.
* Keys must stay within the low 32 bits because @ref OBAppConfigItem stores the key in bits 0-31.
*/
typedef enum {
OB_APP_CONFIG_SENSORS = 0, /**< array, sensor list. Use @ref ob_application_config_get_count to get sensor count. */
OB_APP_CONFIG_SENSOR_TYPE = 1, /**< int32_t, sensor item: OBSensorType. */
OB_APP_CONFIG_STREAM_ENABLED = 2, /**< bool, sensor item: whether the sensor stream should be started. */
OB_APP_CONFIG_STREAM_PROFILE = 3, /**< ob_stream_profile, sensor item: stream profile. */
OB_APP_CONFIG_UNDISTORTION_ENABLED = 4, /**< bool, sensor item: whether undistortion should be enabled. */
OB_APP_CONFIG_DEVICE_DECIMATION_ENABLED = 5, /**< bool, global item: whether device-level decimation should be applied. */
OB_APP_CONFIG_DEVICE_DECIMATION = 6, /**< OBPresetResolutionConfig, global item: device-level decimation configuration. */
/**< Currently applied only by Gemini 435Le. */
// Point cloud
OB_APP_CONFIG_POINTCLOUD_ENABLED = 100, /**< bool, global item: whether point cloud output should be enabled. */
OB_APP_CONFIG_POINTCLOUD_FORMAT = 101, /**< int32_t, global item: OBFormat, point cloud output format. */
OB_APP_CONFIG_POINTCLOUD_DECIMATION_FACTOR = 102, /**< int32_t, global item: point cloud decimation factor. */
OB_APP_CONFIG_POINTCLOUD_ALIGN_MODE = 103, /**< int32_t, global item: OBAlignMode. */
OB_APP_CONFIG_POINTCLOUD_FRAME_SYNC = 104, /**< bool, global item: whether frame sync should be enabled. */
OB_APP_CONFIG_POINTCLOUD_ALL_FRAME_TYPE_REQUIRED = 105, /**< bool, global item: false: output on any situation, true: require all frame types. */
OB_APP_CONFIG_POINTCLOUD_MATCH_TARGET_RESOLUTION = 106, /**< bool, global item: whether to match target resolution. */
// HDR Merge
OB_APP_CONFIG_HDR_MERGE_ENABLED = 200, /**< bool, global item: whether HDR merge should be enabled. */
OB_APP_CONFIG_HDR_MERGE_IR_ENABLED = 201, /**< bool, global item: whether IR frame should be enabled for HDR merge. */
} OBAppConfigKey,
ob_app_config_key;
/**
* @brief Application configuration item.
* An item combines a configuration key and an optional array index.
* Non-array keys use @ref OB_APP_CONFIG_ITEM.
* Array keys use @ref OB_APP_CONFIG_ARRAY_ITEM.
* The key is stored in bits 0-31 and the index is stored in bits 32-63.
*/
typedef uint64_t OBAppConfigItem, ob_app_config_item;
#define OB_APP_CONFIG_INDEX_NONE (0u)
#define OB_APP_CONFIG_ITEM(key) ((OBAppConfigItem)(uint32_t)(key))
#define OB_APP_CONFIG_ARRAY_ITEM(key, index) ((((OBAppConfigItem)(uint32_t)(index)) << 32) | (OBAppConfigItem)(uint32_t)(key))
#define OB_APP_CONFIG_ITEM_KEY(item) ((OBAppConfigKey)((uint32_t)((item) & 0xFFFFFFFFu)))
#define OB_APP_CONFIG_ITEM_INDEX(item) ((uint32_t)(((item) >> 32) & 0xFFFFFFFFu))
/**
* @brief Application configuration value type.
*/
typedef enum {
OB_APP_CONFIG_VALUE_BOOL, /**< Boolean value. */
OB_APP_CONFIG_VALUE_INT, /**< int32_t value. */
OB_APP_CONFIG_VALUE_FLOAT, /**< float value. */
OB_APP_CONFIG_VALUE_STRING, /**< String value. The returned pointer is owned by the config object. */
OB_APP_CONFIG_VALUE_STRUCT, /**< Fixed-size SDK structure value. */
} OBAppConfigValueType,
ob_app_config_value_type;
/**
* @brief Get the application runtime configuration cache for the device.
*
* @param[in] device The device object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_application_config* The application configuration object cached by the device.
* @attention If the device has no application configuration cache, the SDK creates one with default values.
* @attention Changes made through the returned config update the device cache directly.
* @attention The returned config should be released by calling @ref ob_delete_application_config.
*/
OB_EXPORT ob_application_config *ob_device_get_application_config(ob_device *device, ob_error **error);
/**
* @brief Delete an application configuration object.
*
* @param[in] config The application configuration object to be deleted.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_delete_application_config(ob_application_config *config, ob_error **error);
/**
* @brief Check whether the current device supports application runtime configuration import/export.
*
* @param[in] device The device object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool Return true if application configuration import/export is supported, false otherwise.
*/
OB_EXPORT bool ob_device_is_application_config_supported(ob_device *device, ob_error **error);
/**
* @brief Reset an application configuration object to default values.
*
* @param[in] config The application configuration object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_reset(ob_application_config *config, ob_error **error);
/**
* @brief Set a bool value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to update. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[in] value The bool value to be set.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_set_bool(ob_application_config *config, OBAppConfigItem item, bool value, ob_error **error);
/**
* @brief Get a bool value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to read. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool The bool value.
*/
OB_EXPORT bool ob_application_config_get_bool(const ob_application_config *config, OBAppConfigItem item, ob_error **error);
/**
* @brief Set an int32_t value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to update. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[in] value The int32_t value to be set.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_set_int(ob_application_config *config, OBAppConfigItem item, int32_t value, ob_error **error);
/**
* @brief Get an int32_t value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to read. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return int32_t The int32_t value.
*/
OB_EXPORT int32_t ob_application_config_get_int(const ob_application_config *config, OBAppConfigItem item, ob_error **error);
/**
* @brief Set a float value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to update. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[in] value The float value to be set.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_set_float(ob_application_config *config, OBAppConfigItem item, float value, ob_error **error);
/**
* @brief Get a float value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to read. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return float The float value.
*/
OB_EXPORT float ob_application_config_get_float(const ob_application_config *config, OBAppConfigItem item, ob_error **error);
/**
* @brief Set a string value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to update. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[in] value The string value to be set.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_set_string(ob_application_config *config, OBAppConfigItem item, const char *value, ob_error **error);
/**
* @brief Get a string value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to read. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return const char* The string value.
* @attention The returned pointer is owned by the config object and becomes invalid after the config is modified or deleted.
*/
OB_EXPORT const char *ob_application_config_get_string(const ob_application_config *config, OBAppConfigItem item, ob_error **error);
/**
* @brief Set a fixed-size SDK structure value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to update. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[in] value Pointer to the structure value to be copied.
* @param[in] valueSize Size of the structure value in bytes.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_set_struct(ob_application_config *config, OBAppConfigItem item, const void *value, uint32_t valueSize, ob_error **error);
/**
* @brief Get a fixed-size SDK structure value.
*
* @param[in] config The application configuration object.
* @param[in] item The configuration item to read. Use @ref OB_APP_CONFIG_ITEM or @ref OB_APP_CONFIG_ARRAY_ITEM to build it.
* @param[out] value Pointer to the buffer that receives the structure value.
* @param[in] valueSize Size of the output buffer in bytes.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_application_config_get_struct(const ob_application_config *config, OBAppConfigItem item, void *value, uint32_t valueSize, ob_error **error);
/**
* @brief Set the stream profile for a sensor item.
*
* @param[in] config The application configuration object.
* @param[in] item The sensor stream profile item to update. Use @ref OB_APP_CONFIG_ARRAY_ITEM with @ref OB_APP_CONFIG_STREAM_PROFILE.
* @param[in] profile The stream profile to be copied into the config object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @attention The config object clones the profile. The caller still owns and should release the input profile.
*/
OB_EXPORT void ob_application_config_set_profile(ob_application_config *config, OBAppConfigItem item, const ob_stream_profile *profile, ob_error **error);
/**
* @brief Get the stream profile from a sensor item.
*
* @param[in] config The application configuration object.
* @param[in] item The sensor stream profile item to read. Use @ref OB_APP_CONFIG_ARRAY_ITEM with @ref OB_APP_CONFIG_STREAM_PROFILE.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_stream_profile* The stream profile stored in the sensor item.
* @attention The returned profile should be released by calling @ref ob_delete_stream_profile.
*/
OB_EXPORT ob_stream_profile *ob_application_config_get_profile(const ob_application_config *config, OBAppConfigItem item, ob_error **error);
/**
* @brief Get the number of items in an array key.
*
* Currently only @ref OB_APP_CONFIG_SENSORS is supported.
*
* @param[in] config The application configuration object.
* @param[in] key The array key to count. Refer to @ref OBAppConfigKey for available keys.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return uint32_t The number of items in the array key.
*/
OB_EXPORT uint32_t ob_application_config_get_count(const ob_application_config *config, OBAppConfigKey key, ob_error **error);
#ifdef __cplusplus
}
#endif
@@ -184,6 +184,15 @@ OB_EXPORT void ob_unregister_device_changed_callback(ob_context *context, ob_cal
*/
OB_EXPORT void ob_enable_device_clock_sync(ob_context *context, uint64_t repeat_interval_msec, ob_error **error);
/**
* @brief Synchronize the device time (synchronize hardwarePPS time to all created devices)
*
* @param[in] context Pointer to the context object
* @param[in] hardware_pps_time unit: ms.
* @param[out] error Pointer to an error object that will be populated if an error occurs during execution
*/
OB_EXPORT void ob_sync_device_hardware_pps_time(ob_context *context, uint64_t hardware_pps_time, ob_error **error);
/**
* @brief Free idle memory from the internal frame memory pool
*
@@ -337,6 +337,17 @@ 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 Synchronize the device time (synchronize hardwarePPS time to device)
*
* @param[in] device The device object.
* @param[in] hardware_pps_time unit: ms.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool Whether the synchronisation is successful.
*/
OB_EXPORT bool ob_device_sync_hardware_pps_time(ob_device *device, uint64_t hardware_pps_time, ob_error **error);
/**
* @brief Send data to the device and receive data from the device.
* @brief This is a factory and debug function, which can be used to send and receive data from the device. The data format is secret and belongs to the device
@@ -66,7 +66,7 @@ OB_EXPORT ob_multi_device_sync_config ob_device_get_multi_device_sync_config(con
* number of frames per trigger can be set by @ref ob_multi_device_sync_config::framesPerTrigger.
* @attention For some models, receive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling this
* function should not be too high, please refer to the product manual for the specific supported frequency.
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING mode, device will ignore the capture command.
*
* @param[in] device The device handle.
* @param[out] error Pointer to an error object that will be set if an error occurs.
@@ -35,6 +35,7 @@ typedef struct ob_filter_t ob_filter;
typedef struct ob_filter_list_t ob_filter_list;
typedef struct ob_pipeline_t ob_pipeline;
typedef struct ob_config_t ob_config;
typedef struct ob_application_config_t ob_application_config;
typedef struct ob_depth_work_mode_list_t ob_depth_work_mode_list;
typedef struct ob_device_preset_list_t ob_device_preset_list;
typedef struct ob_filter_config_schema_list_t ob_filter_config_schema_list;
@@ -574,6 +575,7 @@ typedef enum {
ALIGN_DISABLE, /**< Turn off alignment */
ALIGN_D2C_HW_MODE, /**< Hardware D2C alignment mode */
ALIGN_D2C_SW_MODE, /**< Software D2C alignment mode */
ALIGN_C2D_SW_MODE, /**< Software C2D alignment mode */
} OBAlignMode,
ob_align_mode;
@@ -638,11 +638,30 @@ typedef enum {
*/
OB_PROP_DEVICE_IP_MODE_INT = 260,
/**
/**
* @brief DHCP assign IP timeout, unit: second
*/
*/
OB_PROP_DHCP_ASSIGN_IP_TIMEOUT_INT = 261,
/**
* @brief USB sync I/O voltage level
*/
OB_PROP_USB_SYNC_VOLTAGE_LEVEL_INT = 270,
/**
* @brief Get the current disparity search range mode value
*
* @attention read only
*/
OB_PROP_CURRENT_DISP_SEARCH_RANGE_MODE_INT = 271,
/**
* @brief Get the current disparity search offset value
*
* @attention read only
*/
OB_PROP_CURRENT_DISP_SEARCH_OFFSET_INT = 272,
/**
* @brief Baseline calibration parameters
*/