public void Update(double time) { if (m_encoder != null) { fcAPI.fcLock(m_rt, (data, fmt) => { m_encoder.AddVideoFrame(data, fmt, time); }); } }
IEnumerator OnPostRender() { if (m_recording && m_encoder != null && Time.frameCount % m_captureEveryNthFrame == 0) { yield return(new WaitForEndOfFrame()); double timestamp = Time.unscaledTime - m_initialTime; if (m_framerateMode == FrameRateMode.Constant) { timestamp = 1.0 / m_targetFramerate * m_recordedFrames; } fcAPI.fcLock(m_scratchBuffer, TextureFormat.RGB24, (data, fmt) => { m_encoder.AddVideoFrame(data, fmt, timestamp); }); ++m_recordedFrames; } ++m_frame; }