OrbbecSDK 1.10.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
Functions
Pipeline.h File Reference

The SDK's advanced API can quickly implement functions such as switching streaming, frame synchronization, software filtering, etc., suitable for applications, and the algorithm focuses on rgbd data stream scenarios. If you are on real-time or need to handle synchronization separately, align the scene. Please use the interface of Device's Lower API. More...

#include "ObTypes.h"

Go to the source code of this file.

Functions

ob_pipelineob_create_pipeline (ob_error **error)
 Create a pipeline object.
 
ob_pipelineob_create_pipeline_with_device (ob_device *dev, ob_error **error)
 Using device objects to create pipeline objects.
 
ob_pipelineob_create_pipeline_with_playback_file (const char *file_name, ob_error **error)
 Use the playback file to create a pipeline object.
 
void ob_delete_pipeline (ob_pipeline *pipeline, ob_error **error)
 Delete pipeline objects.
 
void ob_pipeline_start (ob_pipeline *pipeline, ob_error **error)
 Start the pipeline with default parameters.
 
void ob_pipeline_start_with_config (ob_pipeline *pipeline, ob_config *config, ob_error **error)
 Start the pipeline with configuration parameters.
 
void ob_pipeline_start_with_callback (ob_pipeline *pipeline, ob_config *config, ob_frameset_callback callback, void *user_data, ob_error **error)
 Start the pipeline and set the frame collection data callback.
 
void ob_pipeline_stop (ob_pipeline *pipeline, ob_error **error)
 Stop pipeline.
 
ob_configob_pipeline_get_config (ob_pipeline *pipeline, ob_error **error)
 Get the configuration object associated with the pipeline.
 
ob_frameob_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_deviceob_pipeline_get_device (ob_pipeline *pipeline, ob_error **error)
 Get the device object associated with the pipeline.
 
ob_playbackob_pipeline_get_playback (ob_pipeline *pipeline, ob_error **error)
 Get the playback object associated with the pipeline.
 
ob_stream_profile_listob_pipeline_get_stream_profile_list (ob_pipeline *pipeline, ob_sensor_type sensorType, ob_error **error)
 Get the stream profile list associated with the pipeline.
 
void ob_pipeline_enable_frame_sync (ob_pipeline *pipeline, ob_error **error)
 Enable frame synchronization.
 
void ob_pipeline_disable_frame_sync (ob_pipeline *pipeline, ob_error **error)
 Disable frame synchronization.
 
void ob_pipeline_switch_config (ob_pipeline *pipeline, ob_config *config, ob_error **error)
 Dynamically switch the corresponding configuration.
 
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_camera_param ob_pipeline_get_camera_param (ob_pipeline *pipeline, ob_error **error)
 Get current camera parameters.
 
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.
 
ob_stream_profile_listob_get_d2c_depth_profile_list (ob_pipeline *pipeline, 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 resolution.
 
ob_rect ob_get_d2c_valid_area (ob_pipeline *pipeline, uint32_t distance, ob_error **error)
 Get the valid area after D2C (DEPRECATED)
 
ob_rect ob_get_d2c_range_valid_area (ob_pipeline *pipeline, uint32_t minimum_distance, uint32_t maximum_distance, ob_error **error)
 Get the valid area between the minimum distance and maximum distance after D2C.
 
void ob_pipeline_start_record (ob_pipeline *pipeline, const char *file_name, ob_error **error)
 Start recording.
 
void ob_pipeline_stop_record (ob_pipeline *pipeline, ob_error **error)
 Stop recording.
 
ob_configob_create_config (ob_error **error)
 Create the pipeline configuration.
 
void ob_delete_config (ob_config *config, ob_error **error)
 Delete the pipeline configuration.
 
void ob_config_enable_stream (ob_config *config, ob_stream_profile *profile, ob_error **error)
 Enable the specified stream in the pipeline configuration.
 
void ob_config_enable_video_stream (ob_config *config, ob_stream_type type, int width, int height, int fps, ob_format format, ob_error **error)
 Enable a video stream to be used in the configuration.
 
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 an accelerometer stream to be used in the configuration.
 
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 a gyroscope stream to be used in the configuration.
 
void ob_config_enable_all_stream (ob_config *config, ob_error **error)
 Enable all streams in the pipeline configuration.
 
ob_stream_profile_listob_config_get_enabled_stream_profile_list (ob_config *config, ob_error **error)
 Get the enabled stream profile list in the pipeline configuration.
 
void ob_config_disable_stream (ob_config *config, ob_stream_type type, ob_error **error)
 Disable a specific stream in the pipeline configuration.
 
void ob_config_disable_all_stream (ob_config *config, ob_error **error)
 Disable all streams in the pipeline configuration.
 
void ob_config_set_align_mode (ob_config *config, ob_align_mode mode, ob_error **error)
 Set the alignment mode for the pipeline configuration.
 
void ob_config_set_depth_scale_require (ob_config *config, bool enable, ob_error **error)
 Set whether depth scaling is required after setting D2C.
 
void ob_config_set_d2c_target_resolution (ob_config *config, uint32_t d2c_target_width, uint32_t d2c_target_height, ob_error **error)
 Set the target resolution for D2C, which is applicable when the color stream is not enabled using the OrbbecSDK and the depth needs to be D2C Note: When using the OrbbecSDK to enable the color stream, this interface should also be used to set the D2C target resolution. The configuration of the enabled color stream is preferred for D2C.
 
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.
 

Detailed Description

The SDK's advanced API can quickly implement functions such as switching streaming, frame synchronization, software filtering, etc., suitable for applications, and the algorithm focuses on rgbd data stream scenarios. If you are on real-time or need to handle synchronization separately, align the scene. Please use the interface of Device's Lower API.

Definition in file Pipeline.h.

Function Documentation

◆ ob_create_pipeline()

ob_pipeline * ob_create_pipeline ( ob_error **  error)

Create a pipeline object.

Parameters
[out]errorLog error messages
Returns
ob_pipeline* return the pipeline object

◆ ob_create_pipeline_with_device()

ob_pipeline * ob_create_pipeline_with_device ( ob_device dev,
ob_error **  error 
)

Using device objects to create pipeline objects.

Parameters
[in]devDevice object used to create pipeline
[out]errorLog error messages
Returns
ob_pipeline* return the pipeline object

◆ ob_create_pipeline_with_playback_file()

ob_pipeline * ob_create_pipeline_with_playback_file ( const char *  file_name,
ob_error **  error 
)

Use the playback file to create a pipeline object.

Parameters
[in]file_nameThe playback file path used to create the pipeline
[out]errorLog error messages
Returns
ob_pipeline* return the pipeline object

◆ ob_delete_pipeline()

void ob_delete_pipeline ( ob_pipeline pipeline,
ob_error **  error 
)

Delete pipeline objects.

Parameters
[in]pipelineThe pipeline object to be deleted
[out]errorLog error messages

◆ ob_pipeline_start()

void ob_pipeline_start ( ob_pipeline pipeline,
ob_error **  error 
)

Start the pipeline with default parameters.

Parameters
[in]pipelinepipeline object
[out]errorLog error messages

◆ ob_pipeline_start_with_config()

void ob_pipeline_start_with_config ( ob_pipeline pipeline,
ob_config config,
ob_error **  error 
)

Start the pipeline with configuration parameters.

Parameters
[in]pipelinepipeline object
[in]configParameters to be configured
[out]errorLog error messages

◆ ob_pipeline_start_with_callback()

void ob_pipeline_start_with_callback ( ob_pipeline pipeline,
ob_config config,
ob_frameset_callback  callback,
void *  user_data,
ob_error **  error 
)

Start the pipeline and set the frame collection data callback.

Parameters
[in]pipelinepipeline object
[in]configParameters to be configured
[in]callbackTrigger a callback when all frame data in the frameset arrives
[in]user_dataPass in any user data and get it from the callback
[out]errorLog error messages

◆ ob_pipeline_stop()

void ob_pipeline_stop ( ob_pipeline pipeline,
ob_error **  error 
)

Stop pipeline.

Parameters
[in]pipelinepipeline object
[out]errorLog error messages

◆ ob_pipeline_get_config()

ob_config * ob_pipeline_get_config ( ob_pipeline pipeline,
ob_error **  error 
)

Get the configuration object associated with the pipeline.

Returns default configuration if the user has not configured

Parameters
[in]pipelineThe pipeline object
[out]errorLog error messages
Returns
ob_config* The configuration object

◆ ob_pipeline_wait_for_frameset()

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.

Parameters
[in]pipelineThe pipeline object
[in]timeout_msThe timeout for waiting (in milliseconds)
[out]errorLog error messages
Returns
ob_frame* The frameset that was waited for. A frameset is a special frame that can be used to obtain independent frames from the set.

◆ ob_pipeline_get_device()

ob_device * ob_pipeline_get_device ( ob_pipeline pipeline,
ob_error **  error 
)

Get the device object associated with the pipeline.

Parameters
[in]pipelineThe pipeline object
[out]errorLog error messages
Returns
ob_device* The device object

◆ ob_pipeline_get_playback()

ob_playback * ob_pipeline_get_playback ( ob_pipeline pipeline,
ob_error **  error 
)

Get the playback object associated with the pipeline.

Parameters
[in]pipelineThe pipeline object
[out]errorLog error messages
Returns
ob_playback* The playback object

◆ ob_pipeline_get_stream_profile_list()

ob_stream_profile_list * ob_pipeline_get_stream_profile_list ( ob_pipeline pipeline,
ob_sensor_type  sensorType,
ob_error **  error 
)

Get the stream profile list associated with the pipeline.

Parameters
[in]pipelineThe pipeline object
[in]sensorTypeThe sensor type. The supported sensor types can be obtained through the ob_device_get_sensor_list() interface.
[out]errorLog error messages
Returns
ob_stream_profile_list* The stream profile list

◆ ob_pipeline_enable_frame_sync()

void ob_pipeline_enable_frame_sync ( ob_pipeline pipeline,
ob_error **  error 
)

Enable frame synchronization.

Parameters
[in]pipelineThe pipeline object
[out]errorLog error messages

◆ ob_pipeline_disable_frame_sync()

void ob_pipeline_disable_frame_sync ( ob_pipeline pipeline,
ob_error **  error 
)

Disable frame synchronization.

Parameters
[in]pipelineThe pipeline object
[out]errorLog error messages

◆ ob_pipeline_switch_config()

void ob_pipeline_switch_config ( ob_pipeline pipeline,
ob_config config,
ob_error **  error 
)

Dynamically switch the corresponding configuration.

Parameters
[in]pipelineThe pipeline object
[in]configThe pipeline configuration
[out]errorLog error messages

◆ ob_pipeline_get_camera_param_with_profile()

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.

Parameters
[in]pipelinepipeline object
[in]colorWidthcolor width
[in]colorHeightcolor height
[in]depthWidthdepth width
[in]depthHeightdepth height
[out]errorLog error messages
Returns
ob_camera_param returns camera internal parameters

◆ ob_pipeline_get_camera_param()

ob_camera_param ob_pipeline_get_camera_param ( ob_pipeline pipeline,
ob_error **  error 
)

Get current camera parameters.

Attention
If D2C is enabled, it will return the camera parameters after D2C, if not, it will return to the default parameters
Parameters
[in]pipelinepipeline object
[out]errorLog error messages
Returns
ob_camera_param The camera internal parameters

◆ ob_pipeline_get_calibration_param()

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.

Parameters
[in]pipelinepipeline object
[in]configThe pipeline configuration
[out]errorLog error messages
Returns
ob_calibration_param The calibration parameters

◆ ob_get_d2c_depth_profile_list()

ob_stream_profile_list * ob_get_d2c_depth_profile_list ( ob_pipeline pipeline,
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 resolution.

Parameters
[in]pipelineThe pipeline object
[in]color_profileThe input profile of the color sensor
[in]align_modeThe input align mode
[out]errorLog error messages
Returns
ob_stream_profile_list* The list of D2C-enabled depth sensor resolutions

◆ ob_get_d2c_valid_area()

ob_rect ob_get_d2c_valid_area ( ob_pipeline pipeline,
uint32_t  distance,
ob_error **  error 
)

Get the valid area after D2C (DEPRECATED)

Parameters
[in]pipelineThe pipeline object
[in]distanceThe working distance
[out]errorLog error messages
Returns
ob_rect The area information that is valid after D2C at the working distance

◆ ob_get_d2c_range_valid_area()

ob_rect ob_get_d2c_range_valid_area ( ob_pipeline pipeline,
uint32_t  minimum_distance,
uint32_t  maximum_distance,
ob_error **  error 
)

Get the valid area between the minimum distance and maximum distance after D2C.

Parameters
[in]pipelineThe pipeline object
[in]minimum_distanceThe minimum working distance
[in]maximum_distanceThe maximum working distance
[out]errorLog error messages
Returns
ob_rect The area information that is valid after D2C at the working distance

◆ ob_pipeline_start_record()

void ob_pipeline_start_record ( ob_pipeline pipeline,
const char *  file_name,
ob_error **  error 
)

Start recording.

Parameters
[in]pipelineThe pipeline object
[in]file_nameThe recorded file path
[out]errorLog error messages

◆ ob_pipeline_stop_record()

void ob_pipeline_stop_record ( ob_pipeline pipeline,
ob_error **  error 
)

Stop recording.

Parameters
[in]pipelineThe pipeline object
[out]errorLog error messages

◆ ob_create_config()

ob_config * ob_create_config ( ob_error **  error)

Create the pipeline configuration.

Parameters
[out]errorLog error messages
Returns
ob_config* The configuration object

◆ ob_delete_config()

void ob_delete_config ( ob_config config,
ob_error **  error 
)

Delete the pipeline configuration.

Parameters
[in]configThe configuration to be deleted
[out]errorLog error messages

◆ ob_config_enable_stream()

void ob_config_enable_stream ( ob_config config,
ob_stream_profile profile,
ob_error **  error 
)

Enable the specified stream in the pipeline configuration.

Parameters
[in]configThe pipeline configuration
[in]profileThe stream configuration to be enabled
[out]errorLog error messages

◆ ob_config_enable_video_stream()

void ob_config_enable_video_stream ( ob_config config,
ob_stream_type  type,
int  width,
int  height,
int  fps,
ob_format  format,
ob_error **  error 
)

Enable a video stream to be used in the configuration.

This function configures and enables a video stream with specific parameters. Users must specify all parameters explicitly as C does not support default arguments. Refer to the product manual for details on supported resolutions and formats for different camera models.

Parameters
configPointer to the configuration structure.
typeThe video stream type.
widthThe video stream width.
heightThe video stream height.
fpsThe video stream frame rate.
formatThe video stream format.
errorPointer to store the error if operation fails.

◆ ob_config_enable_accel_stream()

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 an accelerometer stream to be used in the configuration.

This function configures and enables an accelerometer stream with specific parameters. Users must specify all parameters explicitly. For details on available full-scale ranges and sample rates, please refer to the product manual.

Parameters
configPointer to the configuration structure.
fullScaleRangeThe full-scale range of the accelerometer.
sampleRateThe sample rate of the accelerometer.
errorPointer to store the error if operation fails.

◆ ob_config_enable_gyro_stream()

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 a gyroscope stream to be used in the configuration.

This function configures and enables a gyroscope stream with specific parameters. Users must specify all parameters explicitly. For details on available full-scale ranges and sample rates, please refer to the product manual.

Parameters
configPointer to the configuration structure.
fullScaleRangeThe full-scale range of the gyroscope.
sampleRateThe sample rate of the gyroscope.
errorPointer to store the error if operation fails.

◆ ob_config_enable_all_stream()

void ob_config_enable_all_stream ( ob_config config,
ob_error **  error 
)

Enable all streams in the pipeline configuration.

Deprecated:
Use ob_config_enable_stream instead
Parameters
[in]configThe pipeline configuration
[out]errorLog error messages

◆ ob_config_get_enabled_stream_profile_list()

ob_stream_profile_list * ob_config_get_enabled_stream_profile_list ( ob_config config,
ob_error **  error 
)

Get the enabled stream profile list in the pipeline configuration.

Parameters
configThe pipeline configuration
errorLog error messages
Returns
ob_stream_profile_list* The enabled stream profile list, should be released by ob_delete_stream_profile_list after use

◆ ob_config_disable_stream()

void ob_config_disable_stream ( ob_config config,
ob_stream_type  type,
ob_error **  error 
)

Disable a specific stream in the pipeline configuration.

Parameters
[in]configThe pipeline configuration
[in]typeThe type of stream to be disabled
[out]errorLog error messages

◆ ob_config_disable_all_stream()

void ob_config_disable_all_stream ( ob_config config,
ob_error **  error 
)

Disable all streams in the pipeline configuration.

Parameters
[in]configThe pipeline configuration
[out]errorLog error messages

◆ ob_config_set_align_mode()

void ob_config_set_align_mode ( ob_config config,
ob_align_mode  mode,
ob_error **  error 
)

Set the alignment mode for the pipeline configuration.

Parameters
[in]configThe pipeline configuration
[in]modeThe alignment mode to be set
[out]errorLog error messages

◆ ob_config_set_depth_scale_require()

void ob_config_set_depth_scale_require ( ob_config config,
bool  enable,
ob_error **  error 
)

Set whether depth scaling is required after setting D2C.

Parameters
[in]configThe pipeline configuration
[in]enableWhether scaling is required
[out]errorLog error messages

◆ ob_config_set_d2c_target_resolution()

void ob_config_set_d2c_target_resolution ( ob_config config,
uint32_t  d2c_target_width,
uint32_t  d2c_target_height,
ob_error **  error 
)

Set the target resolution for D2C, which is applicable when the color stream is not enabled using the OrbbecSDK and the depth needs to be D2C Note: When using the OrbbecSDK to enable the color stream, this interface should also be used to set the D2C target resolution. The configuration of the enabled color stream is preferred for D2C.

Parameters
[in]configThe pipeline configuration
[in]d2c_target_widthThe target width for D2C
[in]d2c_target_heightThe target height for D2C
[out]errorLog error messages

◆ ob_config_set_frame_aggregate_output_mode()

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.

The processing strategy when the FrameSet generated by the frame aggregation function does not contain the frames of all opened streams (which can be caused by different frame rates of each stream, or by the loss of frames of one stream): drop directly or output to the user.

Parameters
[in]configThe pipeline configuration
[in]modeThe frame aggregation output mode to be set (default mode is OB_FRAME_AGGREGATE_OUTPUT_FULL_FRAME_REQUIRE)
[out]errorLog error messages