Skip to content

Commit

Permalink
Fix the crash issue in HDR Sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzcyf committed Sep 7, 2024
1 parent 8cf7f97 commit 69e5f4b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions examples/3.advanced.hdr/hdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(void) try {
// configure and enable Hdr stream
OBHdrConfig obHdrConfig;
obHdrConfig.enable = true; // enable HDR merge
obHdrConfig.exposure_1 = 7500;
obHdrConfig.exposure_1 = 7500;
obHdrConfig.gain_1 = 24;
obHdrConfig.exposure_2 = 100;
obHdrConfig.gain_2 = 16;
Expand Down Expand Up @@ -83,13 +83,18 @@ int main(void) try {
win.pushFramesToView(depthFrame, groupId);

if(mergeRequired) {
// Using HDRMerge post processor to merge depth frames
auto mergedDepthFrame = hdrMerge->process(depthFrame);
if(mergedDepthFrame == nullptr) {
continue;
try {
// Using HDRMerge post processor to merge depth frames
auto mergedDepthFrame = hdrMerge->process(depthFrame);
if(mergedDepthFrame == nullptr) {
continue;
}
// add merged depth frame to render queue
win.pushFramesToView(mergedDepthFrame, 10); // set the group id to 10 to avoid same group id with original depth frame
}
catch(ob::Error &e) {
std::cerr << "HDRMerge error: " << e.what() << std::endl;
}
// add merged depth frame to render queue
win.pushFramesToView(mergedDepthFrame, 10); // set the group id to 10 to avoid same group id with original depth frame
}
}

Expand Down

0 comments on commit 69e5f4b

Please sign in to comment.