Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
unit-tests
func
presets
custom
test-streaming.cpp
Go to the documentation of this file.
1
// License: Apache 2.0. See LICENSE file in root directory.
2
// Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3
4
//#cmake: static!
5
//#test:device L500*
6
7
#include "../../func-common.h"
8
#include "../presets-common.h"
9
10
using namespace
rs2
;
11
12
// This test checks that if we are on custom preset and start streaming,
13
// with profile that has different resolution than the value of the
14
// sensor mode control LRS don't throw an exception and update the
15
// sensor mode according the profile
16
TEST_CASE
(
"sensor mode change while streaming on custom"
,
"[l500][live]"
)
17
{
18
auto
devices
=
find_devices_by_product_line_or_exit
(
RS2_PRODUCT_LINE_L500
);
19
auto
dev
=
devices
[0];
20
21
exit_if_fw_version_is_under
(
dev
,
MIN_GET_DEFAULT_FW_VERSION
);
22
23
auto
depth_sens =
dev
.first<
rs2::depth_sensor
>();
24
25
reset_camera_preset_mode_to_defaults
( depth_sens );
26
27
REQUIRE_NOTHROW
(
28
depth_sens.set_option(
RS2_OPTION_VISUAL_PRESET
,
RS2_L500_VISUAL_PRESET_CUSTOM
));
29
30
start_depth_ir_confidence
(depth_sens,
RS2_SENSOR_MODE_XGA
);
31
32
auto
curr_sensor_mode =
RS2_SENSOR_MODE_VGA
;
33
REQUIRE_NOTHROW
(curr_sensor_mode = (
rs2_sensor_mode
)(
int
)depth_sens.get_option(
RS2_OPTION_SENSOR_MODE
));
34
REQUIRE
(curr_sensor_mode ==
RS2_SENSOR_MODE_XGA
);
35
36
stop_depth
(depth_sens);
37
}
MIN_GET_DEFAULT_FW_VERSION
const std::string MIN_GET_DEFAULT_FW_VERSION("1.5.4.0")
test-bad-conditions.dev
dev
Definition:
test-bad-conditions.py:16
RS2_SENSOR_MODE_XGA
Definition:
rs_option.h:168
rs2::depth_sensor
Definition:
rs_sensor.hpp:454
RS2_L500_VISUAL_PRESET_CUSTOM
Definition:
rs_option.h:153
RS2_SENSOR_MODE_VGA
Definition:
rs_option.h:167
rs2
Definition:
cah-model.h:10
REQUIRE
REQUIRE(n_callbacks==1)
find_devices_by_product_line_or_exit
rs2::device_list find_devices_by_product_line_or_exit(int product)
Definition:
func-common.h:24
test-fg.devices
devices
Definition:
test-fg.py:9
RS2_PRODUCT_LINE_L500
#define RS2_PRODUCT_LINE_L500
Definition:
rs_context.h:96
rs2_sensor_mode
rs2_sensor_mode
For setting the camera_mode option.
Definition:
rs_option.h:165
stop_depth
void stop_depth(const rs2::sensor &sens)
Definition:
presets-common.h:417
REQUIRE_NOTHROW
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO,"Log message using rs2_log()", nullptr))
exit_if_fw_version_is_under
void exit_if_fw_version_is_under(rs2::device &dev, librealsense::firmware_version version)
Definition:
func-common.h:38
reset_camera_preset_mode_to_defaults
void reset_camera_preset_mode_to_defaults(const rs2::sensor &sens)
Definition:
presets-common.h:88
TEST_CASE
TEST_CASE("sensor mode change while streaming on custom","[l500][live]")
Definition:
test-streaming.cpp:16
RS2_OPTION_VISUAL_PRESET
Definition:
rs_option.h:36
RS2_OPTION_SENSOR_MODE
Definition:
rs_option.h:95
start_depth_ir_confidence
void start_depth_ir_confidence(const rs2::sensor &sens, rs2_sensor_mode mode=RS2_SENSOR_MODE_VGA)
Definition:
presets-common.h:401
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:50:11