6 #include <condition_variable> 16 if( devices_list.
size() == 0 )
18 std::cout <<
"No device was found; skipping test" << std::endl;
21 return devices_list[0];
28 if( devices_list.
size() == 0 )
30 std::cout <<
"No device of the " << product <<
" product line was found; skipping test" 45 std::cout <<
"FW version " << fw_version <<
" is under the minimum requiered FW version " 46 << version << std::endl;
57 std::vector< rs2::device > devices_list = ctx.
query_devices();
60 = std::find_if( devices_list.begin(), devices_list.end(), [dev_name](
rs2::device dev ) {
66 if( dev_iter != devices_list.end() )
71 std::cout <<
"No " << dev_name <<
" device was found; skipping test" << std::endl;
83 if (!
ds.supports(opt))
95 std::vector< rs2::stream_profile > & expected_streams )
97 auto remove_stream = [&]() {
98 auto it = std::remove_if( expected_streams.begin(),
99 expected_streams.end(),
105 if(
it != expected_streams.end() )
106 expected_streams.erase(
it );
126 = std::find_if(stream_profiles.begin(), stream_profiles.end(), [](
stream_profile sp) {
130 REQUIRE(depth_profile != stream_profiles.end());
140 = std::find_if(stream_profiles.begin(), stream_profiles.end(), [](
stream_profile sp) {
144 REQUIRE(ir_profile != stream_profiles.end());
154 auto confidence_profile
155 = std::find_if(stream_profiles.begin(), stream_profiles.end(), [&](
stream_profile sp) {
163 REQUIRE(confidence_profile != stream_profiles.end());
164 return *confidence_profile;
192 std::map< rs2_sensor_mode, std::pair< uint32_t, uint32_t > > sensor_mode_to_resolution
199 = std::find_if( stream_profiles.begin(), stream_profiles.end(), [&](
stream_profile sp ) {
204 && vp.width() == sensor_mode_to_resolution[
mode].first
205 && vp.height() == sensor_mode_to_resolution[
mode].second;
215 std::vector< stream_profile >
profiles,
216 std::function<
void() >
action )
233 int stream_index = -1 )
241 && ( ( -1 ==
width ) || ( vp.width() ==
width ) )
243 && ( ( -1 ==
fps ) || ( vp.fps() ==
fps )
244 && ( ( -1 == stream_index ) || vp.stream_index() == stream_index ) ) );
247 if( found_profile != profiles.end() )
248 return *found_profile;
void start_default_l500_depth_profiles(rs2::depth_sensor depth_sens, T callback, bool with_confidence=false)
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
void remove_all_streams_arrived(rs2::frame f, std::vector< rs2::stream_profile > &expected_streams)
const char * rs2_option_to_string(rs2_option option)
stream_profile find_default_depth_profile(rs2::depth_sensor depth_sens)
rs2::device find_first_device_or_exit()
stream_profile get_profile() const
device_list query_devices() const
GLint GLint GLsizei GLsizei GLsizei depth
GLsizei const GLchar *const * string
void do_while_streaming(rs2::sensor depth_sens, std::vector< stream_profile > profiles, std::function< void() > action)
rs2::device find_first_device_by_name_or_exit(const std::string &dev_name)
rs2::device_list find_devices_by_product_line_or_exit(int product)
rs2::depth_sensor find_first_supported_depth_sensor_or_exit(const std::string &dev_name, rs2_option opt)
const char * get_info(rs2_camera_info info) const
GLint GLsizei GLsizei height
GLint GLint GLsizei GLint GLenum format
stream_profile find_default_ir_profile(rs2::depth_sensor depth_sens)
rs2_format
A stream's format identifies how binary data is encoded within a frame.
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
rs2_stream
Streams are different types of data provided by RealSense devices.
static const textual_icon exit
rs2_sensor_mode
For setting the camera_mode option.
void foreach_rs(T action) const
stream_profile find_confidence_corresponding_to_depth(rs2::depth_sensor depth_sens, stream_profile depth_profile)
void open(const stream_profile &profile) const
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO,"Log message using rs2_log()", nullptr))
void exit_if_fw_version_is_under(rs2::device &dev, librealsense::firmware_version version)
std::vector< stream_profile > get_stream_profiles() const
rs2_stream stream_type() const
stream_profile find_profile(rs2::depth_sensor depth_sens, rs2_stream stream, rs2_sensor_mode mode)
void start(T callback) const
rs2::stream_profile get_profile_by_stream_parameters(rs2::sensor s, rs2_stream stream=RS2_STREAM_ANY, rs2_format format=RS2_FORMAT_ANY, int width=-1, int height=-1, int fps=-1, int stream_index=-1)