4 #ifndef LIBREALSENSE_RS2_PIPELINE_HPP 5 #define LIBREALSENSE_RS2_PIPELINE_HPP 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>(
172 enable_stream(stream_type, -1, width, height, format, framerate);
184 enable_stream(stream_type, stream_index, 0, 0, format, framerate);
291 auto profile = std::shared_ptr<rs2_pipeline_profile>(
314 std::shared_ptr<rs2_config>
get()
const 318 explicit operator std::shared_ptr<rs2_config>()
const 323 config(std::shared_ptr<rs2_config> cfg) : _config(cfg) {}
325 std::shared_ptr<rs2_config> _config;
349 _pipeline = std::shared_ptr<rs2_pipeline>(
369 auto p = std::shared_ptr<rs2_pipeline_profile>(
398 auto p = std::shared_ptr<rs2_pipeline_profile>(
419 auto p = std::shared_ptr<rs2_pipeline_profile>(
447 auto p = std::shared_ptr<rs2_pipeline_profile>(
511 throw std::invalid_argument(
"null frameset");
526 throw std::invalid_argument(
"null frameset");
548 auto p = std::shared_ptr<rs2_pipeline_profile>(
556 operator std::shared_ptr<rs2_pipeline>()
const 560 explicit pipeline(std::shared_ptr<rs2_pipeline> ptr) : _pipeline(ptr) {}
563 std::shared_ptr<rs2_pipeline> _pipeline;
567 #endif // LIBREALSENSE_RS2_PROCESSING_HPP config(std::shared_ptr< rs2_config > cfg)
Definition: rs_pipeline.hpp:323
Definition: rs_frame.hpp:21
stream_profile get_stream(rs2_stream stream_type, int stream_index=-1) const
Definition: rs_pipeline.hpp:60
int rs2_pipeline_poll_for_frames(rs2_pipeline *pipe, rs2_frame **output_frame, rs2_error **error)
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)
Definition: rs_pipeline.hpp:124
Definition: rs_frame.hpp:295
int rs2_pipeline_try_wait_for_frames(rs2_pipeline *pipe, rs2_frame **output_frame, unsigned int timeout_ms, rs2_error **error)
void stop()
Definition: rs_pipeline.hpp:462
rs2_pipeline_profile * rs2_config_resolve(rs2_config *config, rs2_pipeline *pipe, rs2_error **error)
pipeline_profile resolve(std::shared_ptr< rs2_pipeline > p) const
Definition: rs_pipeline.hpp:288
rs2_pipeline_profile * rs2_pipeline_start_with_callback_cpp(rs2_pipeline *pipe, rs2_frame_callback *callback, rs2_error **error)
bool poll_for_frames(frameset *f) const
Definition: rs_pipeline.hpp:507
pipeline_profile start(const config &config)
Definition: rs_pipeline.hpp:395
Definition: rs_pipeline.hpp:18
rs2_pipeline_profile * rs2_pipeline_start(rs2_pipeline *pipe, rs2_error **error)
void rs2_delete_device(rs2_device *device)
void rs2_config_disable_indexed_stream(rs2_config *config, rs2_stream stream, int index, rs2_error **error)
rs2_config * rs2_create_config(rs2_error **error)
rs2_pipeline * rs2_create_pipeline(rs2_context *ctx, rs2_error **error)
pipeline(std::shared_ptr< rs2_pipeline > ptr)
Definition: rs_pipeline.hpp:560
pipeline_profile start(const config &config, S callback)
Definition: rs_pipeline.hpp:444
void rs2_config_enable_record_to_file(rs2_config *config, const char *file, rs2_error **error)
pipeline(context ctx=context())
Definition: rs_pipeline.hpp:346
Definition: rs_frame.hpp:830
Definition: rs_context.hpp:11
bool try_wait_for_frames(frameset *f, unsigned int timeout_ms=5000) const
Definition: rs_pipeline.hpp:522
void enable_device(const std::string &serial)
Definition: rs_pipeline.hpp:208
rs2_pipeline_profile * rs2_pipeline_get_active_profile(rs2_pipeline *pipe, rs2_error **error)
std::shared_ptr< rs2_config > get() const
Definition: rs_pipeline.hpp:314
Definition: rs_context.hpp:96
void rs2_config_enable_all_stream(rs2_config *config, rs2_error **error)
void enable_stream(rs2_stream stream_type, int stream_index, rs2_format format, int framerate=0)
Definition: rs_pipeline.hpp:182
rs2_device * rs2_pipeline_profile_get_device(rs2_pipeline_profile *profile, rs2_error **error)
rs2_pipeline_profile * rs2_pipeline_start_with_config_and_callback_cpp(rs2_pipeline *pipe, rs2_config *config, rs2_frame_callback *callback, rs2_error **error)
pipeline_profile start(S callback)
Definition: rs_pipeline.hpp:416
Definition: rs_frame.hpp:1045
rs2_stream_profile_list * rs2_pipeline_profile_get_streams(rs2_pipeline_profile *profile, rs2_error **error)
rs2_frame * rs2_pipeline_wait_for_frames(rs2_pipeline *pipe, unsigned int timeout_ms, rs2_error **error)
void rs2_config_disable_all_streams(rs2_config *config, rs2_error **error)
void disable_all_streams()
Definition: rs_pipeline.hpp:263
std::vector< stream_profile > get_streams() const
Definition: rs_pipeline.hpp:29
int rs2_config_can_resolve(rs2_config *config, rs2_pipeline *pipe, rs2_error **error)
device get_device() const
Definition: rs_pipeline.hpp:83
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
void disable_stream(rs2_stream stream, int index=-1)
Definition: rs_pipeline.hpp:251
Definition: rs_sensor.h:57
rs2_format
Format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:55
pipeline_profile get_active_profile() const
Definition: rs_pipeline.hpp:545
pipeline_profile(std::shared_ptr< rs2_pipeline_profile > profile)
Definition: rs_pipeline.hpp:106
void rs2_config_enable_device_from_file_repeat_option(rs2_config *config, const char *file, int repeat_playback, rs2_error **error)
void enable_all_streams()
Definition: rs_pipeline.hpp:193
void enable_stream(rs2_stream stream_type, int stream_index, int width, int height, rs2_format format=RS2_FORMAT_ANY, int framerate=0)
Definition: rs_pipeline.hpp:156
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:38
rs2_pipeline_profile * rs2_pipeline_start_with_config(rs2_pipeline *pipe, rs2_config *config, rs2_error **error)
config()
Definition: rs_pipeline.hpp:127
Definition: rs_pipeline.hpp:336
void enable_stream(rs2_stream stream_type, int width, int height, rs2_format format=RS2_FORMAT_ANY, int framerate=0)
Definition: rs_pipeline.hpp:170
void enable_record_to_file(const std::string &file_name)
Definition: rs_pipeline.hpp:237
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
void rs2_pipeline_stop(rs2_pipeline *pipe, rs2_error **error)
frameset wait_for_frames(unsigned int timeout_ms=5000) const
Definition: rs_pipeline.hpp:484
void enable_stream(rs2_stream stream_type, int stream_index=-1)
Definition: rs_pipeline.hpp:164
void rs2_delete_config(rs2_config *config)
void enable_device_from_file(const std::string &file_name, bool repeat_playback=true)
Definition: rs_pipeline.hpp:223
void rs2_config_enable_device(rs2_config *config, const char *serial, rs2_error **error)
pipeline_profile start()
Definition: rs_pipeline.hpp:366
int rs2_get_stream_profiles_count(const rs2_stream_profile_list *list, rs2_error **error)
bool can_resolve(std::shared_ptr< rs2_pipeline > p) const
Definition: rs_pipeline.hpp:306
struct rs2_error rs2_error
Definition: rs_types.h:197
Definition: rs_device.hpp:18
void rs2_delete_pipeline_profile(rs2_pipeline_profile *profile)
void rs2_delete_pipeline(rs2_pipeline *pipe)
struct rs2_frame rs2_frame
Definition: rs_types.h:199
pipeline_profile()
Definition: rs_pipeline.hpp:22
void enable_stream(rs2_stream stream_type, rs2_format format, int framerate=0)
Definition: rs_pipeline.hpp:176