private async void StartVideoStream(String camera, String codec, String videoSize, UInt32 frameRate, UInt32 bitRate, Boolean usePreviewStream) { try { _videoSource = new MSWinRTVideo.SwapChainPanelSource(); _videoSource.Start(VideoSwapChainPanel); _previewSource = new MSWinRTVideo.SwapChainPanelSource(); _previewSource.Start(PreviewSwapChainPanel); var vcc = VoipCallCoordinator.GetDefault(); var entryPoint = typeof(PhoneCallTask).FullName; var status = await vcc.ReserveCallResourcesAsync(entryPoint); var capabilities = VoipPhoneCallMedia.Audio | VoipPhoneCallMedia.Video; call = vcc.RequestNewOutgoingCall("FooContext", "FooContact", "MS2Tester", capabilities); call.NotifyCallActive(); OperationResult result = await MS2TesterHelper.StartVideoStream(VideoSwapChainPanel.Name, PreviewSwapChainPanel.Name, camera, codec, videoSize, frameRate, bitRate, usePreviewStream); if (result == OperationResult.Succeeded) { Debug.WriteLine("StartVideoStream: success"); } else { Debug.WriteLine("StartVideoStream: failure"); } } catch (Exception e) { Debug.WriteLine(String.Format("StartVideoStream: Exception {0}", e.Message)); } }
private void StartVideoStream() { try { _videoSource = new MSWinRTVideo.SwapChainPanelSource(); _videoSource.Start(VideoSwapChainPanel); _previewSource = new MSWinRTVideo.SwapChainPanelSource(); _previewSource.Start(PreviewSwapChainPanel); LinphoneManager.Instance.Core.NativeVideoWindowId = VideoSwapChainPanel.Name; LinphoneManager.Instance.Core.NativePreviewWindowId = PreviewSwapChainPanel.Name; } catch (Exception e) { Debug.WriteLine(String.Format("StartVideoStream: Exception {0}", e.Message)); } }
private void StopVideoStream() { try { if (_videoSource != null) { _videoSource.Stop(); _videoSource = null; } if (_previewSource != null) { _previewSource.Stop(); _previewSource = null; } } catch (Exception e) { Debug.WriteLine(String.Format("StartVideoStream: Exception {0}", e.Message)); } }