| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -58,8 +58,10 @@ bool Replay::load() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  for (auto &[n, f] : route_->segments()) { | 
					 | 
					 | 
					 | 
					  for (auto &[n, f] : route_->segments()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if ((!f.rlog.isEmpty() || !f.qlog.isEmpty()) && (!f.road_cam.isEmpty() || !f.qcamera.isEmpty())) { | 
					 | 
					 | 
					 | 
					    bool has_log = !f.rlog.isEmpty() || !f.qlog.isEmpty(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      segments_[n] = nullptr; | 
					 | 
					 | 
					 | 
					    bool has_video = !f.road_cam.isEmpty() || !f.qcamera.isEmpty(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if (has_log && (has_video || hasFlag(REPLAY_FLAG_NO_VIPC))) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      segments_.insert({n, nullptr}); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  if (segments_.empty()) { | 
					 | 
					 | 
					 | 
					  if (segments_.empty()) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -218,6 +220,7 @@ void Replay::startStream(const Segment *cur_segment) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // start camera server
 | 
					 | 
					 | 
					 | 
					  // start camera server
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  if (!hasFlag(REPLAY_FLAG_NO_VIPC)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    std::pair<int, int> camera_size[MAX_CAMERAS] = {}; | 
					 | 
					 | 
					 | 
					    std::pair<int, int> camera_size[MAX_CAMERAS] = {}; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for (auto type : ALL_CAMERAS) { | 
					 | 
					 | 
					 | 
					    for (auto type : ALL_CAMERAS) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      if (auto &fr = cur_segment->frames[type]) { | 
					 | 
					 | 
					 | 
					      if (auto &fr = cur_segment->frames[type]) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -225,6 +228,7 @@ void Replay::startStream(const Segment *cur_segment) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      } | 
					 | 
					 | 
					 | 
					      } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    camera_server_ = std::make_unique<CameraServer>(camera_size, hasFlag(REPLAY_FLAG_SEND_YUV)); | 
					 | 
					 | 
					 | 
					    camera_server_ = std::make_unique<CameraServer>(camera_size, hasFlag(REPLAY_FLAG_SEND_YUV)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  // start stream thread
 | 
					 | 
					 | 
					 | 
					  // start stream thread
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  stream_thread_ = new QThread(); | 
					 | 
					 | 
					 | 
					  stream_thread_ = new QThread(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -318,18 +322,20 @@ void Replay::stream() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          precise_nano_sleep(behind_ns); | 
					 | 
					 | 
					 | 
					          precise_nano_sleep(behind_ns); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (evt->frame) { | 
					 | 
					 | 
					 | 
					        if (!evt->frame) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					          publishMessage(evt); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } else if (camera_server_) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          if (hasFlag(REPLAY_FLAG_FULL_SPEED)) { | 
					 | 
					 | 
					 | 
					          if (hasFlag(REPLAY_FLAG_FULL_SPEED)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            camera_server_->waitFinish(); | 
					 | 
					 | 
					 | 
					            camera_server_->waitFinish(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          } | 
					 | 
					 | 
					 | 
					          } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          publishFrame(evt); | 
					 | 
					 | 
					 | 
					          publishFrame(evt); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } else { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					          publishMessage(evt); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      } | 
					 | 
					 | 
					 | 
					      } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // wait for frame to be sent before unlock.(frameReader may be deleted after unlock)
 | 
					 | 
					 | 
					 | 
					    // wait for frame to be sent before unlock.(frameReader may be deleted after unlock)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if (camera_server_) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      camera_server_->waitFinish(); | 
					 | 
					 | 
					 | 
					      camera_server_->waitFinish(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (eit == events_->end() && !hasFlag(REPLAY_FLAG_NO_LOOP)) { | 
					 | 
					 | 
					 | 
					    if (eit == events_->end() && !hasFlag(REPLAY_FLAG_NO_LOOP)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      int last_segment = segments_.rbegin()->first; | 
					 | 
					 | 
					 | 
					      int last_segment = segments_.rbegin()->first; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |