Update SDK version to v2.4.7

This commit is contained in:
jj
2025-06-30 17:02:12 +08:00
parent 794e05b997
commit 9414eb6486
24 changed files with 210 additions and 39 deletions
@@ -30,6 +30,7 @@ class DevicePresetList;
class OBDepthWorkModeList;
class CameraParamList;
class DeviceFrameInterleaveList;
class PresetResolutionConfigeList;
class Device {
public:
@@ -822,6 +823,18 @@ public:
return std::make_shared<DeviceFrameInterleaveList>(list);
}
/**
* @brief Get available frame interleave list
*
* @return DeviceFrameInterleaveList return the available frame interleave list.
*/
std::shared_ptr<PresetResolutionConfigeList> getAvailablePresetResolutionConfigeList() const {
ob_error *error = nullptr;
auto list = ob_device_get_available_preset_resolution_config_list(impl_, &error);
Error::handle(&error);
return std::make_shared<PresetResolutionConfigeList>(list);
}
private:
static void firmwareUpdateCallback(ob_fw_update_state state, const char *message, uint8_t percent, void *userData) {
auto device = static_cast<Device *>(userData);
@@ -1502,4 +1515,42 @@ public:
}
};
/**
* @brief Class representing a list of device Frame Interleave
*/
class PresetResolutionConfigeList {
private:
ob_preset_resolution_config_list_t *impl_ = nullptr;
public:
explicit PresetResolutionConfigeList(ob_preset_resolution_config_list_t *impl) : impl_(impl) {}
~PresetResolutionConfigeList() noexcept {
ob_error *error = nullptr;
ob_delete_preset_resolution_config_list(impl_, &error);
Error::handle(&error, false);
}
/**
* @brief Get the number of device preset resolution ratio in the list
*/
uint32_t getCount() {
ob_error *error = nullptr;
auto count = ob_device_preset_resolution_config_get_count(impl_, &error);
Error::handle(&error);
return count;
}
/*
* @brief Get the device preset resolution ratio at the specified index
* @param index the index of the device preset resolution ratio
* @return OBPresetResolutionConfig the corresponding device preset resolution ratio
*/
OBPresetResolutionConfig getPresetResolutionRatioConfig(uint32_t index) {
ob_error *error = nullptr;
auto config = ob_device_preset_resolution_config_list_get_item(impl_, index, &error);
Error::handle(&error);
return config;
}
};
} // namespace ob
@@ -347,7 +347,7 @@ public:
init(impl);
}
virtual ~PointCloudFilter() noexcept = default;
virtual ~PointCloudFilter() noexcept override = default;
/**
* @brief Set the output pointcloud frame format.
@@ -421,7 +421,7 @@ public:
setConfigValue("AlignType", static_cast<double>(alignToStreamType));
}
virtual ~Align() noexcept = default;
virtual ~Align() noexcept override = default;
OBStreamType getAlignToStreamType() {
return static_cast<OBStreamType>(static_cast<int>(getConfigValue("AlignType")));
@@ -466,7 +466,7 @@ public:
init(impl);
}
virtual ~FormatConvertFilter() noexcept = default;
virtual ~FormatConvertFilter() noexcept override = default;
/**
* @brief Set the format conversion type.
@@ -492,7 +492,7 @@ public:
init(impl);
}
virtual ~HdrMerge() noexcept = default;
virtual ~HdrMerge() noexcept override = default;
};
/**
@@ -524,7 +524,7 @@ public:
initSequenceIdList();
}
virtual ~SequenceIdFilter() noexcept {
virtual ~SequenceIdFilter() noexcept override {
if(outputSequenceIdList_) {
delete[] outputSequenceIdList_;
outputSequenceIdList_ = nullptr;
@@ -575,7 +575,7 @@ public:
init(impl);
}
virtual ~DecimationFilter() noexcept = default;
virtual ~DecimationFilter() noexcept override = default;
/**
* @brief Set the decimation filter scale value.
@@ -619,7 +619,7 @@ public:
init(impl);
}
virtual ~ThresholdFilter() noexcept = default;
virtual ~ThresholdFilter() noexcept override = default;
/**
* @brief Get the threshold filter min range.
@@ -682,7 +682,7 @@ public:
init(impl);
}
virtual ~SpatialAdvancedFilter() noexcept = default;
virtual ~SpatialAdvancedFilter() noexcept override = default;
/**
* @brief Get the spatial advanced filter alpha range.
@@ -791,7 +791,7 @@ public:
init(impl);
}
~HoleFillingFilter() noexcept = default;
~HoleFillingFilter() noexcept override = default;
/**
* @brief Set the HoleFillingFilter mode.
@@ -824,7 +824,7 @@ public:
init(impl);
}
~NoiseRemovalFilter() noexcept = default;
~NoiseRemovalFilter() noexcept override = default;
/**
* @brief Set the noise removal filter params.
@@ -895,7 +895,7 @@ public:
init(impl);
}
~TemporalFilter() noexcept = default;
~TemporalFilter() noexcept override = default;
/**
* @brief Get the TemporalFilter diffscale range.
@@ -962,7 +962,7 @@ public:
init(impl);
}
~DisparityTransform() noexcept = default;
~DisparityTransform() noexcept override = default;
};
class OBFilterList {
@@ -553,6 +553,28 @@ public:
~IRFrame() noexcept override = default;
};
/**
* @brief Define the ConfidenceFrame class, which inherits from the VideoFrame class
*
*/
class ConfidenceFrame : public VideoFrame {
public:
/**
* @brief Construct a new ConfidenceFrame object with a given pointer to the internal frame object.
*
* @attention After calling this constructor, the frame object will own the internal frame object, and the internal frame object will be deleted when the
* frame object is destroyed.
* @attention The internal frame object should not be deleted by the caller.
* @attention Please use the FrameFactory to create a Frame object.
*
* @param impl The pointer to the internal frame object.
*/
explicit ConfidenceFrame(const ob_frame *impl) : VideoFrame(impl){};
~ConfidenceFrame() noexcept override = default;
};
/**
* @brief Define the PointsFrame class, which inherits from the Frame class
* @brief The PointsFrame class is used to obtain pointcloud data and point cloud information.
@@ -1036,6 +1058,8 @@ template <typename T> bool Frame::is() const {
return (typeid(T) == typeid(DepthFrame) || typeid(T) == typeid(VideoFrame));
case OB_FRAME_COLOR:
return (typeid(T) == typeid(ColorFrame) || typeid(T) == typeid(VideoFrame));
case OB_FRAME_CONFIDENCE:
return (typeid(T) == typeid(ConfidenceFrame) || typeid(T) == typeid(VideoFrame));
case OB_FRAME_GYRO:
return (typeid(T) == typeid(GyroFrame));
case OB_FRAME_ACCEL:
@@ -20,7 +20,7 @@ typedef std::function<void(OBPlaybackStatus status)> PlaybackStatusChangeCallbac
class RecordDevice {
private:
ob_record_device_t *impl_;
ob_record_device_t *impl_ = nullptr;
public:
explicit RecordDevice(std::shared_ptr<Device> device, const std::string &file, bool compressionEnabled = true) {
@@ -35,14 +35,14 @@ public:
Error::handle(&error, false);
}
RecordDevice(RecordDevice &&other) {
RecordDevice(RecordDevice &&other) noexcept {
if(this != &other) {
impl_ = other.impl_;
other.impl_ = nullptr;
}
}
RecordDevice &operator=(RecordDevice &&other) {
RecordDevice &operator=(RecordDevice &&other) noexcept {
if(this != &other) {
impl_ = other.impl_;
other.impl_ = nullptr;
@@ -76,11 +76,11 @@ public:
Error::handle(&error);
}
virtual ~PlaybackDevice() noexcept = default;
virtual ~PlaybackDevice() noexcept override = default;
PlaybackDevice(PlaybackDevice &&other) : Device(std::move(other)) {}
PlaybackDevice(PlaybackDevice &&other) noexcept : Device(std::move(other)) {}
PlaybackDevice &operator=(PlaybackDevice &&other) {
PlaybackDevice &operator=(PlaybackDevice &&other) noexcept {
Device::operator=(std::move(other));
return *this;
}
@@ -387,6 +387,7 @@ template <typename T> bool StreamProfile::is() const {
case OB_STREAM_COLOR:
case OB_STREAM_DEPTH:
case OB_STREAM_RAW_PHASE:
case OB_STREAM_CONFIDENCE:
return typeid(T) == typeid(VideoStreamProfile);
case OB_STREAM_ACCEL:
return typeid(T) == typeid(AccelStreamProfile);
@@ -411,6 +412,7 @@ public:
case OB_STREAM_DEPTH:
case OB_STREAM_COLOR:
case OB_STREAM_VIDEO:
case OB_STREAM_CONFIDENCE:
return std::make_shared<VideoStreamProfile>(impl);
case OB_STREAM_ACCEL:
return std::make_shared<AccelStreamProfile>(impl);
@@ -112,6 +112,7 @@ public:
* OB_SENSOR_IR,
* OB_SENSOR_IR_LEFT,
* OB_SENSOR_IR_RIGHT,
* OB_SENSOR_CONFIDENCE,
*
* @param type The sensor type
* @return true
@@ -131,6 +132,7 @@ public:
* OB_STREAM_IR,
* OB_STREAM_IR_LEFT,
* OB_STREAM_IR_RIGHT,
* OB_STREAM_CONFIDENCE,
*
* @param type The stream type to check.
* @return true if the given stream type is a video stream, false otherwise.