From 8f83ef8473bf0e69ccd90a94f1b99a5e1ef00984 Mon Sep 17 00:00:00 2001 From: Arun-Prasad-V Date: Tue, 19 Mar 2024 09:11:45 +0530 Subject: [PATCH] Colorizer: check depth stream format supported or not before process --- src/proc/colorizer.cpp | 7 ++++--- src/proc/colorizer.h | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/proc/colorizer.cpp b/src/proc/colorizer.cpp index a959b75ff85..e25471109bd 100644 --- a/src/proc/colorizer.cpp +++ b/src/proc/colorizer.cpp @@ -245,10 +245,11 @@ namespace librealsense if (!frame || frame.is()) return false; - if (frame.get_profile().stream_type() != RS2_STREAM_DEPTH) + if ((frame.get_profile().stream_type() == RS2_STREAM_DEPTH) && + (_supported_formats.find(frame.get_profile().format()) != _supported_formats.end())) + return true; + else return false; - - return true; } rs2::frame colorizer::process_frame(const rs2::frame_source& source, const rs2::frame& f) diff --git a/src/proc/colorizer.h b/src/proc/colorizer.h index b94e62649c0..7d6436ccda1 100644 --- a/src/proc/colorizer.h +++ b/src/proc/colorizer.h @@ -6,6 +6,7 @@ #include #include +#include namespace rs2 { @@ -169,5 +170,7 @@ namespace librealsense { float _depth_units = 0.f; float _d2d_convert_factor = 0.f; + + const std::set _supported_formats = {RS2_FORMAT_Z16, RS2_FORMAT_DISPARITY32}; }; }