Example #1
0
        bool VideoFrameObserver.OnPreEncodeVideFrame(VideoFrame frame)
        {
            var result = OnPreEncodeVideFrame == null ? true : OnPreEncodeVideFrame(frame);

            localVideo?.Render(frame);
            if (firstLocalVideoFrameElapsed.HasValue && localVideo != null)
            {
                TimeSpan elapsed = new TimeSpan(DateTime.Now.Ticks - firstLocalVideoFrameElapsed.Value.Ticks);
                OnFirstLocalVideoFrame?.Invoke(frame.width, frame.height, (uint)elapsed.TotalMilliseconds);
                firstLocalVideoFrameElapsed = null;
            }
            return(result);
        }
Example #2
0
 void AgoraRtcEventHandler.OnFirstLocalVideoFrame(uint width, uint height, uint elapsed)
 {
     OnFirstLocalVideoFrame?.Invoke(width, height, elapsed);
 }