IVideoDeviceManager.cs 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. namespace Agora.Rtc
  3. {
  4. ///
  5. /// <summary>
  6. /// Video device management methods.
  7. /// </summary>
  8. ///
  9. public abstract class IVideoDeviceManager
  10. {
  11. ///
  12. /// <summary>
  13. /// Enumerates the video devices.
  14. /// </summary>
  15. ///
  16. /// <returns>
  17. /// Success: A DeviceInfo array including all video devices in the system.Failure: NULL.
  18. /// </returns>
  19. ///
  20. public abstract DeviceInfo[] EnumerateVideoDevices();
  21. ///
  22. /// <summary>
  23. /// Specifies the video capture device with the device ID.
  24. /// Plugging or unplugging a device does not change its device ID.
  25. /// </summary>
  26. ///
  27. /// <param name="deviceIdUTF8"> The device ID. You can get the device ID by calling EnumerateVideoDevices .</param>
  28. ///
  29. /// <returns>
  30. /// 0: Success.&lt; 0: Failure.
  31. /// </returns>
  32. ///
  33. public abstract int SetDevice(string deviceIdUTF8);
  34. ///
  35. /// <summary>
  36. /// Retrieves the current video capture device.
  37. /// </summary>
  38. ///
  39. /// <param name="deviceIdUTF8"> Output parameter. The device ID. </param>
  40. ///
  41. /// <returns>
  42. /// 0: Success.&lt; 0: Failure.
  43. /// </returns>
  44. ///
  45. public abstract int GetDevice(ref string deviceIdUTF8);
  46. ///
  47. /// @ignore
  48. ///
  49. public abstract int StartDeviceTest(IntPtr hwnd);
  50. ///
  51. /// @ignore
  52. ///
  53. public abstract int StopDeviceTest();
  54. ///
  55. /// <summary>
  56. /// Gets the detailed video frame information of the video capture device in the specified video format.
  57. /// After calling NumberOfCapabilities to get the number of video formats supported by the video capture device, you can call this method to get the specific video frame information supported by the specified index number.
  58. /// </summary>
  59. ///
  60. /// <param name="deviceIdUTF8"> The ID of the video capture device.</param>
  61. ///
  62. /// <param name="deviceCapabilityNumber"> The index number of the video format. If NumberOfCapabilities the return value of is i, the value range of this parameter is [0,i).</param>
  63. ///
  64. /// <param name="capability"> Output parameter. Indicates the specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat .</param>
  65. ///
  66. /// <returns>
  67. /// 0: Success.&lt; 0: Failure.
  68. /// </returns>
  69. ///
  70. public abstract int GetCapability(string deviceIdUTF8, uint deviceCapabilityNumber, out VideoFormat capability);
  71. ///
  72. /// <summary>
  73. /// Gets the number of video formats supported by the specified video capture device.
  74. /// Video capture devices may support multiple video formats, and each format supports different combinations of video frame width, video frame height, and frame rate.You can call this method to get how many video formats the specified video capture device can support, and then call GetCapability to get the specific video frame information in the specified video format.
  75. /// </summary>
  76. ///
  77. /// <param name="deviceIdUTF8"> The ID of the video capture device.</param>
  78. ///
  79. /// <returns>
  80. /// 0: Success. Returns the number of video formats supported by this device. For example: If the specified camera supports 10 different video formats, the return value is 10.&lt; 0: Failure.
  81. /// </returns>
  82. ///
  83. public abstract int NumberOfCapabilities(string deviceIdUTF8);
  84. }
  85. }