fixed race condition

pull/3471/head
kallaballa 2 years ago
parent 52bd3b8499
commit 709cdcf86d
  1. 2
      modules/v4d/src/detail/clvacontext.cpp
  2. 4
      modules/v4d/src/detail/framebuffercontext.cpp
  3. 2
      modules/v4d/src/v4d.cpp

@ -64,7 +64,7 @@ void CLVAContext::write(std::function<void(const cv::UMat&)> fn, const cv::UMat&
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
CLExecScope_t scope(context_); CLExecScope_t scope(context_);
#endif #endif
fn(videoFrame_); fn(videoFrame_.clone());
} }
} }

@ -60,11 +60,7 @@ FrameBufferContext::FrameBufferContext(const cv::Size& frameBufferSize, bool off
glfwWindowHint(GLFW_ALPHA_BITS, 8); glfwWindowHint(GLFW_ALPHA_BITS, 8);
glfwWindowHint(GLFW_STENCIL_BITS, 8); glfwWindowHint(GLFW_STENCIL_BITS, 8);
glfwWindowHint(GLFW_DEPTH_BITS, 24); glfwWindowHint(GLFW_DEPTH_BITS, 24);
#ifndef __EMSCRIPTEN__
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
#else
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
#endif
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
// glfwWindowHint(GLFW_DOUBLEBUFFER, GL_FALSE); // glfwWindowHint(GLFW_DOUBLEBUFFER, GL_FALSE);

@ -358,7 +358,7 @@ bool V4D::capture(std::function<void(cv::UMat&)> fn) {
} }
} }
currentReaderFrame_ = nextReaderFrame_; currentReaderFrame_ = nextReaderFrame_.clone();
fb([=,this](cv::UMat frameBuffer) { fb([=,this](cv::UMat frameBuffer) {
currentReaderFrame_.copyTo(frameBuffer); currentReaderFrame_.copyTo(frameBuffer);
}); });

Loading…
Cancel
Save