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);
        }
Ejemplo n.º 2
0
        /// <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);
            }
        }
Ejemplo n.º 3
0
        /// <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;
            }
        }
Ejemplo n.º 4
0
 internal Types.VideoQualityLevel QualityLevel() =>
 VideoCaptureState.VideoCaptureState_QualityLevel(base.SelfPtr());
Ejemplo n.º 5
0
 internal bool IsPaused() =>
 VideoCaptureState.VideoCaptureState_IsPaused(base.SelfPtr());
Ejemplo n.º 6
0
 internal bool IsOverlayVisible() =>
 VideoCaptureState.VideoCaptureState_IsOverlayVisible(base.SelfPtr());
Ejemplo n.º 7
0
 internal bool IsCapturing() =>
 VideoCaptureState.VideoCaptureState_IsCapturing(base.SelfPtr());
Ejemplo n.º 8
0
 internal Types.VideoCaptureMode CaptureMode() =>
 VideoCaptureState.VideoCaptureState_CaptureMode(base.SelfPtr());
Ejemplo n.º 9
0
 protected override void CallDispose(HandleRef selfPointer)
 {
     VideoCaptureState.VideoCaptureState_Dispose(selfPointer);
 }
Ejemplo n.º 10
0
        /// <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);
            }
        }
Ejemplo n.º 11
0
        /// <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;
            }
        }
Ejemplo n.º 12
0
 internal bool IsPaused()
 {
     return(VideoCaptureState.VideoCaptureState_IsPaused(SelfPtr()));
 }
Ejemplo n.º 13
0
 internal bool IsOverlayVisible()
 {
     return(VideoCaptureState.VideoCaptureState_IsOverlayVisible(SelfPtr()));
 }
Ejemplo n.º 14
0
 internal Types.VideoQualityLevel QualityLevel()
 {
     return(VideoCaptureState.VideoCaptureState_QualityLevel(SelfPtr()));
 }
Ejemplo n.º 15
0
 internal Types.VideoCaptureMode CaptureMode()
 {
     return(VideoCaptureState.VideoCaptureState_CaptureMode(SelfPtr()));
 }
Ejemplo n.º 16
0
 internal bool IsCapturing()
 {
     return(VideoCaptureState.VideoCaptureState_IsCapturing(SelfPtr()));
 }