Skip to content

Commit

Permalink
Merge pull request #6305 from Nir-Az/add_notification_for_corrupted_f…
Browse files Browse the repository at this point in the history
…rames

Add notification for L500 corrupted frames
  • Loading branch information
dorodnic authored Apr 27, 2020
2 parents a6275d8 + 78ae4ef commit 40bc266
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/frame-validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace librealsense
void frame_validator::release()
{}

frame_validator::frame_validator(std::shared_ptr<sensor_interface> sensor, frame_callback_ptr user_callback, stream_profiles current_requests, stream_profiles validator_requests) :
frame_validator::frame_validator(std::shared_ptr<sensor_base> sensor, frame_callback_ptr user_callback, stream_profiles current_requests, stream_profiles validator_requests) :
_sensor(sensor),
_user_callback(user_callback),
_user_requests(current_requests),
Expand Down Expand Up @@ -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_WARN,
"L500 Corrupted Frame Detected\n" });
auto s = _sensor;
auto vr = _validator_requests;
auto uc = _user_callback;
Expand Down
4 changes: 2 additions & 2 deletions src/frame-validator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace librealsense
class frame_validator : public rs2_frame_callback
{
public:
explicit frame_validator(std::shared_ptr<sensor_interface> sensor, frame_callback_ptr user_callback, stream_profiles user_requests, stream_profiles validator_requests);
explicit frame_validator(std::shared_ptr<sensor_base> sensor, frame_callback_ptr user_callback, stream_profiles user_requests, stream_profiles validator_requests);
virtual ~frame_validator();

void on_frame(rs2_frame * f) override;
Expand Down Expand Up @@ -64,6 +64,6 @@ namespace librealsense
frame_callback_ptr _user_callback;
stream_profiles _user_requests;
stream_profiles _validator_requests;
std::shared_ptr<sensor_interface> _sensor;
std::shared_ptr<sensor_base> _sensor;
};
}

0 comments on commit 40bc266

Please sign in to comment.