예제 #1
0
 public void Update(double time)
 {
     if (m_encoder != null)
     {
         fcAPI.fcLock(m_rt, (data, fmt) =>
         {
             m_encoder.AddVideoFrame(data, fmt, time);
         });
     }
 }
예제 #2
0
        IEnumerator OnPostRender()
        {
            if (m_recording && m_encoder != null && Time.frameCount % m_captureEveryNthFrame == 0)
            {
                yield return(new WaitForEndOfFrame());

                double timestamp = Time.unscaledTime;
                if (m_framerateMode == FrameRateMode.Constant)
                {
                    timestamp = 1.0 / m_targetFramerate * m_numVideoFrames;
                }

                fcAPI.fcLock(m_scratchBuffer, TextureFormat.RGB24, (data, fmt) => {
                    m_encoder.AddVideoFrame(data, fmt, timestamp);
                });
                m_numVideoFrames++;
            }
        }