From 7325a4f186fbba7c58b2318f7cbdaf1b971d9b61 Mon Sep 17 00:00:00 2001 From: NirAz Date: Sun, 26 Apr 2020 22:49:41 +0300 Subject: [PATCH 1/2] Add coruppted frame notification --- src/frame-validator.cpp | 7 ++++++- src/frame-validator.h | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/frame-validator.cpp b/src/frame-validator.cpp index d793918573..a3c0cfc4d2 100644 --- a/src/frame-validator.cpp +++ b/src/frame-validator.cpp @@ -19,7 +19,7 @@ namespace librealsense void frame_validator::release() {} - frame_validator::frame_validator(std::shared_ptr sensor, frame_callback_ptr user_callback, stream_profiles current_requests, stream_profiles validator_requests) : + frame_validator::frame_validator(std::shared_ptr sensor, frame_callback_ptr user_callback, stream_profiles current_requests, stream_profiles validator_requests) : _sensor(sensor), _user_callback(user_callback), _user_requests(current_requests), @@ -75,6 +75,11 @@ namespace librealsense { LOG_ERROR("frame_source received corrupted frame ("<<(float)invalid_pixels/(w*h)<<"% invalid pixels), restarting the sensor..."); + + _sensor->get_notifications_processor()->raise_notification({ RS2_NOTIFICATION_CATEGORY_FRAME_CORRUPTED , + 0, + RS2_LOG_SEVERITY_INFO, + "Corrupted Frame Detected\n" }); auto s = _sensor; auto vr = _validator_requests; auto uc = _user_callback; diff --git a/src/frame-validator.h b/src/frame-validator.h index 44ae89c2af..e3e2ff4d16 100644 --- a/src/frame-validator.h +++ b/src/frame-validator.h @@ -34,7 +34,7 @@ namespace librealsense class frame_validator : public rs2_frame_callback { public: - explicit frame_validator(std::shared_ptr sensor, frame_callback_ptr user_callback, stream_profiles user_requests, stream_profiles validator_requests); + explicit frame_validator(std::shared_ptr sensor, frame_callback_ptr user_callback, stream_profiles user_requests, stream_profiles validator_requests); virtual ~frame_validator(); void on_frame(rs2_frame * f) override; @@ -64,6 +64,6 @@ namespace librealsense frame_callback_ptr _user_callback; stream_profiles _user_requests; stream_profiles _validator_requests; - std::shared_ptr _sensor; + std::shared_ptr _sensor; }; } From 78ae4efb4faa0c406d255215aabaa22d327b6eb7 Mon Sep 17 00:00:00 2001 From: NirAz Date: Mon, 27 Apr 2020 11:24:10 +0300 Subject: [PATCH 2/2] Update corrupted frame notification --- src/frame-validator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frame-validator.cpp b/src/frame-validator.cpp index a3c0cfc4d2..765c9e1304 100644 --- a/src/frame-validator.cpp +++ b/src/frame-validator.cpp @@ -78,8 +78,8 @@ namespace librealsense _sensor->get_notifications_processor()->raise_notification({ RS2_NOTIFICATION_CATEGORY_FRAME_CORRUPTED , 0, - RS2_LOG_SEVERITY_INFO, - "Corrupted Frame Detected\n" }); + RS2_LOG_SEVERITY_WARN, + "L500 Corrupted Frame Detected\n" }); auto s = _sensor; auto vr = _validator_requests; auto uc = _user_callback;