[Colorizer] Check Depth stream format supported or not before process - #12765
Conversation
|
|
||
| if (frame.get_profile().stream_type() != RS2_STREAM_DEPTH) | ||
| if ((frame.get_profile().stream_type() != RS2_STREAM_DEPTH) || | ||
| (frame.get_profile().format() != RS2_FORMAT_DISPARITY32) && (frame.get_profile().format() != RS2_FORMAT_Z16)) |
There was a problem hiding this comment.
Why RS2_FORMAT_DISPARITY32 ?
There was a problem hiding this comment.
if we check the colorizer::process_frame() function, it supports Z16 & DISPARITY32 formats.
https://github.com/IntelRealSense/librealsense/blob/b33b2e01d9cb716183dce8c09d751654612affc5/src/proc/colorizer.cpp#L280
There was a problem hiding this comment.
If the depth format is not Z16 & not DISPARITY32, then return FALSE.
There was a problem hiding this comment.
I understand,
Maybe it will be more readable if we will add some static array of supported formats and check here if the frame format is in the supported formats?
dae6fc8 to
897d382
Compare
|
|
||
| if (frame.get_profile().stream_type() != RS2_STREAM_DEPTH) | ||
| return false; | ||
| std::set<rs2_format> supported_formats = {RS2_FORMAT_Z16, RS2_FORMAT_DISPARITY32}; |
There was a problem hiding this comment.
Sorry , I meant building this set as static const or at least only once and not on every frame.
897d382 to
8f83ef8
Compare
8f83ef8 to
97be414
Compare
[Tracked by LRS-1027]