Skip to content

Commit

Permalink
applied clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Oct 30, 2024
1 parent 98d1f5c commit f627245
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions src/bb/image-io/rt_u3v.h
Original file line number Diff line number Diff line change
Expand Up @@ -898,42 +898,41 @@ class U3V {
}
}

uint32_t skip_invalid_framecount_0xFFFFFFFF(std::vector<ArvBuffer *>& bufs, uint32_t latest_cnt, int32_t timeout_us){
uint32_t skip_invalid_framecount_0xFFFFFFFF(std::vector<ArvBuffer *> &bufs, uint32_t latest_cnt, int32_t timeout_us) {

uint32_t new_latest_cnt = 0;

int32_t tmp_sig = 0;;
memcpy (&tmp_sig, ((char *) arv_buffer_get_data(bufs[device_idx_], nullptr)), sizeof(int32_t));

if (tmp_sig == 0xFFFFFFFF){
int32_t tmp_sig = 0;
;
memcpy(&tmp_sig, ((char *)arv_buffer_get_data(bufs[device_idx_], nullptr)), sizeof(int32_t));

if (tmp_sig == 0xFFFFFFFF) {
log::trace("GNDC signature with framecount 0xFFFFFFFF: {} ... let's take it again", tmp_sig);
bufs[device_idx_] = arv_stream_timeout_pop_buffer(devices_[device_idx_].stream_, timeout_us);
if (bufs[device_idx_] == nullptr) {
log::error("pop_buffer(L11) failed due to timeout ({}s)", timeout_us * 1e-6f);
throw ::std::runtime_error("buffer is null");
}
devices_[device_idx_].frame_count_ = frame_count_method_ == FrameCountMethod::TYPESPECIFIC3
? static_cast<uint32_t>(get_frame_count_from_genDC_descriptor(bufs[device_idx_], devices_[device_idx_]))
: frame_count_method_ == FrameCountMethod::TIMESTAMP
? static_cast<uint32_t>(arv_buffer_get_timestamp(bufs[device_idx_]) & 0x00000000FFFFFFFF)
: -1;
devices_[device_idx_].frame_count_ = frame_count_method_ == FrameCountMethod::TYPESPECIFIC3 ? static_cast<uint32_t>(get_frame_count_from_genDC_descriptor(bufs[device_idx_], devices_[device_idx_])) : frame_count_method_ == FrameCountMethod::TIMESTAMP ? static_cast<uint32_t>(arv_buffer_get_timestamp(bufs[device_idx_]) & 0x00000000FFFFFFFF) :
-1;
new_latest_cnt = devices_[device_idx_].frame_count_;
device_idx_ == 0 ?
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", devices_[device_idx_].frame_count_, "") :
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", "", devices_[device_idx_].frame_count_);
tmp_sig = 0;;
memcpy (&tmp_sig, ((char *) arv_buffer_get_data(bufs[device_idx_], nullptr)), sizeof(int32_t));
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", devices_[device_idx_].frame_count_, "") :
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", "", devices_[device_idx_].frame_count_);
tmp_sig = 0;
;
memcpy(&tmp_sig, ((char *)arv_buffer_get_data(bufs[device_idx_], nullptr)), sizeof(int32_t));

if (new_latest_cnt == 0xFFFFFFFF){
if (new_latest_cnt == 0xFFFFFFFF) {
log::error("pop_buffer(L12) failed due to sequential invalid framecount {}", latest_cnt, tmp_sig);
throw ::std::runtime_error("buffer is null");
}

return new_latest_cnt;
}else{
} else {
log::error("pop_buffer(L13) failed due to invalid framecount {} with signature {}", latest_cnt, tmp_sig);
throw ::std::runtime_error("buffer is null");
}
}
}

g_object_unref_t g_object_unref;
Expand Down Expand Up @@ -1177,7 +1176,7 @@ class U3VRealCam : public U3V {
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", devices_[device_idx_].frame_count_, "") :
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", "", devices_[device_idx_].frame_count_);

if (latest_cnt == 0xFFFFFFFF && frame_count_method_ == FrameCountMethod::TYPESPECIFIC3 ){
if (latest_cnt == 0xFFFFFFFF && frame_count_method_ == FrameCountMethod::TYPESPECIFIC3) {
latest_cnt = skip_invalid_framecount_0xFFFFFFFF(bufs, latest_cnt, timeout_us);
}

Expand Down Expand Up @@ -1330,7 +1329,7 @@ class U3VGenDC : public U3V {
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", devices_[device_idx_].frame_count_, "") :
log::trace("All-Popped Frames (USB0, USB1)=({:20}, {:20})", "", devices_[device_idx_].frame_count_);

if (latest_cnt == 0xFFFFFFFF && frame_count_method_ == FrameCountMethod::TYPESPECIFIC3 ){
if (latest_cnt == 0xFFFFFFFF && frame_count_method_ == FrameCountMethod::TYPESPECIFIC3) {
latest_cnt = skip_invalid_framecount_0xFFFFFFFF(bufs, latest_cnt, timeout_us);
}

Expand Down

0 comments on commit f627245

Please sign in to comment.