NVIDIA DeepStream SDK API Reference

9.2 Release
rs2::config Class Reference

Detailed Description

The config allows pipeline users to request filters for the pipeline streams and device selection and configuration.

This is an optional step in pipeline creation, as the pipeline resolves its streaming device internally. Config provides its users a way to set the filters and test if there is no conflict with the pipeline requirements from the device. It also allows the user to find a matching device for the config filters and the pipeline, in order to select a device explicitly, and modify its controls before streaming starts.

Definition at line 124 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

Public Member Functions

 config ()
 
void enable_stream (rs2_stream stream_type, int stream_index, int width, int height, rs2_format format=RS2_FORMAT_ANY, int framerate=0)
 Enable a device stream explicitly, with selected stream parameters. More...
 
void enable_stream (rs2_stream stream_type, int stream_index=-1)
 Stream type and possibly also stream index. More...
 
void enable_stream (rs2_stream stream_type, int width, int height, rs2_format format=RS2_FORMAT_ANY, int framerate=0)
 Stream type and resolution, and possibly format and frame rate. More...
 
void enable_stream (rs2_stream stream_type, rs2_format format, int framerate=0)
 Stream type and format, and possibly frame rate. More...
 
void enable_stream (rs2_stream stream_type, int stream_index, rs2_format format, int framerate=0)
 Stream type, index, and format, and possibly framerate. More...
 
void enable_all_streams ()
 Enable all device streams explicitly. More...
 
void enable_device (const std::string &serial)
 Select a specific device explicitly by its serial number, to be used by the pipeline. More...
 
void enable_device_from_file (const std::string &file_name, bool repeat_playback=true)
 Select a recorded device from a file, to be used by the pipeline through playback. More...
 
void enable_record_to_file (const std::string &file_name)
 Requires that the resolved device would be recorded to file. More...
 
void disable_stream (rs2_stream stream, int index=-1)
 Disable a device stream explicitly, to remove any requests on this stream profile. More...
 
void disable_all_streams ()
 Disable all device stream explicitly, to remove any requests on the streams profiles. More...
 
pipeline_profile resolve (std::shared_ptr< rs2_pipeline > p) const
 Resolve the configuration filters, to find a matching device and streams profiles. More...
 
bool can_resolve (std::shared_ptr< rs2_pipeline > p) const
 Check if the config can resolve the configuration filters, to find a matching device and streams profiles. More...
 
std::shared_ptr< rs2_config > get () const
 
 operator std::shared_ptr< rs2_config > () const
 
 config (std::shared_ptr< rs2_config > cfg)
 
 config ()
 
void enable_stream (rs2_stream stream_type, int stream_index, int width, int height, rs2_format format=RS2_FORMAT_ANY, int framerate=0)
 Enable a device stream explicitly, with selected stream parameters. More...
 
void enable_stream (rs2_stream stream_type, int stream_index=-1)
 Stream type and possibly also stream index. More...
 
void enable_stream (rs2_stream stream_type, int width, int height, rs2_format format=RS2_FORMAT_ANY, int framerate=0)
 Stream type and resolution, and possibly format and frame rate. More...
 
void enable_stream (rs2_stream stream_type, rs2_format format, int framerate=0)
 Stream type and format, and possibly frame rate. More...
 
void enable_stream (rs2_stream stream_type, int stream_index, rs2_format format, int framerate=0)
 Stream type, index, and format, and possibly framerate. More...
 
void enable_all_streams ()
 Enable all device streams explicitly. More...
 
void enable_device (const std::string &serial)
 Select a specific device explicitly by its serial number, to be used by the pipeline. More...
 
void enable_device_from_file (const std::string &file_name, bool repeat_playback=true)
 Select a recorded device from a file, to be used by the pipeline through playback. More...
 
void enable_record_to_file (const std::string &file_name)
 Requires that the resolved device would be recorded to file. More...
 
void disable_stream (rs2_stream stream, int index=-1)
 Disable a device stream explicitly, to remove any requests on this stream profile. More...
 
void disable_all_streams ()
 Disable all device stream explicitly, to remove any requests on the streams profiles. More...
 
pipeline_profile resolve (std::shared_ptr< rs2_pipeline > p) const
 Resolve the configuration filters, to find a matching device and streams profiles. More...
 
bool can_resolve (std::shared_ptr< rs2_pipeline > p) const
 Check if the config can resolve the configuration filters, to find a matching device and streams profiles. More...
 
std::shared_ptr< rs2_config > get () const
 
 operator std::shared_ptr< rs2_config > () const
 
 config (std::shared_ptr< rs2_config > cfg)
 

Constructor & Destructor Documentation

◆ config() [1/4]

◆ config() [2/4]

rs2::config::config ( std::shared_ptr< rs2_config >  cfg)
inline

◆ config() [3/4]

◆ config() [4/4]

rs2::config::config ( std::shared_ptr< rs2_config >  cfg)
inline

Member Function Documentation

◆ can_resolve() [1/2]

bool rs2::config::can_resolve ( std::shared_ptr< rs2_pipeline >  p) const
inline

Check if the config can resolve the configuration filters, to find a matching device and streams profiles.

The resolution conditions are as described in resolve().

Parameters
[in]pThe pipeline for which the selected filters are applied
Returns
True if a valid profile selection exists, false if no selection can be found under the config filters and the available devices.

Definition at line 332 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_can_resolve().

◆ can_resolve() [2/2]

bool rs2::config::can_resolve ( std::shared_ptr< rs2_pipeline >  p) const
inline

Check if the config can resolve the configuration filters, to find a matching device and streams profiles.

The resolution conditions are as described in resolve().

Parameters
[in]pThe pipeline for which the selected filters are applied
Returns
True if a valid profile selection exists, false if no selection can be found under the config filters and the available devices.

Definition at line 332 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_can_resolve().

◆ disable_all_streams() [1/2]

void rs2::config::disable_all_streams ( )
inline

Disable all device stream explicitly, to remove any requests on the streams profiles.

The streams can still be enabled due to pipeline computer vision module request. This call removes any filter on the streams configuration.

Definition at line 289 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_disable_all_streams().

◆ disable_all_streams() [2/2]

void rs2::config::disable_all_streams ( )
inline

Disable all device stream explicitly, to remove any requests on the streams profiles.

The streams can still be enabled due to pipeline computer vision module request. This call removes any filter on the streams configuration.

Definition at line 289 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_disable_all_streams().

◆ disable_stream() [1/2]

void rs2::config::disable_stream ( rs2_stream  stream,
int  index = -1 
)
inline

Disable a device stream explicitly, to remove any requests on this stream profile.

The stream can still be enabled due to pipeline computer vision module request. This call removes any filter on the stream configuration.

Parameters
[in]streamStream type, for which the filters are cleared

Definition at line 277 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_disable_indexed_stream().

◆ disable_stream() [2/2]

void rs2::config::disable_stream ( rs2_stream  stream,
int  index = -1 
)
inline

Disable a device stream explicitly, to remove any requests on this stream profile.

The stream can still be enabled due to pipeline computer vision module request. This call removes any filter on the stream configuration.

Parameters
[in]streamStream type, for which the filters are cleared

Definition at line 277 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_disable_indexed_stream().

◆ enable_all_streams() [1/2]

void rs2::config::enable_all_streams ( )
inline

Enable all device streams explicitly.

The conditions and behavior of this method are similar to those of enable_stream(). This filter enables all raw streams of the selected device. The device is either selected explicitly by the application, or by the pipeline requirements or default. The list of streams is device dependent.

Definition at line 219 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_all_stream().

◆ enable_all_streams() [2/2]

void rs2::config::enable_all_streams ( )
inline

Enable all device streams explicitly.

The conditions and behavior of this method are similar to those of enable_stream(). This filter enables all raw streams of the selected device. The device is either selected explicitly by the application, or by the pipeline requirements or default. The list of streams is device dependent.

Definition at line 219 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_all_stream().

◆ enable_device() [1/2]

void rs2::config::enable_device ( const std::string &  serial)
inline

Select a specific device explicitly by its serial number, to be used by the pipeline.

The conditions and behavior of this method are similar to those of enable_stream(). This method is required if the application needs to set device or sensor settings prior to pipeline streaming, to enforce the pipeline to use the configured device.

Parameters
[in]serialdevice serial number, as returned by RS2_CAMERA_INFO_SERIAL_NUMBER

Definition at line 234 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_device().

◆ enable_device() [2/2]

void rs2::config::enable_device ( const std::string &  serial)
inline

Select a specific device explicitly by its serial number, to be used by the pipeline.

The conditions and behavior of this method are similar to those of enable_stream(). This method is required if the application needs to set device or sensor settings prior to pipeline streaming, to enforce the pipeline to use the configured device.

Parameters
[in]serialdevice serial number, as returned by RS2_CAMERA_INFO_SERIAL_NUMBER

Definition at line 234 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_device().

◆ enable_device_from_file() [1/2]

void rs2::config::enable_device_from_file ( const std::string &  file_name,
bool  repeat_playback = true 
)
inline

Select a recorded device from a file, to be used by the pipeline through playback.

The device available streams are as recorded to the file, and resolve() considers only this device and configuration as available. This request cannot be used if enable_record_to_file() is called for the current config, and vice versa.

Parameters
[in]file_nameThe playback file of the device

Definition at line 249 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_device_from_file_repeat_option().

◆ enable_device_from_file() [2/2]

void rs2::config::enable_device_from_file ( const std::string &  file_name,
bool  repeat_playback = true 
)
inline

Select a recorded device from a file, to be used by the pipeline through playback.

The device available streams are as recorded to the file, and resolve() considers only this device and configuration as available. This request cannot be used if enable_record_to_file() is called for the current config, and vice versa.

Parameters
[in]file_nameThe playback file of the device

Definition at line 249 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_device_from_file_repeat_option().

◆ enable_record_to_file() [1/2]

void rs2::config::enable_record_to_file ( const std::string &  file_name)
inline

Requires that the resolved device would be recorded to file.

This request cannot be used if enable_device_from_file() is called for the current config, and vice versa. as available.

Parameters
[in]file_nameThe desired file for the output record

Definition at line 263 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_record_to_file().

◆ enable_record_to_file() [2/2]

void rs2::config::enable_record_to_file ( const std::string &  file_name)
inline

Requires that the resolved device would be recorded to file.

This request cannot be used if enable_device_from_file() is called for the current config, and vice versa. as available.

Parameters
[in]file_nameThe desired file for the output record

Definition at line 263 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), and rs2_config_enable_record_to_file().

◆ enable_stream() [1/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  stream_index,
int  width,
int  height,
rs2_format  format = RS2_FORMAT_ANY,
int  framerate = 0 
)
inline

Enable a device stream explicitly, with selected stream parameters.

The method allows the application to request a stream with specific configuration. If no stream is explicitly enabled, the pipeline configures the device and its streams according to the attached computer vision modules and processing blocks requirements, or default configuration for the first available device. The application can configure any of the input stream parameters according to its requirement, or set to 0 for don't care value. The config accumulates the application calls for enable configuration methods, until the configuration is applied. Multiple enable stream calls for the same stream override each other, and the last call is maintained. Upon calling resolve(), the config checks for conflicts between the application configuration requests and the attached computer vision modules and processing blocks requirements, and fails if conflicts are found. Before resolve() is called, no conflict check is done.

Parameters
[in]stream_typeStream type to be enabled
[in]stream_indexStream index, used for multiple streams of the same type. -1 indicates any.
[in]widthStream image width - for images streams. 0 indicates any.
[in]heightStream image height - for images streams. 0 indicates any.
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 156 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References ds3d::v2xinfer::format(), rs2::error::handle(), rs2_config_enable_stream(), and width.

◆ enable_stream() [2/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  stream_index,
int  width,
int  height,
rs2_format  format = RS2_FORMAT_ANY,
int  framerate = 0 
)
inline

Enable a device stream explicitly, with selected stream parameters.

The method allows the application to request a stream with specific configuration. If no stream is explicitly enabled, the pipeline configures the device and its streams according to the attached computer vision modules and processing blocks requirements, or default configuration for the first available device. The application can configure any of the input stream parameters according to its requirement, or set to 0 for don't care value. The config accumulates the application calls for enable configuration methods, until the configuration is applied. Multiple enable stream calls for the same stream override each other, and the last call is maintained. Upon calling resolve(), the config checks for conflicts between the application configuration requests and the attached computer vision modules and processing blocks requirements, and fails if conflicts are found. Before resolve() is called, no conflict check is done.

Parameters
[in]stream_typeStream type to be enabled
[in]stream_indexStream index, used for multiple streams of the same type. -1 indicates any.
[in]widthStream image width - for images streams. 0 indicates any.
[in]heightStream image height - for images streams. 0 indicates any.
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 156 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References ds3d::v2xinfer::format(), rs2::error::handle(), rs2_config_enable_stream(), and width.

Referenced by enable_stream().

◆ enable_stream() [3/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  stream_index,
rs2_format  format,
int  framerate = 0 
)
inline

Stream type, index, and format, and possibly framerate.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]stream_indexStream index, used for multiple streams of the same type. -1 indicates any.
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 208 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), and ds3d::v2xinfer::format().

◆ enable_stream() [4/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  stream_index,
rs2_format  format,
int  framerate = 0 
)
inline

Stream type, index, and format, and possibly framerate.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]stream_indexStream index, used for multiple streams of the same type. -1 indicates any.
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 208 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), and ds3d::v2xinfer::format().

◆ enable_stream() [5/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  stream_index = -1 
)
inline

Stream type and possibly also stream index.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]stream_indexStream index, used for multiple streams of the same type. -1 indicates any.

Definition at line 169 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), and RS2_FORMAT_ANY.

◆ enable_stream() [6/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  stream_index = -1 
)
inline

Stream type and possibly also stream index.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]stream_indexStream index, used for multiple streams of the same type. -1 indicates any.

Definition at line 169 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), and RS2_FORMAT_ANY.

◆ enable_stream() [7/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  width,
int  height,
rs2_format  format = RS2_FORMAT_ANY,
int  framerate = 0 
)
inline

Stream type and resolution, and possibly format and frame rate.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]widthStream image width - for images streams. 0 indicates any.
[in]heightStream image height - for images streams. 0 indicates any.
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 183 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), ds3d::v2xinfer::format(), and width.

◆ enable_stream() [8/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
int  width,
int  height,
rs2_format  format = RS2_FORMAT_ANY,
int  framerate = 0 
)
inline

Stream type and resolution, and possibly format and frame rate.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]widthStream image width - for images streams. 0 indicates any.
[in]heightStream image height - for images streams. 0 indicates any.
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 183 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), ds3d::v2xinfer::format(), and width.

◆ enable_stream() [9/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
rs2_format  format,
int  framerate = 0 
)
inline

Stream type and format, and possibly frame rate.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 195 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), and ds3d::v2xinfer::format().

◆ enable_stream() [10/10]

void rs2::config::enable_stream ( rs2_stream  stream_type,
rs2_format  format,
int  framerate = 0 
)
inline

Stream type and format, and possibly frame rate.

Other parameters are resolved internally.

Parameters
[in]stream_typeStream type to be enabled
[in]formatStream data format - pixel format for images streams, of data type for other streams. RS2_FORMAT_ANY indicates any.
[in]framerateStream frames per second. 0 indicates any.

Definition at line 195 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References enable_stream(), and ds3d::v2xinfer::format().

◆ get() [1/2]

std::shared_ptr<rs2_config> rs2::config::get ( ) const
inline

◆ get() [2/2]

std::shared_ptr<rs2_config> rs2::config::get ( ) const
inline

◆ operator std::shared_ptr< rs2_config >() [1/2]

rs2::config::operator std::shared_ptr< rs2_config > ( ) const
inlineexplicit

◆ operator std::shared_ptr< rs2_config >() [2/2]

rs2::config::operator std::shared_ptr< rs2_config > ( ) const
inlineexplicit

◆ resolve() [1/2]

pipeline_profile rs2::config::resolve ( std::shared_ptr< rs2_pipeline >  p) const
inline

Resolve the configuration filters, to find a matching device and streams profiles.

The method resolves the user configuration filters for the device and streams, and combines them with the requirements of the computer vision modules and processing blocks attached to the pipeline. If there are no conflicts of requests, it looks for an available device, which can satisfy all requests, and selects the first matching streams configuration. In the absence of any request, the rs2::config selects the first available device and the first color and depth streams configuration. The pipeline profile selection during start() follows the same method. Thus, the selected profile is the same, if no change occurs to the available devices. Resolving the pipeline configuration provides the application access to the pipeline selected device for advanced control. The returned configuration is not applied to the device, so the application doesn't own the device sensors. However, the application can call enable_device(), to enforce the device returned by this method is selected by pipeline start(), and configure the device and sensors options or extensions before streaming starts.

Parameters
[in]pThe pipeline for which the selected filters are applied
Returns
A matching device and streams profile, which satisfies the filters and pipeline requests.

Definition at line 314 of file 9.2/sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), rs2_config_resolve(), and rs2_delete_pipeline_profile().

◆ resolve() [2/2]

pipeline_profile rs2::config::resolve ( std::shared_ptr< rs2_pipeline >  p) const
inline

Resolve the configuration filters, to find a matching device and streams profiles.

The method resolves the user configuration filters for the device and streams, and combines them with the requirements of the computer vision modules and processing blocks attached to the pipeline. If there are no conflicts of requests, it looks for an available device, which can satisfy all requests, and selects the first matching streams configuration. In the absence of any request, the rs2::config selects the first available device and the first color and depth streams configuration. The pipeline profile selection during start() follows the same method. Thus, the selected profile is the same, if no change occurs to the available devices. Resolving the pipeline configuration provides the application access to the pipeline selected device for advanced control. The returned configuration is not applied to the device, so the application doesn't own the device sensors. However, the application can call enable_device(), to enforce the device returned by this method is selected by pipeline start(), and configure the device and sensors options or extensions before streaming starts.

Parameters
[in]pThe pipeline for which the selected filters are applied
Returns
A matching device and streams profile, which satisfies the filters and pipeline requests.

Definition at line 314 of file sources/libs/ds3d/3rdparty/realsense2/include/librealsense2/hpp/rs_pipeline.hpp.

References rs2::error::handle(), rs2_config_resolve(), and rs2_delete_pipeline_profile().


The documentation for this class was generated from the following file: