萤石云 iOSSDK,移植跨平台相关工程
JLChen
2021-08-06 edc0f0a0439f9e5a11593e21a4779fa6dbcbe49d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
//
//  EZVideoTalkSDK.h
//  EZOpenSDK
//
//  Created by yuqian on 2020/3/14.
//  Copyright © 2020 Hikvision. All rights reserved.
//
 
#import <UIKit/UIKit.h>
#import "EZVideoTalkParam.h"
 
NS_ASSUME_NONNULL_BEGIN
 
typedef enum : NSUInteger {
    EZVideoTalkMessageUnkown,
    EZVideoTalkMessageRoomCreated,      //创建房间成功
    EZVideoTalkMessagePeerEnteredRoom,  //目前未使用,用于多方
    EZVideoTalkMessagePeerLeaveRoom,    //目前未使用,用于多方
    EZVideoTalkMessageStartInputData    //链接建立成功,开始推流
} EZVideoTalkMessageType;
 
typedef NS_OPTIONS(NSUInteger, EZVideoTalkCaptureType) {
    EZVideoTalkCaptureNone = 1 << 0,
    EZVideoTalkCaptureVideo = 1 << 1,
    EZVideoTalkCaptureAudio = 1 << 2,
};
 
 
@class EZVideoTalkSDK;
 
@protocol EZVideoTalkSDKDelegate<NSObject>
 
- (void)videoTalk:(EZVideoTalkSDK *)client didReceivedError:(int32_t)errorCode;
 
/**
 回调消息
 
 @param client client
 @param messageCode 消息码
 @param msg 透传消息
 */
- (void)videoTalk:(EZVideoTalkSDK *)client didReceivedMessage:(EZVideoTalkMessageType)messageType msg:(NSString*)msg;
 
/**
 回调消息 bavclient log回调
 
 @param client client
 @param msg 透传消息
 */
- (void)videoTalk:(EZVideoTalkSDK *)client didReceivedBavClientLogMsg:(NSString*)msg;
 
/**
 显示回调,首次画面出来以及后续画面尺寸发生变化时回调
 
 @param client client
 @param width 画面宽度
 @param height 画面高度
 */
- (void)videoTalk:(EZVideoTalkSDK *)clientt didDisplayWidth:(int32_t)width height:(int32_t)height;
 
/**
 播放卡顿
 
 @param client client
 @param delayTime 卡顿时间
 */
- (void)videoTalk:(EZVideoTalkSDK *)client playDelayTime:(int32_t)delayTime;
 
/**
 播放卡顿统计
 
 @param client client
 @param delayTimeStat 卡顿时间
 */
- (void)videoTalk:(EZVideoTalkSDK *)client playDelayTimeStatistics:(double)delayTimeStat;
 
@end
 
@interface EZVideoTalkSDK : NSObject
 
@property (nonatomic, assign, readonly) int32_t roomID;
@property (nonatomic, weak) id<EZVideoTalkSDKDelegate> delegate;
 
#pragma mark - SDK
/**
SDK初始化
 
 @param param 必填 配置参数
 @param localWin 本地窗口
 @param remoteWin 远端窗口
 
 @return 返回值
 */
- (instancetype)initWithParam:(EZVideoTalkParam *)param
                  localWindow:(UIView *)localWin
                 remoteWindow:(UIView *)remoteWin;
 
/**
 开始双向音视频对讲,耗时接口,默认 EZVideoTalkCaptureVideo | EZVideoTalkCaptureAudio 同时开启
 */
- (void)start;
 
/**
 开始双向音视频对讲,耗时接口
 */
- (void)startWithType:(EZVideoTalkCaptureType)type;
 
/**
 停止双向音视频对讲
 */
- (void)stop;
 
/// 开启声音,接收到EZVideoTalkMessageStartInputData消息后调用
/// @param open 开关状态
- (int32_t) openSound:(BOOL)open;
 
#pragma mark - 日志调试
/**
 日志设置
 
 @param enable 是否打印日志
 @param logCallback 日志回调,上层自定义处理
 */
+ (void)setDebugLogEnable:(BOOL)enable withLogCallback:(void(^)(NSString *logStr))logCallback;
 
/**
 打开对端码流抓取
 
 @param enble 是否打开
 */
+(void)setDebugVideoLog:(BOOL)enble;
 
/**
 获取sdk版本信息
 
 @return 版本号
 */
+ (NSString*)getVersion;
 
@end
 
NS_ASSUME_NONNULL_END