日韩美女乱婬AAA高清视频_国产色爱AV资源综合区_国产女同性黄网在线观看_欧美日韩一卡2卡3卡4卡新区乱码_俺来也俺也啪www色_精品久久久久久综合日本_99国内偷揿国产精品人妻_国产蜜芽剧果冻传媒_日本特级aaaaaaaa片_国产偷人妻精品一区二区在线

簡(jiǎn)體中文

回調(diào)接口

Kalay SDK 開(kāi)發(fā)指南 | iOS APIs - 回調(diào)接口

回調(diào)接口模塊介紹

回調(diào)接口是Kalay SDK針對(duì)iOS平臺(tái)提供的核心事件通知機(jī)制,用于接收設(shè)備狀態(tài)變更、數(shù)據(jù)傳輸結(jié)果、音視頻處理反饋等關(guān)鍵事件,為APP與設(shè)備的異步交互提供標(biāo)準(zhǔn)化的回調(diào)方式。所有回調(diào)接口均需通過(guò)KY_SetDelegate注冊(cè)監(jiān)聽(tīng)后才能生效。

KY_SetDelegate

功能描述:注冊(cè)/反注冊(cè)監(jiān)聽(tīng)回調(diào)接口。

接口定義

- (void)KY_SetDelegate:(id _Nullable)delegate;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
delegateid _Nullable實(shí)現(xiàn)了KYCameraDelegate協(xié)議的類,nil為反注冊(cè)

KY_DeviceStatus

功能描述:指定通道的連線狀態(tài)回調(diào)。

接口定義

// 指定通道的連線狀態(tài)回調(diào): - (void)KY_DeviceStatus:(NSString *)uid Status:(KYDeviceState)status errorCode:(NSInteger)errorCode;
// 指定通道的連線狀態(tài)回調(diào)(指定通道): - (void)KY_DeviceStatus:(NSString *)uid withChannel:(NSInteger)channel ChannelStatus:(KYDeviceState)status errorCode:(NSInteger)errorCode;
// 指定通道的連線狀態(tài)回調(diào) (調(diào)試模式): - (void)KY_DeviceStatus:(NSString *)uid withChannel:(NSInteger)channel debugChannelStatus:(NSInteger)status errorCode:(NSInteger)errorCode;
// Bind狀態(tài)回調(diào): - (void)KY_DeviceStatus:(NSString *)uid didChangeBindStatus:(NSInteger)status credentialInfo:(NSString *)credential errorCode:(NSInteger)errorCode;
// 上拋采集到的yuv數(shù)據(jù): - (void)KY_outPutVideoData:(NSString *)uid data:(NSData *)data timestamp:(uint64_t)timestamp channel:(NSInteger)channel;
// 視頻發(fā)送通道建立的回調(diào): - (void)KY_sendVideoSuccess:(NSString *)uid isSuccess:(BOOL)isSuccess ErrorCode:(NSInteger) errorCode;

參數(shù)說(shuō)明

指定通道的連線狀態(tài)回調(diào):
參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
statusKYDeviceState連線狀態(tài)。詳細(xì)定義參考:KYStatus 枚舉
errorCodeNSIntegerP2P SDK錯(cuò)誤碼
指定通道的連線狀態(tài)回調(diào)(指定通道):
參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
channelNSInteger設(shè)備連線的channel(默認(rèn)為0)
statusKYDeviceState連線狀態(tài)。詳細(xì)定義參考:KYStatus 枚舉
errorCodeNSIntegerP2P SDK錯(cuò)誤碼
指定通道的連線狀態(tài)回調(diào) (調(diào)試模式):
參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
channelNSInteger設(shè)備連線的channel(默認(rèn)為0)
statusNSInteger連線狀態(tài)。詳細(xì)定義參考:KYStatus 枚舉
errorCodeNSIntegerP2P SDK錯(cuò)誤碼
Bind狀態(tài)回調(diào):
參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
statusNSIntegerbind結(jié)果。0 成功,other 失敗
credentialNSString *連線credential值
errorCodeNSIntegerP2P SDK錯(cuò)誤碼
上拋采集到的yuv數(shù)據(jù):
參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
dataNSData *采集后的yuv數(shù)據(jù)
timestampuint64_t時(shí)間戳
channelNSIntegerav通道
視頻發(fā)送通道建立的回調(diào):
參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
isSuccessBOOL是否建立成功
errorCodeNSInteger錯(cuò)誤碼 (success: >=0; fail:<0)
KYStatus 枚舉
說(shuō)明
0_NONE,初始化連線狀態(tài)
1_CONNECTING,設(shè)備連線中,未返回狀態(tài)
2_CONNECTED,設(shè)備已連線,返回狀態(tài)>= 0
3_DISCONNECTED,設(shè)備未連線,返回狀態(tài) -22 AV其它
4_UNKNOWN_DEVICE,未知設(shè)備,返回狀態(tài) -15
5_WRONG_PASSWORD,設(shè)備連線密碼錯(cuò)誤,返回狀態(tài) -20009
6_TIMEOUT,設(shè)備連線超時(shí),返回狀態(tài)-13 -23 -20016 -20011
7_UNSUPPORTED,不支持設(shè)備,返回狀態(tài)-40
8_CONNECT_FAILED,設(shè)備連線失敗 其它
9_UNKNOWN_LICENSE,設(shè)備uid未在license中,返回狀態(tài) -10
10_SLEEP,設(shè)備睡眠狀態(tài)
11_DEVICE_MAX_SESSION,超過(guò)設(shè)備最大連線數(shù),返回狀態(tài)-48
12_POOR_NETWORKSIGNAL,網(wǎng)絡(luò)信號(hào)差,返回狀態(tài) -19 -42
13_WRONG_AUTHKEY,authkey不正確,返回狀態(tài) -46 -68

KY_StartTalkSuccess

功能描述:對(duì)講通道建立成功的回調(diào)。

接口定義

- (void)KY_StartTalkSuccess:(NSString * _Nonnull)uid isSuccess:(BOOL)isSuccess;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
isSuccessBOOL是否建立成功

KY_StartListenSuccess

功能描述:監(jiān)聽(tīng)通道建立成功的回調(diào)。

接口定義

- (void)KY_StartListenSuccess:(NSString * _Nonnull)uid isSuccess:(BOOL)isSuccess;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
isSuccessBOOL是否建立成功

返回碼

暫無(wú)

KY_UpdateDecodedImage

功能描述:獲取當(dāng)前設(shè)備指定通道解碼后的數(shù)據(jù)回調(diào)。

接口定義

- (void)KY_UpdateDecodedImage:(NSString * _Nonnull)uid channel:(NSInteger)channel timestamp:(int64_t)timestamp image:(UIImage * _Nullable)image;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
channelNSInteger設(shè)備連線的channel(默認(rèn)為0)
timestampint64_t當(dāng)前解碼成功的幀時(shí)間戳
imageUIImage * _Nullable解碼成功產(chǎn)生的UIImage

KY_DecodeVideoFramInfo

功能描述:指定通道的視頻寬高/fps/bps/在線人數(shù)/幀數(shù)/丟幀數(shù)等調(diào)試信息回調(diào)。

接口定義

- (void)KY_DecodeVideoFramInfo:(NSString * _Nonnull)uid channel:(NSInteger)channel connectMode:(NSInteger)connectMode videoWidth:(NSInteger)videoWidth videoHeight:(NSInteger)videoHeight fps:(NSInteger)fps videoBps:(NSInteger)videoBps audioBps:(NSInteger)audioBps onlineNum:(NSInteger)onlineNum frameCount:(NSInteger)frameCount incompleteFrameCount:(NSInteger)incompleteFrameCount isHWDecode:(BOOL)isHWDecode sessionID:(NSInteger)sessionID avIndex:(NSInteger)avIndex cmdNum:(NSInteger)cmdNum cmdReturn:(NSInteger)cmdReturn;

注:原始文檔中接口定義存在重復(fù)參數(shù) `videoWidth`,已修正為 `videoHeight`。

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
channelNSInteger設(shè)備連線的channel,默認(rèn)為0
connectModeNSInteger連線模式 (-1:NONE,0:P2P,1:RELAY,2:LAN)
videoWidthNSInteger視頻寬
videoHeightNSInteger視頻高
fpsNSIntegerfps
videoBpsNSInteger視頻bps
audioBpsNSInteger音頻bps
onlineNumNSInteger在線人數(shù)
frameCountNSInteger幀數(shù)
incompleteFrameCountNSInteger丟幀數(shù)
isHWDecodeBOOL是否是硬解
sessionIDNSInteger連線返回的session號(hào)
avIndexNSInteger開(kāi)啟通道返回的av通道
cmdNumNSIntegercommand指令類型值
cmdReturnNSIntegercommand指令返回值

注:原始表格中參數(shù) `onlineNm` 和 `avChannelIndex` 與接口定義不一致,已根據(jù)接口定義修正為 `onlineNum` 和 `avIndex`。

KY_DidReceiveIOCtrlWithUid

功能描述:獲取設(shè)備回復(fù)Command的數(shù)據(jù)信息回調(diào)。

接口定義

- (void)KY_DidReceiveIOCtrlWithUid:(NSString * _Nonnull)uid channel:(NSInteger)channel type:(ENUM_AVIOCTRL_MSGTYPE)type data:(NSData * _Nonnull)data;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
channelNSInteger設(shè)備連線的channel,默認(rèn)為0
typeENUM_AVIOCTRL_MSGTYPEcommand指令類型,AVIOCTRLDEFs.h
dataNSData *command對(duì)應(yīng)指令的結(jié)構(gòu)體數(shù)據(jù)

KY_startVideoToDevice

功能描述:開(kāi)始預(yù)覽并發(fā)送視頻數(shù)據(jù)。

接口定義

- (void)KY_startVideoToDevice:(UIView *)previewView previewFormat:(PreviewFormat)previewFormat channel:(NSInteger)channel ScreenObject:(NSObject*)obScreen;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
previewViewUIView *預(yù)覽視圖
previewFormatPreviewFormat編碼格式
channelNSInteger通道號(hào)
obScreenNSObject *屏幕顯示對(duì)象

代碼示例

PreviewFormat *format = (PreviewFormat *)malloc(sizeof(PreviewFormat)); format->resolution = PreviewResolution_Low; format->fps = PreviewFPS_Low; format->gop = PreviewGOP_Low; format->orientation = AVCaptureVideoOrientationPortrait; format->bitrate = PreviewBitRate_Low; [self.camera KY_startVideoToDevice:self.preView previewFormat:*format channel:self.selectChannel ScreenObject:self];

KY_stopVideoToDevice

功能描述:停止預(yù)覽并發(fā)送視頻數(shù)據(jù)。

接口定義

- (void)KY_stopVideoToDevice:(NSInteger)channel;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
channelNSInteger設(shè)備連線的channel,默認(rèn)為0

代碼示例

[self.camera KY_stopVideoToDevice:self.selectChannel];

KY_preview_switchCamera

功能描述:切換前后攝像頭。

接口定義

- (void)TK_preview_switchCamera:(AVCaptureDevicePosition)positon;

注:接口命名為 `TK_preview_switchCamera`,可能是一個(gè)筆誤,應(yīng)為 `KY_preview_switchCamera`。

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
positonAVCaptureDevicePosition設(shè)置攝像頭

代碼示例

[self.camera TK_preview_switchCamera:AVCaptureDevicePositionFront];

KY_preview_changePreviewFormat

功能描述:更改采集的視頻質(zhì)量等級(jí)。

接口定義

- (void)KY_preview_changePreviewFormat:(PreviewFormat)previewFormat presetBlock:(PresetBlock)presetBlock;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
previewFormatPreviewFormat編碼格式
presetBlockPresetBlock回調(diào)是否支持

代碼示例

PreviewFormat *format = (PreviewFormat *)malloc(sizeof(PreviewFormat)); format->resolution = PreviewResolution_Low; format->fps = PreviewFPS_Low; format->gop = PreviewGOP_Low; format->orientation = AVCaptureVideoOrientationPortrait; format->bitrate = PreviewBitRate_Low; [self.camera KY_preview_changePreviewFormat:format presetBlock:^{ }];

KY_isVideoOutputavChannel

功能描述:采集視頻數(shù)據(jù)上拋。

接口定義

- (void)KY_isVideoOutputavChannel:(NSInteger)avChannel isSendVideo:(BOOL)isSendVideo;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
avChannelNSIntegerav通道號(hào)
isSendVideoBOOL發(fā)送上拋

代碼示例

[self.camera KY_isVideoOutputavChannel:0 isSendVideo:YES];

KY_sendVideo

功能描述:client端開(kāi)啟發(fā)送視頻。

接口定義

- (void) KY_sendVideo:(NSData *)videoData Length:(NSInteger)length Codec:(NSInteger)codec isKeyFrame:(BOOL)isKeyFrame channel:(NSInteger)channel;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
videoDataNSData *視頻數(shù)據(jù)
lengthNSInteger視頻數(shù)據(jù)長(zhǎng)度
codecNSInteger視頻編碼格式
isKeyFrameBOOL是否是關(guān)鍵幀
channelNSIntegerav通道

代碼示例

[self.camera KY_sendVideo:data Length:data.length Codec:MEDIA_CODEC_VIDEO_H264 isKeyFrame:isKeyFrame channel:channell];

KY_downloadUploadWithUid

功能描述:輸出文件下載或上傳的數(shù)據(jù)結(jié)果。

接口定義

- (void)KY_downloadUploadWithUid:(NSString *)uid fileName:(NSString *)fileName progress:(NSInteger)progress loadType:(FILETransferType)type result:(NSInteger)result channel:(NSInteger)channel;

參數(shù)說(shuō)明

參數(shù)類型說(shuō)明
uidNSString *當(dāng)前設(shè)備的uid
fileNameNSString *文件名稱
progressNSInteger文件傳輸進(jìn)度
typeFILETransferType傳輸方式。詳細(xì)定義參考:KYTransferType 枚舉
resultNSInteger傳輸結(jié)果
channelNSInteger通道號(hào)

即刻開(kāi)啟您的物聯(lián)網(wǎng)之旅

聯(lián)系解決方案專家
Kalay App
資訊安全白皮書
全球?qū)@季?/a>
解決方案
新聞動(dòng)態(tài)
公司動(dòng)態(tài)
行業(yè)資訊
媒體報(bào)道
永續(xù)發(fā)展
經(jīng)營(yíng)者的話
社會(huì)參與
環(huán)境永續(xù)
公司治理

+86 755 27702549

7×24小時(shí)服務(wù)熱線

法律聲明 隱私權(quán)條款

關(guān)注“TUTK”

TUTK服務(wù)盡在掌握

? 2022 物聯(lián)智慧科技(深圳)有限公司版權(quán)所有粵ICP備14023641號(hào)
在線咨詢
掃一掃

TUTK服務(wù)盡在掌握

全國(guó)免費(fèi)服務(wù)熱線
+86 755 27702549

返回頂部