|
|
@ -232,7 +232,6 @@ void encoder_thread(RotateState *rotate_state, bool is_streaming, bool raw_clips |
|
|
|
|
|
|
|
|
|
|
|
int encoder_segment = -1; |
|
|
|
int encoder_segment = -1; |
|
|
|
int cnt = 0; |
|
|
|
int cnt = 0; |
|
|
|
rotate_state->enabled = true; |
|
|
|
|
|
|
|
pthread_mutex_lock(&s.rotate_lock); |
|
|
|
pthread_mutex_lock(&s.rotate_lock); |
|
|
|
int my_idx = s.num_encoder; |
|
|
|
int my_idx = s.num_encoder; |
|
|
|
s.num_encoder += 1; |
|
|
|
s.num_encoder += 1; |
|
|
@ -683,14 +682,17 @@ int main(int argc, char** argv) { |
|
|
|
#ifndef DISABLE_ENCODER |
|
|
|
#ifndef DISABLE_ENCODER |
|
|
|
// rear camera
|
|
|
|
// rear camera
|
|
|
|
std::thread encoder_thread_handle(encoder_thread, &s.rotate_state[LOG_CAMERA_ID_FCAMERA], is_streaming, false, LOG_CAMERA_ID_FCAMERA); |
|
|
|
std::thread encoder_thread_handle(encoder_thread, &s.rotate_state[LOG_CAMERA_ID_FCAMERA], is_streaming, false, LOG_CAMERA_ID_FCAMERA); |
|
|
|
|
|
|
|
s.rotate_state[LOG_CAMERA_ID_FCAMERA].enabled = true; |
|
|
|
// front camera
|
|
|
|
// front camera
|
|
|
|
std::thread front_encoder_thread_handle; |
|
|
|
std::thread front_encoder_thread_handle; |
|
|
|
if (record_front) { |
|
|
|
if (record_front) { |
|
|
|
front_encoder_thread_handle = std::thread(encoder_thread, &s.rotate_state[LOG_CAMERA_ID_DCAMERA], false, false, LOG_CAMERA_ID_DCAMERA); |
|
|
|
front_encoder_thread_handle = std::thread(encoder_thread, &s.rotate_state[LOG_CAMERA_ID_DCAMERA], false, false, LOG_CAMERA_ID_DCAMERA); |
|
|
|
|
|
|
|
s.rotate_state[LOG_CAMERA_ID_DCAMERA].enabled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
#ifdef QCOM2 |
|
|
|
#ifdef QCOM2 |
|
|
|
// wide camera
|
|
|
|
// wide camera
|
|
|
|
std::thread wide_encoder_thread_handle(encoder_thread, &s.rotate_state[LOG_CAMERA_ID_ECAMERA], false, false, LOG_CAMERA_ID_ECAMERA); |
|
|
|
std::thread wide_encoder_thread_handle(encoder_thread, &s.rotate_state[LOG_CAMERA_ID_ECAMERA], false, false, LOG_CAMERA_ID_ECAMERA); |
|
|
|
|
|
|
|
s.rotate_state[LOG_CAMERA_ID_ECAMERA].enabled = true; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -770,7 +772,7 @@ int main(int argc, char** argv) { |
|
|
|
for (int cid=0;cid<=MAX_CAM_IDX;cid++) { |
|
|
|
for (int cid=0;cid<=MAX_CAM_IDX;cid++) { |
|
|
|
// this *should* be redundant on tici since all camera frames are synced
|
|
|
|
// this *should* be redundant on tici since all camera frames are synced
|
|
|
|
new_segment &= (((s.rotate_state[cid].stream_frame_id >= s.rotate_state[cid].last_rotate_frame_id + segment_length * MAIN_FPS) && |
|
|
|
new_segment &= (((s.rotate_state[cid].stream_frame_id >= s.rotate_state[cid].last_rotate_frame_id + segment_length * MAIN_FPS) && |
|
|
|
(!s.rotate_state[cid].should_rotate)) || |
|
|
|
(!s.rotate_state[cid].should_rotate) && (s.rotate_state[cid].last_rotate_frame_id != UINT32_MAX)) || |
|
|
|
(!s.rotate_state[cid].enabled)); |
|
|
|
(!s.rotate_state[cid].enabled)); |
|
|
|
if (last_seen_log_frame_id[cid] + 2 < last_seen_log_frame_id_max) { LOGW("camera %d lags behind", cid); } |
|
|
|
if (last_seen_log_frame_id[cid] + 2 < last_seen_log_frame_id_max) { LOGW("camera %d lags behind", cid); } |
|
|
|
#ifndef QCOM2 |
|
|
|
#ifndef QCOM2 |
|
|
|