VideoCaptureState.cs 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // <copyright file="VideoCaptureState.cs" company="Google Inc.">
  2. // Copyright (C) 2016 Google Inc.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. // </copyright>
  16. namespace GooglePlayGames.BasicApi.Video
  17. {
  18. using System.Collections.Generic;
  19. using System.Linq;
  20. using GooglePlayGames.OurUtils;
  21. /// <summary>
  22. /// Represents the video recording capabilities.
  23. /// </summary>
  24. public class VideoCaptureState
  25. {
  26. private bool mIsCapturing;
  27. private VideoCaptureMode mCaptureMode;
  28. private VideoQualityLevel mQualityLevel;
  29. private bool mIsOverlayVisible;
  30. private bool mIsPaused;
  31. internal VideoCaptureState(bool isCapturing, VideoCaptureMode captureMode,
  32. VideoQualityLevel qualityLevel, bool isOverlayVisible, bool isPaused)
  33. {
  34. mIsCapturing = isCapturing;
  35. mCaptureMode = captureMode;
  36. mQualityLevel = qualityLevel;
  37. mIsOverlayVisible = isOverlayVisible;
  38. mIsPaused = isPaused;
  39. }
  40. /// <summary>Returns whether the service is currently capturing or not.</summary>
  41. public bool IsCapturing
  42. {
  43. get { return mIsCapturing; }
  44. }
  45. /// <summary>Returns the capture mode of the current capture.</summary>
  46. public VideoCaptureMode CaptureMode
  47. {
  48. get { return mCaptureMode; }
  49. }
  50. /// <summary>Returns the quality level of the current capture.</summary>
  51. public VideoQualityLevel QualityLevel
  52. {
  53. get { return mQualityLevel; }
  54. }
  55. /// <summary>
  56. /// Returns whether the capture overlay is currently visible or not.
  57. /// </summary>
  58. /// <remarks>
  59. /// This also indicates the capture overlay is being used by the user and background capture will fail.
  60. /// </remarks>
  61. public bool IsOverlayVisible
  62. {
  63. get { return mIsOverlayVisible; }
  64. }
  65. /// <summary>
  66. /// Returns whether the capture is currently paused or not.
  67. /// </summary>
  68. /// <remarks>
  69. /// Will always be <code>false</code> if <code>IsCapturing</code> if <code>false</code>.
  70. /// </remarks>
  71. public bool IsPaused
  72. {
  73. get { return mIsPaused; }
  74. }
  75. public override string ToString()
  76. {
  77. return string.Format("[VideoCaptureState: mIsCapturing={0}, mCaptureMode={1}, mQualityLevel={2}, " +
  78. "mIsOverlayVisible={3}, mIsPaused={4}]",
  79. mIsCapturing,
  80. mCaptureMode.ToString(),
  81. mQualityLevel.ToString(),
  82. mIsOverlayVisible,
  83. mIsPaused);
  84. }
  85. }
  86. }