private VideoTrack CreateVideoTrack(IVideoCapturer videoCapturer) { _surfaceTextureHelper = SurfaceTextureHelper.Create("CaptureThread", _eglBase.EglBaseContext); _videoSource = _factory.CreateVideoSource(true); videoCapturer.Initialize(_surfaceTextureHelper, _context, _videoSource.CapturerObserver); videoCapturer.StartCapture(VideoWidth, VideoHeight, 30); _localVideoTrack = _factory.CreateVideoTrack("ARDAMSv0", _videoSource); _localVideoTrack.SetEnabled(true); _localVideoTrack.AddSink(_localVideoSink); return(_localVideoTrack); }
public void SetRemoteVideoTrack(VideoTrack track) { try { var trackId = track?.Name; if (RemoteVideoTrackId == trackId) { return; } RemoteVideoTrackId = trackId; if (UserVideoTrack == null) { UserVideoTrack = track; UserVideoTrack?.AddSink(UserPrimaryVideo); ThumbnailVideo.Visibility = LocalVideoTrack == null ? ViewStates.Invisible : ViewStates.Visible; } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void AddRenderer(IVideoRenderer videoRenderer) { _videoTrack.AddSink(videoRenderer.ToNative <IVideoSink>()); }