  
  } // namespace
  
  CameraWidget::CameraWidget(std::string stream_name, VisionStreamType type, bool zoom, QWidget* parent) :
                                     stream_name(stream_name), stream_type(type), zoomed_view(zoom), QOpenGLWidget(parent) {
    setAttribute(Qt::WA_OpaquePaintEvent);
    QObject::connect(this, &CameraWidget::vipcThreadConnected, this, &CameraWidget::vipcConnected, Qt::BlockingQueuedConnection);
    QObject::connect(this, &CameraWidget::vipcThreadFrameReceived, this, &CameraWidget::vipcFrameReceived, Qt::QueuedConnection);
  }
  
 
</s> remove   void setStreamType(VisionStreamType type) { stream_type = type; }
 </s> add  </s> remove 
  if (sm.updated("carState")) {
    float v_ego = sm["carState"].getCarState().getVEgo();
    // TODO: support replays without ecam by using fcam
    // Wide or narrow cam dependent on speed
    if ((v_ego < 10) || s->wide_cam_only) {
      scene.wide_cam = true;
    } else if (v_ego > 15) {
      scene.wide_cam = false;
    }
  }
 </s> add  </s> remove   VisionStreamType cur_stream_type = stream_type;
 </s> add   VisionStreamType cur_stream = requested_stream_type;
                          stream_name(stream_name), requested_stream_type(type), zoomed_view(zoom), QOpenGLWidget(parent) {
  
  } // namespace
  
  CameraWidget::CameraWidget(std::string stream_name, VisionStreamType type, bool zoom, QWidget* parent) :
                          stream_name(stream_name), requested_stream_type(type), zoomed_view(zoom), QOpenGLWidget(parent) {
    setAttribute(Qt::WA_OpaquePaintEvent);
    QObject::connect(this, &CameraWidget::vipcThreadConnected, this, &CameraWidget::vipcConnected, Qt::BlockingQueuedConnection);
    QObject::connect(this, &CameraWidget::vipcThreadFrameReceived, this, &CameraWidget::vipcFrameReceived, Qt::QueuedConnection);
  }
  
keep keep keep keep replace keep keep keep keep keep
 UI: draw onroad objects on right frame (#26306)

* update before draw

* fix a lot of janky

* fix more flicker

* cleanup

* fix flicker when opening settings

* simplify 
selfdrive/ui/qt/widgets/cameraview.cc