| 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_pipeline * | ob_create_pipeline (ob_error **error)
| Create a pipeline object.
ob_pipeline * | ob_create_pipeline_with_device (ob_device *dev, ob_error **error)
| Using device objects to create pipeline objects.
ob_pipeline * | ob_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_config * | ob_pipeline_get_config (ob_pipeline *pipeline, ob_error **error)
| Get the configuration object associated with the pipeline.
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_device * | ob_pipeline_get_device (ob_pipeline *pipeline, ob_error **error)
| Get the device object associated with the pipeline.
ob_playback * | ob_pipeline_get_playback (ob_pipeline *pipeline, ob_error **error)
| Get the playback object associated with the pipeline.
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.
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_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.
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_config * | ob_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_list * | ob_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] | error | Log 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] | dev | Device object used to create pipeline
  [out] | error | Log 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_name | The playback file path used to create the pipeline
  [out] | error | Log 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] | pipeline | The pipeline object to be deleted
  [out] | error | Log error messages

## ◆ ob_pipeline_start()

void ob_pipeline_start | ( | ob_pipeline * | pipeline,
|  | ob_error ** | error
| ) |  |

Start the pipeline with default parameters.

Parameters

  [in] | pipeline | pipeline object
  [out] | error | Log 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] | pipeline | pipeline object
  [in] | config | Parameters to be configured
  [out] | error | Log 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] | pipeline | pipeline object
  [in] | config | Parameters to be configured
  [in] | callback | Trigger a callback when all frame data in the frameset arrives
  [in] | user_data | Pass in any user data and get it from the callback
  [out] | error | Log error messages

## ◆ ob_pipeline_stop()

void ob_pipeline_stop | ( | ob_pipeline * | pipeline,
|  | ob_error ** | error
| ) |  |

Stop pipeline.

Parameters

  [in] | pipeline | pipeline object
  [out] | error | Log 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] | pipeline | The pipeline object
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | timeout_ms | The timeout for waiting (in milliseconds)
  [out] | error | Log 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] | pipeline | The pipeline object
  [out] | error | Log 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] | pipeline | The pipeline object
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | sensorType | The sensor type. The supported sensor types can be obtained through the ob_device_get_sensor_list() interface.
  [out] | error | Log 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] | pipeline | The pipeline object
  [out] | error | Log error messages

## ◆ ob_pipeline_disable_frame_sync()

void ob_pipeline_disable_frame_sync | ( | ob_pipeline * | pipeline,
|  | ob_error ** | error
| ) |  |

Disable frame synchronization.

Parameters

  [in] | pipeline | The pipeline object
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | config | The pipeline configuration
  [out] | error | Log 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] | pipeline | pipeline object
  [in] | colorWidth | color width
  [in] | colorHeight | color height
  [in] | depthWidth | depth width
  [in] | depthHeight | depth height
  [out] | error | Log 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] | pipeline | pipeline object
  [out] | error | Log 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] | pipeline | pipeline object
  [in] | config | The pipeline configuration
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | color_profile | The input profile of the color sensor
  [in] | align_mode | The input align mode
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | distance | The working distance
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | minimum_distance | The minimum working distance
  [in] | maximum_distance | The maximum working distance
  [out] | error | Log 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] | pipeline | The pipeline object
  [in] | file_name | The recorded file path
  [out] | error | Log error messages

## ◆ ob_pipeline_stop_record()

void ob_pipeline_stop_record | ( | ob_pipeline * | pipeline,
|  | ob_error ** | error
| ) |  |

Stop recording.

Parameters

  [in] | pipeline | The pipeline object
  [out] | error | Log error messages

## ◆ ob_create_config()

ob_config * ob_create_config | ( | ob_error ** | error | ) |

Create the pipeline configuration.

Parameters

  [out] | error | Log 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] | config | The configuration to be deleted
  [out] | error | Log 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] | config | The pipeline configuration
  [in] | profile | The stream configuration to be enabled
  [out] | error | Log 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

  config | Pointer to the configuration structure.
  type | The video stream type.
  width | The video stream width.
  height | The video stream height.
  fps | The video stream frame rate.
  format | The video stream format.
  error | Pointer 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

  config | Pointer to the configuration structure.
  fullScaleRange | The full-scale range of the accelerometer.
  sampleRate | The sample rate of the accelerometer.
  error | Pointer 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

  config | Pointer to the configuration structure.
  fullScaleRange | The full-scale range of the gyroscope.
  sampleRate | The sample rate of the gyroscope.
  error | Pointer 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] | config | The pipeline configuration
  [out] | error | Log 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

  config | The pipeline configuration
  error | Log 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] | config | The pipeline configuration
  [in] | type | The type of stream to be disabled
  [out] | error | Log 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] | config | The pipeline configuration
  [out] | error | Log 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] | config | The pipeline configuration
  [in] | mode | The alignment mode to be set
  [out] | error | Log 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] | config | The pipeline configuration
  [in] | enable | Whether scaling is required
  [out] | error | Log 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] | config | The pipeline configuration
  [in] | d2c_target_width | The target width for D2C
  [in] | d2c_target_height | The target height for D2C
  [out] | error | Log 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] | config | The pipeline configuration
  [in] | mode | The frame aggregation output mode to be set (default mode is OB_FRAME_AGGREGATE_OUTPUT_FULL_FRAME_REQUIRE)
  [out] | error | Log error messages