private async void StopVideoStream() { try { OperationResult result = await MS2TesterHelper.StopVideoStream(); if (result == OperationResult.Succeeded) { Debug.WriteLine("StopVideoStream: success"); } else { Debug.WriteLine("StopVideoStream: failure"); } if (_videoSource != null) { _videoSource.Stop(); _videoSource = null; } if (_previewSource != null) { _previewSource.Stop(); _previewSource = null; } } catch (Exception e) { Debug.WriteLine(String.Format("StopVideoStream: Exception {0}", e.Message)); } call.NotifyCallEnded(); call = null; }
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 async Task <int> GetOrientation() { int result = 0; try { result = await MS2TesterHelper.GetOrientation(); } catch (Exception e) { Debug.WriteLine(String.Format("GetVideoDevices: Exception {0}", e.Message)); } return(result); }
private async void SetOrientation(int degrees) { try { OperationResult result = await MS2TesterHelper.SetOrientation(degrees); if (result == OperationResult.Succeeded) { Debug.WriteLine("SetOrientation: success"); } else { Debug.WriteLine("SetOrientation: failure"); } } catch (Exception e) { Debug.WriteLine(String.Format("SetOrientation: Exception {0}", e.Message)); } }
private async void ChangeCamera(String camera) { try { OperationResult result = await MS2TesterHelper.ChangeCamera(camera); if (result == OperationResult.Succeeded) { Debug.WriteLine("ChangeCamera: success"); } else { Debug.WriteLine("ChangeCamera: failure"); } } catch (Exception e) { Debug.WriteLine(String.Format("ChangeCamera: Exception {0}", e.Message)); } }
private async void UninitVideo() { try { OperationResult result = await MS2TesterHelper.UninitVideo(); if (result == OperationResult.Succeeded) { Debug.WriteLine("UninitVideo: success"); } else { Debug.WriteLine("UninitVideo: failure"); } } catch (Exception e) { Debug.WriteLine(String.Format("UninitVideo: Exception {0}", e.Message)); } }
private async Task <List <String> > GetVideoDevices() { List <String> result = null; try { result = await MS2TesterHelper.GetVideoDevices(); if (result != null) { Debug.WriteLine("GetVideoDevices: success"); } else { Debug.WriteLine("GetVideoDevices: failure"); } } catch (Exception e) { Debug.WriteLine(String.Format("GetVideoDevices: Exception {0}", e.Message)); } return(result); }