replace SDK to v1.4.1

This commit is contained in:
Joe Dong
2022-10-10 18:10:20 +08:00
parent 91bab5f96b
commit d1996a6016
27 changed files with 848 additions and 463 deletions
@@ -30,8 +30,8 @@ public:
/**
* \if English
* @brief Context is a management class that describes the runtime of the SDK. It is responsible for the applying and releasing of resources for the SDK.
* The context has the ability to manage multiple devices, is responsible for enumerating devices, monitoring device callbacks, and enabling functions such as multi-device synchronization.
* \else
* The context has the ability to manage multiple devices, is responsible for enumerating devices, monitoring device callbacks, and enabling functions such
* as multi-device synchronization. \else
* @brief context是描述SDK的runtime一个管理类,负责SDK的资源申请与释放
* context具备多设备的管理能力,负责枚举设备,监听设备回调,启用多设备同步等功能
* \endif
@@ -53,8 +53,16 @@ public:
*/
std::shared_ptr<DeviceList> queryDeviceList();
using DeviceChangedCallback = std::function<void(std::shared_ptr<DeviceList> removedList, std::shared_ptr<DeviceList> addedList)>;
/**
* @brief 创建网络设备对象
*
* @param address ip 地址
* @param port 端口号
* @return std::shared_ptr<Device> 返回创建好的设备对象
*/
std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port);
using DeviceChangedCallback = std::function<void(std::shared_ptr<DeviceList> removedList, std::shared_ptr<DeviceList> addedList)>;
/**
* \if English
* @brief Set device plug-in callback function
@@ -72,8 +80,8 @@ public:
* \if English
* @brief Activate the multi-device synchronization function to synchronize the clock of the created device(the device needs support this function)
*
* @param repeatInterval synchronization time interval (unit: ms; if repeatInterval=0, it means that it will only be synchronized once and will not be executed regularly)
* \else
* @param repeatInterval synchronization time interval (unit: ms; if repeatInterval=0, it means that it will only be synchronized once and will not be
* executed regularly) \else
* @brief 启动多设备同步功能,同步已创建设备的时钟(需要使用的设备支持该功能)
*
* @param repeatInterval 定时同步时间间隔(单位ms;如果repeatInterval=0,表示只同步一次,不再定时执行)
@@ -82,43 +90,43 @@ public:
void enableMultiDeviceSync(uint64_t repeatInterval);
/**
* \if English
* @brief Set the level of the global log will affect both the log level output to the terminal and output to the file
* \if English
* @brief Set the level of the global log will affect both the log level output to the terminal and output to the file
*
* @param severity log output level
* \else
* \else
* @brief 设置全局日志的等级,会同时作用于输出到终端和输出到文件的日志等级
*
* @param severity 日志输出等级
* \endif
* \endif
*/
static void setLoggerSeverity(OBLogSeverity severity);
/**
* \if English
* \if English
* @brief Set log output to file
*
* @param severity log level output to file
* @param 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)
* \else
* @param 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) \else
* @brief 设置日志输出到文件
*
* @param severity 输出到文件的日志等级
* @param directory 日志文件输出路径,如果路径为空,则继续使用已有设置(已有配置也为空则不输出日志到文件)
* \endif
* \endif
*/
static void setLoggerToFile(OBLogSeverity severity, const char *directory);
/**
* \if English
* \if English
* @brief Set log output to terminal
*
* @param severity log level output to the terminal
* \else
* \else
* @brief 设置日志输出到终端
*
* @param severity 输出到终端的日志等级
* \endif
* \endif
*/
static void setLoggerToConsole(OBLogSeverity severity);
};
@@ -221,7 +221,7 @@ public:
* \if English
* @brief AHB register write
*
* @param reg Register to be written
* @param reg Register to be written
* @param mask The mask to be writen
* @param value The value to be written
* \else
@@ -374,7 +374,7 @@ public:
void getRawData(OBPropertyID propertyId, GetDataCallback callback, bool async = false);
/**
* \if English
* \if English
* @brief Set structured data type of device property
*
* @param propertyId Property id
@@ -404,7 +404,7 @@ public:
* @param data 获取的属性数据
* @param dataSize 获取的属性大小
* \endif
*/
*/
void getStructuredData(OBPropertyID propertyId, void *data, uint32_t *dataSize);
/**
@@ -436,19 +436,19 @@ public:
OBPropertyItem getSupportedProperty(uint32_t index);
/**
* \if English
* @brief Judge property permission support
* \if English
* @brief Judge property permission support
*
* @param propertyId Property id
* @param permission Types of read and write permissions that need to be interpreted
* @return bool returns whether it is supported
* \else
* \else
* @brief 判断属性权限支持情况
*
* @param propertyId 属性id
* @param permission 需要判读的读写权限类型
* @return bool 返回是否支持
* \endif
* \endif
*/
bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission);
@@ -514,8 +514,8 @@ public:
* \if English
* @brief Set the device state changed callbacks
*
* @param callback The callback function that is triggered when the device status changes (for example, the frame rate is automatically reduced or the stream is closed due to high temperature, etc.)
* \else
* @param callback The callback function that is triggered when the device status changes (for example, the frame rate is automatically reduced or the
* stream is closed due to high temperature, etc.) \else
* @brief 设置设备状态改变回调函数
*
* @param callback 设备状态改变(如,由于温度过高自动降低帧率或关流等)时触发的回调函数
@@ -548,30 +548,31 @@ public:
void writeAuthorizationCode(const char *authCodeStr);
/**
* \if English
* @brief Get the original parameter list of camera calibration saved in the device. The parameters in the list do not correspond to the current open-current configuration.
* You need to select the parameters according to the actual situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the Pipeline::getCameraParam() interface.
* \if English
* @brief Get the original parameter list of camera calibration saved in the device. The parameters in the list do not correspond to the current
* open-current configuration. You need to select the parameters according to the actual situation, and may need to do scaling, mirroring and other
* processing. Non-professional users are recommended to use the Pipeline::getCameraParam() interface.
*
* @return std::shared_ptr<CameraParamList> camera parameter list
* \else
* \else
* @brief 获取设备内保存的相机标定的原始参数列表,列表内参数不与当前开流配置相对应,
* 需要自行根据实际情况选用参数并可能需要做缩放、镜像等处理。非专业用户建议使用Pipeline::getCameraParam()接口。
*
* @return std::shared_ptr<CameraParamList> 相机参数列表
* \endif
* \endif
*/
std::shared_ptr<CameraParamList> getCalibrationCameraParamList();
/**
* \if English
* @brief Device restart
* @attention The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal.
* \if English
* @brief Device restart
* @attention The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal.
* Please delete the object directly and obtain it again after the device is reconnected.
* \else
* \else
* @brief 设备重启
* @attention 设备会掉线重连,设备掉线后对Device对象接口访问可能会发生异常,请直接删除该对象,
* 待设备重连后可重新获取。
* \endif
* \endif
*/
void reboot();
@@ -674,11 +675,11 @@ public:
/**
* \if English
* @brief Get usb connection type
* @brief Get usb connection type (DEPRECATED)
*
* @return const char* returns usb connection type
* \else
* @brief 获取usb连接类型
* @brief 获取usb连接类型 (废弃接口)
*
* @return const char* 返回usb连接类型
* \endif
@@ -699,54 +700,54 @@ public:
const char *connectionType();
/**
* \if English
* @brief Get the version number of the hardware
* \if English
* @brief Get the version number of the hardware
*
* @return const char* returns the version number of the hardware
* \else
* \else
* @brief 获取硬件的版本号
*
* @return const char* 返回硬件的版本号
* \endif
* \endif
*/
const char *hardwareVersion();
/**
* \if English
* @brief Get the minimum version number of the SDK supported by the device
* \if English
* @brief Get the minimum version number of the SDK supported by the device
*
* @return const char* returns the minimum SDK version number supported by the device
* \else
* \else
* @brief 获取设备支持的SDK最小版本号
*
* @return const char* 返回设备支持的SDK最小版本号
* \endif
* \endif
*/
const char *supportedMinSdkVersion();
/**
* \if English
* @brief Get chip type name
* \if English
* @brief Get chip type name
*
* @return const char* returns the chip type name
* \else
* \else
* @brief 获取芯片类型名称
*
* @return const char* 返回芯片类型名称
* \endif
* \endif
*/
const char *asicName();
/**
* \if English
* @brief Get device type
* \if English
* @brief Get device type
*
* @return OBDeviceType returns the device type
* \else
* \else
* @brief 获取设备类型
*
* @return OBDeviceType 返回设备类型
* \endif
* \endif
*/
OBDeviceType deviceType();
@@ -778,18 +779,18 @@ public:
/**
* \if English
* @brief Get the name of the specified device
* @brief Get the name of the specified device (DEPRECATED)
*
* @param index Device index
* @return int returns the name of the device
* \else
* @brief 获取指定设备的名称
* @brief 获取指定设备的名称 (废弃接口)
*
* @param index 设备索引
* @return int 返回设备的名称
* \endif
*/
const char *name(uint32_t index);
DEPRECATED const char *name(uint32_t index);
/**
* \if English
@@ -832,67 +833,67 @@ public:
*
* @param index 设备索引
* @return const char * 返回设备的uid
* \endif
* \endif
*/
const char *uid(uint32_t index);
/**
* \if English
* \if English
* @brief Get the serial number of the specified device
*
* @param index device index
* @return const char * returns the serial number of the device
* \else
* @brief 获取指定设备的序列号
* \else
* @brief 获取指定设备的序列号
*
* @param index 设备索引
* @return const char * 返回设备的序列号
* \endif
* \endif
*/
const char *serialNumber(uint32_t index);
/**
* \if English
* \if English
* @brief Get the specified device object from the device list
* @attention If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
* @param index index of the device to create
* @return std::shared_ptr<Device> returns the device object
* \else
* \else
* @brief 从设备列表中获取指定设备对象,
* @attention 如果设备有在其他地方被获取创建,重复获取将会抛异常
* @param index 要创建设备的索引
* @return std::shared_ptr<Device> 返回设备对象
* \endif
* \endif
*/
std::shared_ptr<Device> getDevice(uint32_t index);
/**
* \if English
* \if English
* @brief Get the specified device object from the device list
* @attention If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
* @param serialNumber The serial number of the device to be created
* @return std::shared_ptr<Device> returns the device object
* \else
* \else
* @brief 从设备列表中获取指定设备对象
* @attention 如果设备有在其他地方被获取创建,重复获取将会抛异常
* @param serialNumber 要创建设备的序列号
* @return std::shared_ptr<Device> 返回设备对象
* \endif
* \endif
*/
std::shared_ptr<Device> getDeviceBySN(const char *serialNumber);
/**
* \if English
* @brief Get the specified device object from the device list
* \if English
* @brief Get the specified device object from the device list
* @attention If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
* @param uid If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
* @return std::shared_ptr<Device> If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
* \else
* \else
* @brief 从设备列表中获取指定设备对象
* @attention 如果设备有在其他地方被获取创建,重复获取将会抛异常
* @param uid 要创建设备的uid
* @return std::shared_ptr<Device> 返回设备对象
* \endif
* \endif
*/
std::shared_ptr<Device> getDeviceByUid(const char *uid);
};
@@ -905,30 +906,30 @@ public:
CameraParamList(std::unique_ptr<CameraParamListImpl> impl);
~CameraParamList() noexcept;
/**
* \if English
* @brief Number of camera parameter groups
* \if English
* @brief Number of camera parameter groups
*
* @return uint32_t returns the number of camera parameter groups
* \else
* \else
* @brief 相机参数组数
*
* @return uint32_t 返回相机参数组数
* \endif
* \endif
*/
uint32_t count();
/**
* \if English
* @brief Get camera parameters
* \if English
* @brief Get camera parameters
*
* @param index parameter index
* @return OBCameraParam returns the corresponding group parameters
* \else
* \else
* @brief 获取相机参数
*
* @param index 参数索引
* @return OBCameraParam 返回对应组参数
* \endif
* \endif
*/
OBCameraParam getCameraParam(uint32_t index);
};
@@ -35,10 +35,10 @@ public:
const char *getMessage() const noexcept;
/**
* \if English
* @brief Get the exception type of the error, and determine which module is abnormal.
* \if English
* @brief Get the exception type of the error, and determine which module is abnormal.
* @return OBExceptionType
* \else
* \else
* @brief 获取该错误的异常类型,判断是具体哪个模块异常。
* @return OBExceptionType
*/
@@ -25,53 +25,53 @@ public:
virtual ~Filter() = default;
/**
* \if English
* @brief filter reset, free the internal cache, stop the processing thread and clear the pending buffer frame when asynchronous processing
* \else
* \if English
* @brief filter reset, free the internal cache, stop the processing thread and clear the pending buffer frame when asynchronous processing
* \else
* @brief filter重置,释放内部缓存,异步处理时停止处理线程并清空待处理的缓存帧
* \endif
*/
virtual void reset();
/**
* \if English
* \if English
* @brief Processing frames (synchronous interface)
*
* @param frame frame to be processed
* @return std::shared_ptr< Frame > processed frame
* \else
* \else
* @brief 处理帧(同步接口)
*
* @param frame 需要处理的frame
* @return std::shared_ptr< Frame > 处理后的frame
* \endif
* \endif
*/
virtual std::shared_ptr<Frame> process(std::shared_ptr<Frame> frame);
/**
* \if English
* @brief Push the pending frame into the cache (asynchronous callback interface)
* \if English
* @brief Push the pending frame into the cache (asynchronous callback interface)
*
* @param frame The pending frame processing result is returned by the callback function
* \else
* \else
* @brief 压入待处理frame到缓存(异步回调接口)
*
* @param frame 待处理的frame处理结果通过回调函数返回
* \endif
* \endif
*/
virtual void pushFrame(std::shared_ptr<Frame> frame);
/**
* \if English
* @brief Set the callback function (asynchronous callback interface)
* \if English
* @brief Set the callback function (asynchronous callback interface)
*
* @param callback Processing result callback
* \else
* \else
* @brief 设置回调函数(异步回调接口)
*
* @param callback 处理结果回调
* \endif
* \endif
*/
virtual void setCallBack(FilterCallback callback);
@@ -83,58 +83,85 @@ class OB_EXTENSION_API PointCloudFilter : public Filter {
public:
PointCloudFilter();
/**
* \if English
* \if English
* @brief Set point cloud type parameters
*
* @param type Point cloud type depth point cloud or RGBD point cloud
* \else
* \else
* @brief 设置点云类型参数
*
* @param type 点云类型 深度点云或RGBD点云
* \endif
* \endif
*/
void setCreatePointFormat(OBFormat type);
/**
* \if English
* @brief Set camera parameters
* \if English
* @brief Set camera parameters
*
* @param param Camera internal and external parameters
* \else
* \else
* @brief 设置相机参数
*
* @param param 相机内外参数
* \endif
* \endif
*/
void setCameraParam(OBCameraParam param);
/**
* \if English
* @brief Set the frame alignment state that will be input to generate point cloud (it needs to be enabled in D2C mode, as the basis for the algorithm to select the set of camera internal parameters)
* \if English
* @brief Set the frame alignment state that will be input to generate point cloud (it needs to be enabled in D2C mode, as the basis for the algorithm to
* select the set of camera internal parameters)
*
* @param state Alignment status, True: enable alignment; False: disable alignment
* \else
* \else
* @brief 设置将要输入的用于生成点云的帧对齐状态(D2C模式下需要开启,作为算法选用那组相机内参的依据)
*
* @param state 对齐状态,True:开启对齐; False:关闭对齐
* \endif
* \endif
*/
void setFrameAlignState(bool state);
/**
* \if English
* @brief Set point cloud position data scale ratio
*
* @param scale scale ratio
* \else
* @brief 设置点云坐标数据缩放比例
*
* @param scale 缩放比例
* \endif
*/
void setPositionDataScaled(float scale);
/**
* \if English
* @brief Set point cloud color data normalization
*
* @param state Whether to normalize
* \else
* @brief 设置点云颜色数据归一化
*
* @param state 是否需要归一化
* \endif
*/
void setColorDataNormalization(bool state);
};
class OB_EXTENSION_API FormatConvertFilter : public Filter {
public:
FormatConvertFilter();
/**
* \if English
* @brief Set format conversion type
* \if English
* @brief Set format conversion type
*
* @param type Format conversion type
* \else
* \else
* @brief 设置格式转化类型
*
* @param type 格式转化类型
* \endif
* \endif
*/
void setFormatConvertType(OBConvertFormat type);
};
@@ -34,6 +34,9 @@ struct FrameImpl;
namespace ob {
class StreamProfile;
class Filter;
class FrameHelper;
typedef std::function<void(void *buffer, void *context)> BufferDestroyCallback;
class OB_EXTENSION_API Frame : public std::enable_shared_from_this<Frame> {
protected:
@@ -97,17 +100,17 @@ public:
virtual void *data();
/**
* \if English
* \if English
* @brief Get the frame data size
*
* @return uint32_t returns the frame data size
* If it is point cloud data, it returns the number of bytes occupied by all point sets. If you need to find the number of points, you need to divide the dataSize by the structure size of the corresponding point type.
* \else
* If it is point cloud data, it returns the number of bytes occupied by all point sets. If you need to find the number of points, you need to divide the
* dataSize by the structure size of the corresponding point type. \else
* @brief 获取帧数据大小
*
* @return uint32_t 返回帧数据的大小
* 如果是点云数据返回的是所有点集合占的字节数,若需要求出点的个数需要将dataSize除以对应的点类型的结构体大小
* \endif
* \endif
*/
virtual uint32_t dataSize();
@@ -188,6 +191,7 @@ public:
private:
friend class Filter;
friend class Recorder;
friend class FrameHelper;
};
class OB_EXTENSION_API VideoFrame : public Frame {
@@ -248,17 +252,17 @@ public:
uint32_t metadataSize();
/**
* \if English
* \if English
* @brief Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are valid bits, and the upper 6 bits are filled with 0)
* @attention Only valid for Y8/Y10/Y11/Y12/Y14/Y16 format
*
* @return uint8_t returns the effective number of pixels in the pixel, or 0 if it is an unsupported format
* \else
* \else
* @brief 获取像素有效位数(如Y16格式帧,每个像素占16bit,但实际只有低10位是有效位,高6位填充0)
* @attention 仅对Y8/Y10/Y11/Y12/Y14/Y16格式有效
*
* @return uint8_t 返回像素有效位数,如果是不支持的格式,返回0
* \endif
* \endif
*/
uint8_t pixelAvailableBitSize();
};
@@ -459,6 +463,64 @@ public:
float temperature();
};
class OB_EXTENSION_API FrameHelper {
public:
FrameHelper();
~FrameHelper();
/**
* @brief 根据外部创建的Buffer创建帧对象
*
* @param format 帧对象格式
* @param frameWidth 帧对象宽
* @param frameHeight 帧对象高
* @param buffer 帧对象数据
* @param bufferSize 帧对象数据大小
* @return std::shared_ptr<Frame> 返回帧对象
*/
static std::shared_ptr<Frame> createFrameFromBuffer(OBFormat format, uint32_t frameWidth, uint32_t frameHeight, uint8_t *buffer, uint32_t bufferSize,
BufferDestroyCallback destroyCallback, void *destroyCallbackContext);
/**
* @brief 创建空的帧集合对象
*
* @return std::shared_ptr<Frame> 返回帧集合对象
*/
static std::shared_ptr<Frame> createFrameSet();
/**
* @brief 往帧集合中填入对应类型的帧
*
* @param frameSet 帧集合对象
* @param frameType 填入帧的类型
* @param frame 填入帧的对象
*/
static void pushFrame(std::shared_ptr<Frame> frameSet, OBFrameType frameType, std::shared_ptr<Frame> frame);
/**
* @brief 设置帧的系统时间戳
*
* @param frame 设置的帧对象
* @param systemTimestamp 设置的系统时间戳
*/
static void setFrameSystemTimestamp(std::shared_ptr<Frame> frame, uint64_t systemTimestamp);
/**
* @brief 设置帧的设备时间戳
*
* @param frame 设置的帧对象
* @param deviceTimestamp 设置的设备时间戳
*/
static void setFrameDeviceTimestamp(std::shared_ptr<Frame> frame, uint64_t deviceTimestamp);
/**
* @brief 设置帧的设备时间戳
*
* @param frame 设置的帧对象
* @param deviceTimestampUs 设置的设备时间戳(Us)
*/
static void setFrameDeviceTimestampUs(std::shared_ptr<Frame> frame, uint64_t deviceTimestampUs);
};
template <typename T> bool Frame::is() {
switch(this->type()) {
case OB_FRAME_IR:
@@ -1,8 +1,8 @@
/**
* \if English
* @file Pipeline.hpp
* @brief The SDK's advanced API type can quickly implement switching streaming, frame synchronization, software filtering, and generating point cloud operations.
* \else
* @brief The SDK's advanced API type can quickly implement switching streaming, frame synchronization, software filtering, and generating point cloud
* operations. \else
* @file Pipeline.hpp
* @brief SDK的高级API类型,可以快速实现开关流,帧同步,软件滤波,生成点云等操作
* \endif
@@ -36,10 +36,9 @@ private:
public:
/**
* \if English
* @brief Pipeline is a high-level interface for applications, algorithms related RGBD data streams. Pipeline can provide alignment inside and synchronized FrameSet.
* Pipeline() no parameter version, which opens the first device in the list of devices connected to the OS by default. If the application has obtained the device through the DeviceList,
* opening the Pipeline() at this time will throw an exception that the device has been created.
* \else
* @brief Pipeline is a high-level interface for applications, algorithms related RGBD data streams. Pipeline can provide alignment inside and synchronized
* FrameSet. Pipeline() no parameter version, which opens the first device in the list of devices connected to the OS by default. If the application has
* obtained the device through the DeviceList, opening the Pipeline() at this time will throw an exception that the device has been created. \else
* @brief Pipeline 是SDK的高级接口,适用于应用,算法等重点关注RGBD数据流常见,Pipeline在SDK内部可以提供对齐,同步后的FrameSet桢集合
* 直接方便客户使用。
* Pipeline()无参数版本,默认打开连接到OS的设备列表中的第一个设备。若应用已经通过DeviceList获取设备,此时打开Pipeline()会抛出设备已经创建异常。
@@ -50,8 +49,8 @@ public:
/**
* \if English
* @brief
* Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices need to be obtained through DeviceList, and the device and pipeline are bound through this interface.
* \else
* Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices need to be obtained through DeviceList, and the device
* and pipeline are bound through this interface. \else
* @brief
* Pipeline(std::shared_ptr< Device > device )函数,适用于多设备操作常见,此时需要通过DeviceList获取多个设备,通过该接口实现device和pipeline绑定。
* \endif
@@ -59,15 +58,15 @@ public:
Pipeline(std::shared_ptr<Device> device);
/**
* \if English
* \if English
* @brief Create a pipeline for playback of recorded stream files
*
* @param filename Playback file path
* \else
* \else
* @brief 创建pipeline用于回放录制好的流文件
*
* @param filename 回放文件路径
* \endif
* \endif
*/
Pipeline(const char *filename);
~Pipeline() noexcept;
@@ -151,15 +150,15 @@ public:
std::shared_ptr<Device> getDevice();
/**
* \if English
* @brief Get playback object
* \if English
* @brief Get playback object
*
* @return std::shared_ptr<Playback> returns the playback object
* \else
* \else
* @brief 获取回放对象
*
* @return std::shared_ptr<Playback> 返回回放对象
* \endif
* \endif
*/
std::shared_ptr<Playback> getPlayback();
@@ -199,82 +198,85 @@ public:
void disableFrameSync();
/**
* \if English
* @brief Get camera parameters
* \if English
* @brief Get camera parameters
* @attention If D2C is enabled, it will return the camera parameters after D2C, if not, it will return to the default parameters
*
* @return OBCameraParam returns camera parameters
* \else
* \else
* @brief 获取相机参数
* @attention 如果开启了D2C将返回D2C后的相机参数,如果没有将返回默认参数
*
* @return OBCameraParam返回相机参数
* \endif
* \endif
*/
OBCameraParam getCameraParam();
/**
* \if English
* @brief Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolution
* \if English
* @brief Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolution
* @param colorProfile Input color sensor resolution
* @param alignMode Input align mode
*
* @return std::shared_ptr<StreamProfileList> returns a list of depth sensor resolutions
* \else
* \else
* @brief 返回与输入的彩色传感器分辨率对应的支持D2C的深度传感器分辨率列表
* @param colorProfile 输入的彩色传感器分辨率
* @param alignMode 输入的对齐模式
*
* @return std::shared_ptr<StreamProfileList> 返回深度传感器分辨率列表
* \endif
* \endif
*/
std::shared_ptr<StreamProfileList> getD2CDepthProfileList(std::shared_ptr<StreamProfile> colorProfile,OBAlignMode alignMode);
std::shared_ptr<StreamProfileList> getD2CDepthProfileList(std::shared_ptr<StreamProfile> colorProfile, OBAlignMode alignMode);
/**
* \if English
* @brief Valid area after getting D2C
* @brief Get valid area between minimum distance and maximum distance after D2C
*
* @param depthDistance working distance
* @param minimumDistance minimum working distance
* @param maximumDistance maximum working distance
* @return OBRect returns the area information valid after D2C at the working distance
* \else
* @brief 获取D2C后有效的区域
* @brief 获取D2C后给定工作范围的有效区域
* 如果需要获取指定距离D2C后的ROI区域,将minimum_distance与maximum_distance设置成一样或者将maximum_distance设置成0
*
* @param depthDistance 工作距离
* @param minimumDistance 最小工作距离
* @param maximumDistance 最大工作距离
* @return OBRect 返回在工作距离下D2C后有效的区域信息
* \endif
* \endif
*/
OBRect getD2CValidArea(uint32_t depthDistance);
OBRect getD2CValidArea(uint32_t minimumDistance,uint32_t maximumDistance = 0);
/**
* \if English
* @brief Dynamically switch the corresponding config configuration
* \if English
* @brief Dynamically switch the corresponding config configuration
*
* @param config Updated config configuration
* \else
* \else
* @brief 动态切换对应的config配置
*
* @param config 更新后的config配置
* \endif
* \endif
*/
void switchConfig(std::shared_ptr<Config> config);
/**
* \if English
* @brief start recording
* \if English
* @brief start recording
*
* @param filename Record file name
* \else
* \else
* @brief 开始录制
*
* @param filename 录制文件名
* \endif
* \endif
*/
void startRecord(const char *filename);
/**
* \if English
* @brief Stop recording
* \else
* \if English
* @brief Stop recording
* \else
* @brief 停止录制
* \endif
*/
@@ -331,18 +333,47 @@ public:
void disableAllStream();
/**
* \if English
* @brief Set the alignment mode
* \if English
* @brief Set the alignment mode
*
* @param mode Align State Mode
* \else
* \else
* @brief 设置对齐模式
*
* @param mode 对齐状态模式
* \endif
* \endif
*/
void setAlignMode(OBAlignMode mode);
/**
* \if English
* @brief Whether scale depth frame after D2C
*
* @param enable Scale or not
* \else
* @brief 设置D2C后是否需要缩放深度
*
* @param enable 是否需要缩放
* \endif
*/
void setDepthScaleRequire(bool enable);
/**
* \if English
* @brief
*
* @param d2cTargetWidth D2C target width
* @param d2cTargetHeight D2C target height
* \else
* @brief 设置D2C目标分辨率,适用于未使用OrbbecSDK开启Color流,且需要对深度进行D2C的情况
* 注意:当使用OrbbecSDK开启Color流时,同时使用了此接口设置了D2C目标分辨率时。优先使用开启的Color流的配置进行D2C。
*
* @param d2cTargetWidth D2C目标分辨率宽
* @param d2cTargetHeight D2C目标分辨率高
* \endif
*/
void setD2CTargetResolution(uint32_t d2cTargetWidth,uint32_t d2cTargetHeight);
friend class Pipeline;
};
@@ -29,9 +29,9 @@ private:
public:
/**
* \if English
* @brief Create a recorder for data recording
* \else
* \if English
* @brief Create a recorder for data recording
* \else
* @brief 创建录制器用于数据的录制
* \endif
*/
@@ -39,10 +39,10 @@ public:
Recorder(std::unique_ptr<RecorderImpl> impl);
/**
* \if English
* @brief Create a recorder for data recording
* \if English
* @brief Create a recorder for data recording
* @param device Devices that need to record device information
* \else
* \else
* @brief 创建录制器用于数据的录制
* @param device 需要录制设备信息的设备
* \endif
@@ -52,39 +52,39 @@ public:
virtual ~Recorder() noexcept;
/**
* \if English
* @brief Enable the recorder, throw an exception after failure
* \if English
* @brief Enable the recorder, throw an exception after failure
*
* @param filename Recorded file name
* @param async Whether to execute asynchronously
* \else
* \else
* @brief 开启录制器,失败后抛出异常
*
* @param filename 录制的文件名称
* @param async 是否异步执行
* \endif
* \endif
*/
void start(const char *filename, bool async = false);
/**
* \if English
* @brief Stop the recorder, throw an exception on failure
* \else
* \if English
* @brief Stop the recorder, throw an exception on failure
* \else
* @brief 停止录制器,失败后抛出异常
* \endif
*/
void stop();
/**
* \if English
* @brief Write frame data to the recorder
* \if English
* @brief Write frame data to the recorder
*
* @param frame Write frame data
* \else
* \else
* @brief 向录制器内写入帧数据
*
* @param frame 写入的帧数据
* \endif
* \endif
*/
void write(std::shared_ptr<Frame> frame);
};
@@ -95,76 +95,76 @@ private:
public:
/**
* \if English
* @brief Create playback object
* \if English
* @brief Create playback object
* @param filename Playback filename
* \else
* \else
* @brief 创建回放对象
* @param filename 回放的文件名
* \endif
* \endif
*/
Playback(const char *filename);
Playback(std::unique_ptr<PlaybackImpl> impl);
virtual ~Playback() noexcept;
/**
* \if English
* @brief Start playback, the playback data is returned from the callback, and an exception is thrown after failure
* \if English
* @brief Start playback, the playback data is returned from the callback, and an exception is thrown after failure
* @param filename Playback filename
* @param callback Callback for playback data
* @param type Type of playback data
* \else
* \else
* @brief 开启回放,回放数据从回调中返回,失败后抛出异常
* @param filename 回放的文件名
* @param callback 回放数据的回调
* @param type 回放数据的类型
* \endif
* \endif
*/
void start(PlaybackCallback callback, OBMediaType type = OB_MEDIA_ALL);
/**
* \if English
* @brief Stop playback and throw an exception if it fails
* \else
* \if English
* @brief Stop playback and throw an exception if it fails
* \else
* @brief 停止回放,失败后抛出异常
* \endif
*/
void stop();
/**
* \if English
* @brief Set playback state
* \if English
* @brief Set playback state
* @param state playback status callback
* \else
* \else
* @brief 设置回放状态
* @param state 回放状态回调
* \endif
* \endif
*/
void setPlaybackStateCallback(MediaStateCallback state);
/**
* \if English
* @brief Get the device information in the recording file
* \if English
* @brief Get the device information in the recording file
*
* @return DeviceInfo returns device information
* \else
* \else
* @brief 获取录制文件内的设备信息
*
* @return DeviceInfo 返回的设备信息
* \endif
* \endif
*/
std::shared_ptr<DeviceInfo> getDeviceInfo();
/**
* \if English
* @brief Get the intrinsic and extrinsic parameter information in the recording file
* \if English
* @brief Get the intrinsic and extrinsic parameter information in the recording file
*
* @return OBCameraParam returns internal and external parameter information
* \else
* \else
* @brief 获取录制文件内的内外参信息
*
* @return OBCameraParam 返回的内外参信息
* \endif
* \endif
*/
OBCameraParam getCameraParam();
};
@@ -95,15 +95,15 @@ public:
void stop();
/**
* \if English
* @brief Dynamically switch resolutions
* \if English
* @brief Dynamically switch resolutions
*
* @param streamProfile Resolution to switch
* \else
* \else
* @brief 动态切换分辨率
*
* @param streamProfile 需要切换的分辨率
* \endif
* \endif
*/
void switchProfile(std::shared_ptr<StreamProfile> streamProfile);
};
@@ -258,15 +258,16 @@ public:
const std::shared_ptr<StreamProfile> getProfile(uint32_t index);
/**
* \if English
* @brief Match the corresponding streamprofile through the passed in parameters. If there are multiple matches, the first one in the list will be returned by default.
* \if English
* @brief Match the corresponding streamprofile through the passed in parameters. If there are multiple matches, the first one in the list will be returned
* by default.
*
* @param width Width. If no matching condition is required, it can be passed to 0
* @param height Height. If no matching condition is required, it can be passed to 0
* @param format Type. If no matching condition is required, it can be passed to OB_FORMAT_UNKNOWN
* @param fps Frame rate. If no matching condition is required, it can be passed to 0
* @return std::shared_ptr<StreamProfile> Returns the matching resolution
* \else
* \else
* @brief 通过传入的参数进行匹配对应的StreamProfile,若有多个匹配项默认返回列表中的第一个
*
* @param width 宽度,如不要求加入匹配条件,可传0
@@ -274,7 +275,7 @@ public:
* @param format 类型,如不要求加入匹配条件,可传OB_FORMAT_UNKNOWN
* @param fps 帧率,如不要求加入匹配条件,可传0
* @return std::shared_ptr<StreamProfile> 返回匹配的分辨率
* \endif
* \endif
*/
const std::shared_ptr<VideoStreamProfile> getVideoStreamProfile(int width = 0, int height = 0, OBFormat format = OB_FORMAT_UNKNOWN, int fps = 0);
};
@@ -1,4 +1,4 @@
/**
/**
* \if English
* \file Types.hpp
* \brief Provide SDK structure and enumeration constant definition (depending on libobsensor/h/ObTypes.h)
@@ -24,7 +24,7 @@ public:
* \endif
*/
static int getMajor();
/**
/**
* \if English
* @brief Get the SDK minor version number
*