-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8473 from doronhi/video-profile-eq
Video profile eq
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2020 Intel Corporation. All Rights Reserved. | ||
|
||
#include "../func/func-common.h" | ||
#include "../../include/librealsense2/hpp/rs_frame.hpp" | ||
#include <iostream> | ||
|
||
using namespace rs2; | ||
|
||
TEST_CASE("test video_stream_profile operator==", "[live]") | ||
{ | ||
// Test that for 2 video_stream_profile objects, if width and height are different | ||
// then, video_stream_profile.operator== returns false. | ||
|
||
auto devices = find_devices_by_product_line_or_exit(RS2_PRODUCT_LINE_DEPTH); | ||
if (devices.size() == 0) return; | ||
auto dev = devices[0]; | ||
|
||
auto depth_sens = dev.first< rs2::depth_sensor >(); | ||
|
||
stream_profile profile0, profile1; | ||
std::vector< stream_profile > stream_profiles; | ||
REQUIRE_NOTHROW(stream_profiles = depth_sens.get_stream_profiles()); | ||
for (auto profile : stream_profiles) | ||
{ | ||
if (profile.is<video_stream_profile>()) | ||
{ | ||
profile0 = profile; | ||
} | ||
} | ||
if (!profile0) return; | ||
video_stream_profile vprofile0 = profile0.as<video_stream_profile>(); | ||
|
||
for (auto profile : stream_profiles) | ||
{ | ||
if (!profile.is<video_stream_profile>()) continue; | ||
if (profile == profile0) | ||
{ | ||
video_stream_profile vprofile = profile.as<video_stream_profile>(); | ||
if (vprofile0.width() == vprofile.width() && | ||
vprofile0.height() == vprofile.height()) | ||
{ | ||
REQUIRE(vprofile0 == vprofile); | ||
} | ||
else | ||
{ | ||
REQUIRE(!(vprofile0 == vprofile)); | ||
} | ||
} | ||
} | ||
} |