public void SwapBuffers(long timeStampNs) { CheckIsNotReleased(); if (_eglSurface == EGL14.EglNoSurface) { throw new RuntimeException("No EGLSurface - can't swap buffers"); } lock (EglBase.Lock) { EGLExt.EglPresentationTimeANDROID(_eglDisplay, _eglSurface, timeStampNs); EGL14.EglSwapBuffers(_eglDisplay, _eglSurface); } }
public void AddFrame(byte[] image) { Debug.WriteLine($"Sending frame {frameIndex} to encoder"); long presentationTime = ComputePresentationTimeNsec(frameIndex++); EGLExt.EglPresentationTimeANDROID(eglDisplay, eglSurface, presentationTime); CheckEglError(); EGL14.EglSwapBuffers(eglDisplay, eglSurface); CheckEglError(); DrainEncoder(videoEncoder, videoBufferInfo, videoTrackIndex, false); }
/** * Sends the presentation time stamp to EGL. Time is expressed in nanoseconds. */ public void setPresentationTime(long nsecs) { EGLExt.EglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs); checkEglError("eglPresentationTimeANDROID"); }
/** * Sends the presentation time stamp to EGL. Time is expressed in nanoseconds. */ public void SetPresentationTime(long nsecs) { EGLExt.EglPresentationTimeANDROID(_EGLDisplay, _EGLSurface, nsecs); }