Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notification for L500 corrupted frames #6305

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
};
}