|
|
@ -220,10 +220,9 @@ void CameraViewWidget::paintGL() { |
|
|
|
assert(frames.size() == frame_ids.size()); |
|
|
|
assert(frames.size() == frame_ids.size()); |
|
|
|
if (frames.size() == 0) return; |
|
|
|
if (frames.size() == 0) return; |
|
|
|
|
|
|
|
|
|
|
|
VisionBuf *frame; |
|
|
|
|
|
|
|
std::deque<quint32>::iterator it = std::find(frame_ids.begin(), frame_ids.end(), draw_frame_id); |
|
|
|
std::deque<quint32>::iterator it = std::find(frame_ids.begin(), frame_ids.end(), draw_frame_id); |
|
|
|
int frame_idx = (it == frame_ids.end()) ? (frames.size() - 1) : (it - frame_ids.begin()); |
|
|
|
int frame_idx = (it == frame_ids.end()) ? (frames.size() - 1) : (it - frame_ids.begin()); |
|
|
|
frame = frames[frame_idx]; |
|
|
|
VisionBuf *frame = *frames[frame_idx]; |
|
|
|
|
|
|
|
|
|
|
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); |
|
|
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); |
|
|
|
glViewport(0, 0, width(), height()); |
|
|
|
glViewport(0, 0, width(), height()); |
|
|
@ -274,7 +273,7 @@ void CameraViewWidget::vipcConnected(VisionIpcClient *vipc_client) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CameraViewWidget::vipcFrameReceived(VisionBuf *buf, quint32 frame_id) { |
|
|
|
void CameraViewWidget::vipcFrameReceived(VisionBuf *buf, quint32 frame_id) { |
|
|
|
frames.push_back(buf); |
|
|
|
frames.push_back(std::make_unique<VisionBuf*>(buf)); |
|
|
|
frame_ids.push_back(frame_id); |
|
|
|
frame_ids.push_back(frame_id); |
|
|
|
while (frames.size() > FRAME_BUFFER_SIZE) { |
|
|
|
while (frames.size() > FRAME_BUFFER_SIZE) { |
|
|
|
frames.pop_front(); |
|
|
|
frames.pop_front(); |
|
|
|