Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c034c8b2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use std::shared_future to pass Surface from the render thread" into main

parents 6a14ba0b 9fcd0264
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -313,7 +313,8 @@ VirtualCameraRenderThread::VirtualCameraRenderThread(
    : mCameraDeviceCallback(cameraDeviceCallback),
      mInputSurfaceSize(inputSurfaceSize),
      mReportedSensorSize(reportedSensorSize),
      mSessionContext(sessionContext) {
      mSessionContext(sessionContext),
      mInputSurfaceFuture(mInputSurfacePromise.get_future()) {
}

VirtualCameraRenderThread::~VirtualCameraRenderThread() {
@@ -373,7 +374,7 @@ void VirtualCameraRenderThread::stop() {
}

sp<Surface> VirtualCameraRenderThread::getInputSurface() {
  return mInputSurfacePromise.get_future().get();
  return mInputSurfaceFuture.get();
}

std::unique_ptr<ProcessCaptureRequestTask>
+1 −0
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ class VirtualCameraRenderThread {
  std::unique_ptr<EglSurfaceTexture> mEglSurfaceTexture;

  std::promise<sp<Surface>> mInputSurfacePromise;
  std::shared_future<sp<Surface>> mInputSurfaceFuture;
};

}  // namespace virtualcamera