NIMAVChatNetDetectManagerProtocol.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // NIMAVChatNetDetectManagerProtocol.h
  3. // NIMAVChat
  4. //
  5. // Created by Netease.
  6. // Copyright (c) 2016 Netease. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "NIMAVChatDefs.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @class NIMAVChatNetDetectResult;
  12. /**
  13. 网络探测类型
  14. */
  15. typedef NS_ENUM(NSUInteger, NIMAVChatNetDetectType)
  16. {
  17. /**
  18. * 音频探测
  19. */
  20. NIMAVChatNetDetectTypeAudio = 0,
  21. /**
  22. * 默认清晰度 (视频探测)
  23. */
  24. NIMAVChatNetDetectTypeDefault ,
  25. /**
  26. * 低视频质量 (视频探测)
  27. */
  28. NIMAVChatNetDetectTypeLow ,
  29. /**
  30. * 中等视频质量 (视频探测)
  31. */
  32. NIMAVChatNetDetectTypeMedium ,
  33. /**
  34. * 高视频质量 (视频探测)
  35. */
  36. NIMAVChatNetDetectTypeHigh ,
  37. /**
  38. * 480P (视频探测)
  39. */
  40. NIMAVChatNetDetectType480P ,
  41. /**
  42. * 540P (视频探测)
  43. */
  44. NIMAVChatNetDetectType540P ,
  45. /**
  46. * 720P (视频探测)
  47. */
  48. NIMAVChatNetDetectType720P ,
  49. };
  50. /**
  51. 网络探测结果 Block
  52. @param result 网络探测的结果
  53. */
  54. typedef void(^NIMAVChatNetDetectCompleteBlock)(NIMAVChatNetDetectResult *result);
  55. /**
  56. * 音视频实时会话网络探测管理类
  57. */
  58. @protocol NIMAVChatNetDetectManager <NSObject>
  59. /**
  60. * 开始网络探测任务
  61. *
  62. * @param detectType 探测类型 包括音频探测 及6种清晰度的视频探测
  63. *
  64. * @param completion 任务完成 block
  65. *
  66. * @return 开始的网络探测任务的 id,可以用该 id 停止该任务,如果返回 0 表示开始失败
  67. */
  68. - (UInt64)startDetectTaskForDetectType:(NIMAVChatNetDetectType)detectType
  69. completion:(NIMAVChatNetDetectCompleteBlock)completion;
  70. /**
  71. * 停止网络探测任务
  72. *
  73. * @param taskId 需要停止的任务的 id
  74. */
  75. - (void)stopDetectTask:(UInt64)taskId;
  76. /**
  77. * 获得 SDK 网络探测 log 文件路径
  78. *
  79. * @return 网络探测 log 文件路径
  80. */
  81. - (NSString *)logFilepath;
  82. @end
  83. NS_ASSUME_NONNULL_END