iVideoClient.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /// <param name="callback">The callback, with a <see cref="ResponseStatus"/> when the overlay closes or has an error.</param>
  42. void ShowCaptureOverlay();
  43. /// <summary>
  44. /// Fetches the current state of the capture service.
  45. /// </summary>
  46. /// <remarks>
  47. /// This will inform about whether the capture overlay is visible,
  48. /// if the overlay is actively being used to capture, and much more.
  49. /// See <see cref="VideoCaptureState"/> for more details.
  50. /// </remarks>
  51. /// <param name="callback">The callback for the results. The passed capture state will be non-null if
  52. /// and only if the request succeeded. This callback will be invoked on the game thread.</param>
  53. void GetCaptureState(Action<ResponseStatus, VideoCaptureState> callback);
  54. /// <summary>
  55. /// Fetches if the capture service is already in use or not.
  56. /// </summary>
  57. /// <remarks>
  58. /// Use this call to check if a start capture api call will return ErrorVideoAlreadyCapturing.
  59. /// If this returns true, then its safe to start capturing.
  60. ///
  61. /// Do not use this call to check if capture is supported, instead use
  62. /// <see cref="IsCaptureSupported"/> or <see cref="GetCaptureCapabilities"/>.
  63. /// </remarks>
  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. }