Call to OpenGL ES API with no current context (logged once per thread) Error Google DepthAPI

30 Views Asked by At

I am getting following error while trying to log Depth Image from Google Depth API

  if (camera.trackingState == TrackingState.TRACKING && shouldGetDepthImage) {
      try {
        val depthImage = frame.acquireDepthImage16Bits()
        //Get center x and y position of surface
       // val point = render.point
        //val depthValue = getMillimetersDepth(depthImage, 100, 100)
        count++
        if (count == 100){
          saveDepthImage = depthImage
        }
        //Log.d("Count", count.toString())
        backgroundRenderer.updateCameraDepthTexture(depthImage)
        depthImage.close()
      } catch (e: NotYetAvailableException) {
        // This normally means that depth data is not available yet. This is normal so we will not
        // spam the logcat with this.
      }
    }

 Log.d("Count", saveDepthImage.toString()) //Error here.
0

There are 0 best solutions below