private VideoCaptureState getCurrentVideoCaptureState() { VideoCaptureState result = null; PlayGamesPlatform.Instance.Video.GetCaptureState( (status, state) => { bool isSuccess = CommonTypesUtil.StatusIsSuccess(status); if (isSuccess) { if (state.IsCapturing) { result = state; Debug.Log("Currently capturing to " + state.CaptureMode.ToString() + " in " + state.QualityLevel.ToString()); } else { Debug.Log("Not currently capturing."); } } else { Debug.Log("Error: " + status.ToString()); } }); return(result); }
/// <summary> /// Shut down capture /// </summary> private void CloseInterfaces() { int hr; try { if (_mediaCtrl != null) { // Stop the graph hr = _mediaCtrl.Stop(); _mediaCtrl = null; } #if DEBUG if (_rot != null) { _rot.Dispose(); } #endif if (_graphBuilder != null) { Marshal.ReleaseComObject(_graphBuilder); _graphBuilder = null; } _state = VideoCaptureState.UNINITIALIZED; GC.Collect(); } catch (Exception e) { TraceException.WriteLine(e); } }
/// <summary> /// Changes the state. /// </summary> /// <param name="cState">State of the c.</param> private void ChangeState(VideoCaptureState cState) { _state = cState; switch (_state) { case VideoCaptureState.UNINITIALIZED: _canPlay = true; _canStop = false; _canRecord = true; _canPause = false; break; case VideoCaptureState.STOPPED: _canPlay = true; _canStop = false; _canRecord = true; _canPause = false; break; case VideoCaptureState.RUNNING: _canPlay = false; _canStop = true; _canRecord = false; _canPause = true; break; case VideoCaptureState.RECORDING: _canPlay = false; _canStop = true; _canRecord = false; _canPause = true; break; case VideoCaptureState.PAUSED: _canPlay = true; _canStop = true; _canRecord = false; _canPause = false; break; case VideoCaptureState.RECORDING_PAUSED: _canPlay = false; _canStop = true; _canRecord = true; _canPause = false; break; default: _canPlay = true; _canStop = false; _canRecord = true; _canPause = false; break; } }
internal Types.VideoQualityLevel QualityLevel() => VideoCaptureState.VideoCaptureState_QualityLevel(base.SelfPtr());
internal bool IsPaused() => VideoCaptureState.VideoCaptureState_IsPaused(base.SelfPtr());
internal bool IsOverlayVisible() => VideoCaptureState.VideoCaptureState_IsOverlayVisible(base.SelfPtr());
internal bool IsCapturing() => VideoCaptureState.VideoCaptureState_IsCapturing(base.SelfPtr());
internal Types.VideoCaptureMode CaptureMode() => VideoCaptureState.VideoCaptureState_CaptureMode(base.SelfPtr());
protected override void CallDispose(HandleRef selfPointer) { VideoCaptureState.VideoCaptureState_Dispose(selfPointer); }
internal bool IsPaused() { return(VideoCaptureState.VideoCaptureState_IsPaused(SelfPtr())); }
internal bool IsOverlayVisible() { return(VideoCaptureState.VideoCaptureState_IsOverlayVisible(SelfPtr())); }
internal Types.VideoQualityLevel QualityLevel() { return(VideoCaptureState.VideoCaptureState_QualityLevel(SelfPtr())); }
internal Types.VideoCaptureMode CaptureMode() { return(VideoCaptureState.VideoCaptureState_CaptureMode(SelfPtr())); }
internal bool IsCapturing() { return(VideoCaptureState.VideoCaptureState_IsCapturing(SelfPtr())); }