|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
4 #ifndef LIBREALSENSE_RS2_PIPELINE_HPP
5 #define LIBREALSENSE_RS2_PIPELINE_HPP
18 class pipeline_profile
31 std::vector<stream_profile> results;
34 std::shared_ptr<rs2_stream_profile_list> list(
42 for (
auto i = 0; i <
size; i++)
46 results.push_back(profile);
64 if (s.stream_type() == stream_type && (stream_index == -1 || s.stream_index() == stream_index))
69 throw std::runtime_error(
"Profile does not contain the requested stream");
86 std::shared_ptr<rs2_device> dev(
100 operator bool()
const
102 return _pipeline_profile !=
nullptr;
105 explicit operator std::shared_ptr<rs2_pipeline_profile>() {
return _pipeline_profile; }
107 _pipeline_profile(profile){}
110 std::shared_ptr<rs2_pipeline_profile> _pipeline_profile;
130 _config = std::shared_ptr<rs2_config>(
317 auto profile = std::shared_ptr<rs2_pipeline_profile>(
340 std::shared_ptr<rs2_config>
get()
const
344 explicit operator std::shared_ptr<rs2_config>()
const
349 config(std::shared_ptr<rs2_config> cfg) : _config(cfg) {}
351 std::shared_ptr<rs2_config> _config;
375 _pipeline = std::shared_ptr<rs2_pipeline>(
395 auto p = std::shared_ptr<rs2_pipeline_profile>(
424 auto p = std::shared_ptr<rs2_pipeline_profile>(
445 auto p = std::shared_ptr<rs2_pipeline_profile>(
473 auto p = std::shared_ptr<rs2_pipeline_profile>(
537 throw std::invalid_argument(
"null frameset");
552 throw std::invalid_argument(
"null frameset");
574 auto p = std::shared_ptr<rs2_pipeline_profile>(
582 operator std::shared_ptr<rs2_pipeline>()
const
586 explicit pipeline(std::shared_ptr<rs2_pipeline> ptr) : _pipeline(ptr) {}
589 std::shared_ptr<rs2_pipeline> _pipeline;
593 #endif // LIBREALSENSE_RS2_PROCESSING_HPP
rs2_pipeline_profile * rs2_pipeline_get_active_profile(rs2_pipeline *pipe, rs2_error **error)
Return the active device and streams profiles, used by the pipeline.
void rs2_delete_pipeline_profile(rs2_pipeline_profile *profile)
Deletes an instance of a pipeline profile.
void disable_stream(rs2_stream stream, int index=-1)
Disable a device stream explicitly, to remove any requests on this stream profile.
std::vector< stream_profile > get_streams() const
Return the selected streams profiles, which are enabled in this profile.
void enable_record_to_file(const std::string &file_name)
Requires that the resolved device would be recorded to file.
JDIMENSION JDIMENSION * width
device get_device() const
Retrieve the device used by the pipeline.
pipeline(std::shared_ptr< rs2_pipeline > ptr)
int rs2_pipeline_try_wait_for_frames(rs2_pipeline *pipe, rs2_frame **output_frame, unsigned int timeout_ms, rs2_error **error)
Wait until a new set of frames becomes available.
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.
void rs2_config_enable_device_from_file_repeat_option(rs2_config *config, const char *file, int repeat_playback, rs2_error **error)
Select a recorded device from a file, to be used by the pipeline through playback.
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 prof...
void rs2_config_enable_device(rs2_config *config, const char *serial, rs2_error **error)
Select a specific device explicitly by its serial number, to be used by the pipeline.
rs2_pipeline_profile * rs2_pipeline_start(rs2_pipeline *pipe, rs2_error **error)
Start the pipeline streaming with its default configuration.
rs2_config * rs2_create_config(rs2_error **error)
Create a config instance The config allows pipeline users to request filters for the pipeline streams...
void rs2_config_disable_all_streams(rs2_config *config, rs2_error **error)
Disable all device stream explicitly, to remove any requests on the streams profiles.
pipeline(context ctx=context())
Create a pipeline for processing data from a single device.
void rs2_delete_config(rs2_config *config)
Deletes an instance of a config.
config(std::shared_ptr< rs2_config > cfg)
void enable_all_streams()
Enable all device streams explicitly.
frameset wait_for_frames(unsigned int timeout_ms=RS2_DEFAULT_TIMEOUT) const
Wait until a new set of frames becomes available.
void rs2_delete_pipeline(rs2_pipeline *pipe)
Delete a pipeline instance.
rs2_stream_profile_list * rs2_pipeline_profile_get_streams(rs2_pipeline_profile *profile, rs2_error **error)
Return the selected streams profiles, which are enabled in this profile.
void disable_all_streams()
Disable all device stream explicitly, to remove any requests on the streams profiles.
pipeline_profile start(const config &config)
Start the pipeline streaming according to the configuraion.
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
delete stream profiles list
void rs2_config_enable_stream(rs2_config *config, rs2_stream stream, int index, int width, int height, rs2_format format, int framerate, rs2_error **error)
Enable a device stream explicitly, with selected stream parameters.
rs2_pipeline * rs2_create_pipeline(rs2_context *ctx, rs2_error **error)
Create a pipeline instance The pipeline simplifies the user interaction with the device and computer ...
void enable_stream(rs2_stream stream_type, rs2_format format, int framerate=0)
Stream type and format, and possibly frame rate.
pipeline_profile start(const config &config, S callback)
Start the pipeline streaming according to the configuraion.
The config allows pipeline users to request filters for the pipeline streams and device selection and...
stream_profile get_stream(rs2_stream stream_type, int stream_index=-1) const
Return the stream profile that is enabled for the specified stream in this profile.
rs2_pipeline_profile * rs2_pipeline_start_with_callback_cpp(rs2_pipeline *pipe, rs2_frame_callback *callback, rs2_error **error)
Start the pipeline streaming with its default configuration.
struct rs2_frame rs2_frame
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.
int rs2_config_can_resolve(rs2_config *config, rs2_pipeline *pipe, rs2_error **error)
Check if the config can resolve the configuration filters, to find a matching device and streams prof...
#define RS2_DEFAULT_TIMEOUT
int rs2_get_stream_profiles_count(const rs2_stream_profile_list *list, rs2_error **error)
get the number of supported stream profiles
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
Get pointer to specific stream profile.
bool poll_for_frames(frameset *f) const
Check if a new set of frames is available and retrieve the latest undelivered set.
constexpr const char * size
rs2_frame * rs2_pipeline_wait_for_frames(rs2_pipeline *pipe, unsigned int timeout_ms, rs2_error **error)
Wait until a new set of frames becomes available.
@ RS2_FORMAT_ANY
When passed to enable stream, librealsense will try to provide best suited format.
rs2_format
A stream's format identifies how binary data is encoded within a frame.
pipeline_profile(std::shared_ptr< rs2_pipeline_profile > profile)
void rs2_delete_device(rs2_device *device)
Delete RealSense device.
int rs2_pipeline_poll_for_frames(rs2_pipeline *pipe, rs2_frame **output_frame, rs2_error **error)
Check if a new set of frames is available and retrieve the latest undelivered set.
pipeline_profile get_active_profile() const
Return the active device and streams profiles, used by the pipeline.
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.
void rs2_pipeline_stop(rs2_pipeline *pipe, rs2_error **error)
Stop the pipeline streaming.
void enable_device(const std::string &serial)
Select a specific device explicitly by its serial number, to be used by the pipeline.
pipeline_profile resolve(std::shared_ptr< rs2_pipeline > p) const
Resolve the configuration filters, to find a matching device and streams profiles.
rs2_pipeline_profile * rs2_config_resolve(rs2_config *config, rs2_pipeline *pipe, rs2_error **error)
Resolve the configuration filters, to find a matching device and streams profiles.
static void handle(rs2_error *e)
pipeline_profile start()
Start the pipeline streaming with its default configuration.
The pipeline simplifies the user interaction with the device and computer vision processing modules.
void enable_stream(rs2_stream stream_type, int stream_index, rs2_format format, int framerate=0)
Stream type, index, and format, and possibly framerate.
bool try_wait_for_frames(frameset *f, unsigned int timeout_ms=RS2_DEFAULT_TIMEOUT) const
The pipeline profile includes a device and a selection of active streams, with specific profiles.
void rs2_config_enable_all_stream(rs2_config *config, rs2_error **error)
Enable all device streams explicitly.
pipeline_profile start(S callback)
Start the pipeline streaming with its default configuration.
void enable_stream(rs2_stream stream_type, int stream_index=-1)
Stream type and possibly also stream index.
rs2_pipeline_profile * rs2_pipeline_start_with_config_and_callback_cpp(rs2_pipeline *pipe, rs2_config *config, rs2_frame_callback *callback, rs2_error **error)
Start the pipeline streaming according to the configuraion.
void rs2_config_disable_indexed_stream(rs2_config *config, rs2_stream stream, int index, rs2_error **error)
Disable a device stream explicitly, to remove any requests on this stream profile.
void stop()
Stop the pipeline streaming.
rs2_pipeline_profile * rs2_pipeline_start_with_config(rs2_pipeline *pipe, rs2_config *config, rs2_error **error)
Start the pipeline streaming according to the configuraion.
void rs2_config_enable_record_to_file(rs2_config *config, const char *file, rs2_error **error)
Requires that the resolved device would be recorded to file This request cannot be used if enable_dev...
rs2_stream
Streams are different types of data provided by RealSense devices.
std::shared_ptr< rs2_config > get() const
rs2_device * rs2_pipeline_profile_get_device(rs2_pipeline_profile *profile, rs2_error **error)
Retrieve the device used by the pipeline.
static std::string format(const char *fmt,...)
struct rs2_error rs2_error