Skip to content

Commit

Permalink
allows to get 1 camera's framecount with 2 USB
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Nov 10, 2023
1 parent 3ebfad8 commit 992d391
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/bb/image-io/rt_u3v.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,14 @@ class U3V {
}

void get_frame_count(void * out){
for (int nd = 0; nd < num_sensor_; nd++){
uint32_t fc32 = static_cast<uint32_t>(devices_[nd].frame_count_);
::memcpy(reinterpret_cast<uint32_t*>(out) + nd, &fc32, sizeof(uint32_t));
if (num_sensor_ != devices_.size()){
uint32_t fc32 = static_cast<uint32_t>(frame_cnt_);
::memcpy(reinterpret_cast<uint32_t*>(out), &fc32, sizeof(uint32_t));
}else{
for (int nd = 0; nd < num_sensor_; nd++){
uint32_t fc32 = static_cast<uint32_t>(devices_[nd].frame_count_);
::memcpy(reinterpret_cast<uint32_t*>(out) + nd, &fc32, sizeof(uint32_t));
}
}
}

Expand Down Expand Up @@ -953,7 +958,7 @@ int u3v_camera_frame_count(
return 1;
}
}

} // namespace image_io
} // namespace bb
} // namespace ion
Expand Down

0 comments on commit 992d391

Please sign in to comment.