42 explicit Config(ob_config_t *impl) : impl_(impl) {}
84 void enableStream(std::shared_ptr<const StreamProfile> streamProfile)
const {
86 auto c_stream_profile = streamProfile->getImpl();
210 return std::make_shared<StreamProfileList>(list);
259 ob_pipeline_t *impl_;
279 explicit Pipeline(std::shared_ptr<Device> device) {
299 void start(std::shared_ptr<Config> config =
nullptr)
const {
301 ob_config_t *config_impl = config ==
nullptr ? nullptr : config->getImpl();
313 callback_ = callback;
320 auto pipeline =
static_cast<Pipeline *
>(userData);
321 pipeline->callback_(std::make_shared<FrameSet>(frameSet));
343 return std::make_shared<Config>(config);
355 if(frameSet ==
nullptr) {
359 return std::make_shared<FrameSet>(frameSet);
371 return std::make_shared<Device>(device);
384 return std::make_shared<StreamProfileList>(list);
401 return std::make_shared<StreamProfileList>(list);
443 return calibrationParam;
Device related types, including operations such as getting and creating a device, setting and obtaini...
Frame related type, which is mainly used to obtain frame data and frame information.
#define OB_ACCEL_FULL_SCALE_RANGE_ANY
OBSensorType
Enumeration value describing the sensor type.
OBGyroFullScaleRange
Enumeration of gyroscope ranges.
#define OB_ACCEL_SAMPLE_RATE_ANY
OBFormat
Enumeration value describing the pixel format.
#define OB_GYRO_FULL_SCALE_RANGE_ANY
OBStreamType
Enumeration value describing the type of data stream.
enum OBIMUSampleRate OBGyroSampleRate
#define OB_GYRO_SAMPLE_RATE_ANY
OBAccelFullScaleRange
Enumeration of accelerometer ranges.
enum OBIMUSampleRate OBAccelSampleRate
enum OB_FRAME_AGGREGATE_OUTPUT_MODE OBFrameAggregateOutputMode
OBAlignMode
Alignment mode.
The SDK's advanced API can quickly implement functions such as switching streaming,...
OB_EXPORT ob_pipeline * ob_create_pipeline_with_device(const ob_device *dev, ob_error **error)
Using device objects to create pipeline objects.
OB_EXPORT ob_pipeline * ob_create_pipeline(ob_error **error)
Create a pipeline object.
OB_EXPORT void ob_pipeline_enable_frame_sync(ob_pipeline *pipeline, ob_error **error)
Enable frame synchronization.
OB_EXPORT void ob_config_set_frame_aggregate_output_mode(ob_config *config, ob_frame_aggregate_output_mode mode, ob_error **error)
Set the frame aggregation output mode for the pipeline configuration.
OB_EXPORT void ob_config_enable_stream(ob_config *config, ob_stream_type stream_type, ob_error **error)
Enable a stream with default profile.
OB_EXPORT ob_camera_param ob_pipeline_get_camera_param_with_profile(ob_pipeline *pipeline, uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth, uint32_t depthHeight, ob_error **error)
Get the current camera parameters.
OB_EXPORT void ob_delete_config(ob_config *config, ob_error **error)
Delete the pipeline configuration.
OB_EXPORT void ob_config_enable_video_stream(ob_config *config, ob_stream_type stream_type, uint32_t width, uint32_t height, uint32_t fps, ob_format format, ob_error **error)
Enable video stream with specified parameters.
OB_EXPORT ob_config * ob_create_config(ob_error **error)
Create the pipeline configuration.
OB_EXPORT void ob_config_disable_stream(ob_config *config, ob_stream_type type, ob_error **error)
Disable a specific stream in the pipeline configuration.
OB_EXPORT void ob_delete_pipeline(ob_pipeline *pipeline, ob_error **error)
Delete pipeline objects.
OB_EXPORT ob_device * ob_pipeline_get_device(const ob_pipeline *pipeline, ob_error **error)
Get the device object associated with the pipeline.
OB_EXPORT ob_stream_profile_list * ob_get_d2c_depth_profile_list(const ob_pipeline *pipeline, const ob_stream_profile *color_profile, ob_align_mode align_mode, ob_error **error)
Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolut...
OB_EXPORT void ob_config_set_align_mode(ob_config *config, ob_align_mode mode, ob_error **error)
Set the alignment mode for the pipeline configuration.
OB_EXPORT ob_frame * ob_pipeline_wait_for_frameset(ob_pipeline *pipeline, uint32_t timeout_ms, ob_error **error)
Wait for a set of frames to be returned synchronously.
OB_EXPORT ob_stream_profile_list * ob_pipeline_get_stream_profile_list(const ob_pipeline *pipeline, ob_sensor_type sensorType, ob_error **error)
Get the stream profile list associated with the pipeline.
OB_EXPORT ob_config * ob_pipeline_get_config(const ob_pipeline *pipeline, ob_error **error)
Get the configuration object associated with the pipeline.
OB_EXPORT void ob_config_enable_accel_stream(ob_config *config, ob_accel_full_scale_range full_scale_range, ob_accel_sample_rate sample_rate, ob_error **error)
Enable accelerometer stream with specified parameters.
OB_EXPORT void ob_pipeline_stop(ob_pipeline *pipeline, ob_error **error)
Stop pipeline.
OB_EXPORT void ob_config_enable_all_stream(ob_config *config, ob_error **error)
Enable all streams in the pipeline configuration.
OB_EXPORT void ob_config_enable_stream_with_stream_profile(ob_config *config, const ob_stream_profile *profile, ob_error **error)
Enable a stream according to the stream profile.
OB_EXPORT void ob_pipeline_start_with_callback(ob_pipeline *pipeline, const ob_config *config, ob_frameset_callback callback, void *user_data, ob_error **error)
Start the pipeline and set the frame collection data callback.
OB_EXPORT void ob_config_disable_all_stream(ob_config *config, ob_error **error)
Disable all streams in the pipeline configuration.
OB_EXPORT ob_stream_profile_list * ob_config_get_enabled_stream_profile_list(const ob_config *config, ob_error **error)
Get the enabled stream profile list in the pipeline configuration.
OB_EXPORT void ob_config_set_depth_scale_after_align_require(ob_config *config, bool enable, ob_error **error)
Set whether depth scaling is required after enable depth to color alignment.
OB_EXPORT void ob_pipeline_disable_frame_sync(ob_pipeline *pipeline, ob_error **error)
Disable frame synchronization.
OB_EXPORT ob_camera_param ob_pipeline_get_camera_param(ob_pipeline *pipeline, ob_error **error)
Get current camera parameters.
OB_EXPORT void ob_pipeline_start_with_config(ob_pipeline *pipeline, const ob_config *config, ob_error **error)
Start the pipeline with configuration parameters.
OB_EXPORT void ob_config_enable_gyro_stream(ob_config *config, ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error)
Enable gyroscope stream with specified parameters.
OB_EXPORT ob_calibration_param ob_pipeline_get_calibration_param(ob_pipeline *pipeline, ob_config *config, ob_error **error)
Get device calibration parameters with the specified configuration.
The stream profile related type is used to get information such as the width, height,...
void setDepthScaleRequire(bool enable) const
Set whether the depth needs to be scaled after setting D2C.
ob_config_t * getImpl() const
void disableStream(OBStreamType streamType) const
Disable a stream to be used in the pipeline.
~Config() noexcept
Destroy the Config object.
void enableStream(OBSensorType sensorType) const
Enable a stream with a specific sensor type.
void enableVideoStream(OBSensorType sensorType, uint32_t width=OB_WIDTH_ANY, uint32_t height=OB_HEIGHT_ANY, uint32_t fps=OB_FPS_ANY, OBFormat format=OB_FORMAT_ANY) const
Enable a video stream to be used in the pipeline.
void disableAllStream() const
Disable all streams to be used in the pipeline.
std::shared_ptr< StreamProfileList > getEnabledStreamProfileList() const
Get the Enabled Stream Profile List.
void disableStream(OBSensorType sensorType) const
Disable a sensor stream to be used in the pipeline.
void enableStream(OBStreamType streamType) const
enable a stream with a specific stream type
void setAlignMode(OBAlignMode mode) const
Set the alignment mode.
Config(ob_config_t *impl)
Config()
Construct a new Config object.
void enableStream(std::shared_ptr< const StreamProfile > streamProfile) const
Enable a stream to be used in the pipeline.
void enableGyroStream(OBGyroFullScaleRange fullScaleRange=OB_GYRO_FULL_SCALE_RANGE_ANY, OBGyroSampleRate sampleRate=OB_GYRO_SAMPLE_RATE_ANY) const
Enable a gyroscope stream to be used in the pipeline.
void enableAccelStream(OBAccelFullScaleRange fullScaleRange=OB_ACCEL_FULL_SCALE_RANGE_ANY, OBAccelSampleRate sampleRate=OB_ACCEL_SAMPLE_RATE_ANY) const
Enable an accelerometer stream to be used in the pipeline.
void enableVideoStream(OBStreamType streamType, uint32_t width=OB_WIDTH_ANY, uint32_t height=OB_HEIGHT_ANY, uint32_t fps=OB_FPS_ANY, OBFormat format=OB_FORMAT_ANY) const
Enable a video stream to be used in the pipeline.
void enableAllStream()
Enable all streams to be used in the pipeline.
void setFrameAggregateOutputMode(OBFrameAggregateOutputMode mode) const
Set the frame aggregation output mode for the pipeline configuration.
static void handle(ob_error **error, bool throw_exception=true)
A static function to handle the ob_error and throw an exception if needed.
OBCalibrationParam getCalibrationParam(std::shared_ptr< Config > config)
std::shared_ptr< Config > getConfig() const
Get the pipeline configuration parameters.
void enableFrameSync() const
Turn on frame synchronization.
~Pipeline() noexcept
Destroy the pipeline object.
Pipeline()
Pipeline is a high-level interface for applications, algorithms related RGBD data streams....
std::shared_ptr< StreamProfileList > getStreamProfileList(OBSensorType sensorType) const
Get the stream profile of the specified sensor.
void start(std::shared_ptr< Config > config, FrameSetCallback callback)
Start the pipeline and set the frameset data callback.
OBCameraParam getCameraParamWithProfile(uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth, uint32_t depthHeight)
void start(std::shared_ptr< Config > config=nullptr) const
Start the pipeline with configuration parameters.
void stop() const
Stop the pipeline.
static void frameSetCallback(ob_frame_t *frameSet, void *userData)
std::shared_ptr< FrameSet > waitForFrames(uint32_t timeoutMs=1000) const
Pipeline(std::shared_ptr< Device > device)
Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices ne...
std::shared_ptr< FrameSet > waitForFrameset(uint32_t timeoutMs=1000) const
Wait for frameset.
std::function< void(std::shared_ptr< FrameSet > frame)> FrameSetCallback
FrameSetCallback is a callback function type for frameset data arrival.
std::shared_ptr< StreamProfileList > getD2CDepthProfileList(std::shared_ptr< StreamProfile > colorProfile, OBAlignMode alignMode)
Get the stream profile list of supported depth-to-color alignments.
OBCameraParam getCameraParam()
void disableFrameSync() const
Turn off frame synchronization.
std::shared_ptr< Device > getDevice() const
Get the device object.
static OBStreamType convertSensorTypeToStreamType(OBSensorType type)
Convert OBSensorType to OBStreamType type and then return.
Structure for camera parameters.
The error class exposed by the SDK, users can get detailed error information according to the error.