IVideoClient.cs 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // <copyright file="IVideoClient.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;
  19. using System.Collections.Generic;
  20. /// <summary>
  21. /// An interface for interacting with the video recording API.
  22. /// </summary>
  23. /// <remarks>
  24. /// All callbacks in this interface must be invoked on the game thread.
  25. /// </remarks>
  26. public interface IVideoClient
  27. {
  28. /// <summary>
  29. /// Fetches the video capabilities of the service.
  30. /// </summary>
  31. /// <remarks>Includes whether the mic or front-facing camera are supported,
  32. /// if the service can write to external storage, and what capture modes
  33. /// and quality levels are available.
  34. /// </remarks>
  35. /// <param name="callback">The callback for the results. The passed capabilities will be non-null if
  36. /// and only if the request succeeded. This callback will be invoked on the game thread.</param>
  37. void GetCaptureCapabilities(Action<ResponseStatus, VideoCapabilities> callback);
  38. /// <summary>
  39. /// Launches the video capture overlay.
  40. /// </summary>
  41. void ShowCaptureOverlay();
  42. /// <summary>
  43. /// Fetches the current state of the capture service.
  44. /// </summary>
  45. /// <remarks>
  46. /// This will inform about whether the capture overlay is visible,
  47. /// if the overlay is actively being used to capture, and much more.
  48. /// See <see cref="VideoCaptureState"/> for more details.
  49. /// </remarks>
  50. /// <param name="callback">The callback for the results. The passed capture state will be non-null if
  51. /// and only if the request succeeded. This callback will be invoked on the game thread.</param>
  52. void GetCaptureState(Action<ResponseStatus, VideoCaptureState> callback);
  53. /// <summary>
  54. /// Fetches if the capture service is already in use or not.
  55. /// </summary>
  56. /// <remarks>
  57. /// Use this call to check if a start capture api call will return ErrorVideoAlreadyCapturing.
  58. /// If this returns true, then its safe to start capturing.
  59. ///
  60. /// Do not use this call to check if capture is supported, instead use
  61. /// <see cref="IsCaptureSupported"/> or <see cref="GetCaptureCapabilities"/>.
  62. /// </remarks>
  63. /// <param name="captureMode"></param>
  64. /// <param name="callback">The callback for the results.
  65. /// This callback will be invoked on the game thread.</param>
  66. void IsCaptureAvailable(VideoCaptureMode captureMode, Action<ResponseStatus, bool> callback);
  67. /// <summary>
  68. /// Synchronous simple check to determine if the device supports capture.
  69. /// </summary>
  70. /// <returns>If video capture is supported on this device.</returns>
  71. bool IsCaptureSupported();
  72. /// <summary>
  73. /// Register a listener to listen for changes to the video capture overlay state.
  74. /// </summary>
  75. /// <remarks>
  76. /// Note that only one overlay state listener may be active at a time.
  77. /// Calling this method while another overlay state listener was previously
  78. /// registered will replace the original listener with the new one.
  79. /// </remarks>
  80. /// <param name="listener"></param>
  81. void RegisterCaptureOverlayStateChangedListener(CaptureOverlayStateListener listener);
  82. /// <summary>
  83. /// Unregisters this client's overlay state update listener, if any.
  84. /// </summary>
  85. void UnregisterCaptureOverlayStateChangedListener();
  86. }
  87. }