Skip to content

Commit

Permalink
Merge pull request #6145 from maloel/fixes
Browse files Browse the repository at this point in the history
Small fixes for realsense-viewer with OpenVINO
  • Loading branch information
ev-mp committed Mar 29, 2020
2 parents 45f86e5 + 87cee9e commit 58fc51f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
17 changes: 16 additions & 1 deletion common/post-processing-filters-list.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@ struct post_processing_filters_list
auto & filters = get();
return filters.insert(
filters.end(),
[name]() -> std::shared_ptr< post_processing_filter > { return std::make_shared< T >( name ); }
[name]() -> std::shared_ptr< post_processing_filter >
{
try
{
return std::make_shared< T >( name );
}
catch( std::exception const& e )
{
LOG( ERROR ) << "Failed to start " << name << ": " << e.what();
}
catch( ... )
{
LOG( ERROR ) << "Failed to start " << name << ": unknown exception";
}
return std::shared_ptr< T >();
}
);
}
};
Expand Down
11 changes: 7 additions & 4 deletions tools/realsense-viewer/realsense-viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
// to initialize ours if we want to use the APIs!
INITIALIZE_EASYLOGGINGPP
#endif

using namespace rs2;
using namespace rs400;

Expand Down Expand Up @@ -308,7 +307,7 @@ int main(int argc, const char** argv) try
}
}

#if 1
#ifdef BUILD_SHARED_LIBS
// Configure the logger
el::Configurations conf;
conf.set( el::Level::Global, el::ConfigurationType::Format, "[%level] %msg" );
Expand All @@ -334,10 +333,14 @@ int main(int argc, const char** argv) try
el::Helpers::installLogDispatchCallback< viewer_model_dispatcher >( "viewer_model_dispatcher" );
auto dispatcher = el::Helpers::logDispatchCallback< viewer_model_dispatcher >( "viewer_model_dispatcher" );
dispatcher->vm = &viewer_model;
// Remove the default logger (which will log to standard out/err) or it'll still be active
el::Helpers::uninstallLogDispatchCallback< el::base::DefaultLogDispatchCallback >( "DefaultLogDispatchCallback" );
#else
rs2::log_to_callback( RS2_LOG_SEVERITY_INFO,
[&]( rs2_log_severity severity, rs2::log_message const& msg )
{
viewer_model.not_model.add_log( msg.raw() );
} );
#endif

window.on_file_drop = [&](std::string filename)
{

Expand Down

0 comments on commit 58fc51f

Please sign in to comment.