P2P连线接口
更新日期:2025/5/13
目录
P2P连线接口
KY_Connect
- 功能描述:
- 连线设备并出图。
接口定义
- (void)KY_Connect:(NSString * _Nonnull)uid
authKey:(NSString * _Nonnull)authKey
authType:(AvAuthType)authType
password:(NSString * _Nonnull)password
password:(NSInteger)channel
isDecode:(BOOL)isDecode
isYUV:(RENDERTYPE)renderType;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备UID |
authKey | string | 使用AuthKey方式连线 |
authType | boolean | 密码类型 |
password | string | 设备密码 |
channel | int | 开启并使之出图的通道,默认0 |
isDecode | boolean | 是否解码出图,默认为true |
isYUV | int | 输出YUV数据,参考 RENDERTYPE 枚举 定义 |
RENDERTYPE 枚举
ENUM | 说明 |
---|---|
0 | OUTPUT_EMPTY,仅接收、解码、渲染,输出数据为空 |
1 | OUTPUT_YUV,接收、解码、渲染,并输出yuv数据i420(耗时) |
2 | OUTPUT_RGB_8888,接收、解码、渲染,并输出RGB_8888数据(耗时) |
3 | OUTPUT_RGB_565,接收、解码、渲染,并输出RGB_565数据(耗时) |
4 | OUTPUT_YUV_NV12,接收、解码、渲染,并输出yuv数据nv12(耗时) |
回调说明
暂无
返回码
暂无
代码示例
[self.camera KY_Connect:self.uid
withDevicePassword:self.pwd
andChannel:_mainChannel
isDecode:YES
isYUV:OUTPUT_YUV
isAuthToken:self.isAuthToken
authKey:self.authKey];
KY_Disconnect
- 功能描述:
- 断开通道,并停止音视频功能。
接口定义
- (void)KY_Disconnect:(NSInteger)channel;
参数说明
参数 | 类型 | 说明 |
---|---|---|
channel | int | 开启并使之出图的通道,一般为0 |
回调说明
暂无
返回码
暂无
代码示例
[self.camera KY_Disconnect:_mainChannel];
KY_DisconnectAll
- 功能描述:
- 停止并断开所有连线。
接口定义
- (void)KY_DisconnectAll;
参数说明
暂无
回调说明
暂无
返回码
暂无
代码示例
[self.camera KY_DisconnectAll];