KalayRN(简中版)

RN版本


IOS旧API升级至新API

[TOC]

1. 旧API删除,请用新API代替

旧API 新API
Camera : delegate Camera : P2PDelegate & Camera : MediaDelegate
Camera : tpnsInterval 丢弃
Camera : isUsingGaAudioUnit 丢弃
Camera : isAVChannelStartShow: 丢弃
Camera : getThumbnail: 丢弃
Camera : deleteThumbnail: 丢弃
Camera : setHWDecodingAbility: requestHWDecode: Camera :TK_setHWDecodingAbility: requestHWDecode:
Camera : initWithName: Camera :TK_initWithName:
Camera : getViewAccountOfChannel: Camera :TK_getViewAccountOfChannel:
Camera : getViewPasswordOfChannel Camera :TK_getViewPasswordOfChannel:
Camera : initIOTC 丢弃
Camera : TK_initIOTC: success: failure: Camera : TK_InitIOTCWithLiceseKey: privateKey: success: failure:
Camera : uninitIOTC Camera :TK_uninitIOTC
Camera : getIOTCameraVersion Camera :TK_getIOTCameraVersion:
Camera : getIOTCAPIsVerion Camera :TK_getIOTCAPIsVersion:
Camera : getAVAPIsVersion Camera :TK_getAVAPIsVersion:
Camera : LanSearch: timeout: Camera :TK_LanSearch: timeout:
Camera : connect Camera :TK_connect
Camera : start: viewAccount: viewPassword: is_playback: Camera : TK_start: viewAccount: viewPassword:  authType: is_playback:
Camera : disconnect TK_disconnect
Camera : stop Camera : TK_stop
Camera : sendIOCtrlToChannel: Type: Data: DataSize: Camera : TK_sendIOCtrlToChannel: Type: Data: DataSize:
Camera : getServiceTypeOfChannel Camera : TK_getServiceTypeOfChannel
Camera : getConnectionStateOfChannel Camera : TK_getConnectionStateOfChannel
Camera : startShow: ScreenObject: Camera : TK_startShow: ScreenObject:
Camera : TK_setIsDecode: withChannel: 丢弃
Camera : startRecvFrame: ScreenObject: 丢弃
Camera : stopRecvFrame: 丢弃
Camera : stopShow Camera : TK_stopShow
Camera : startSoundToPhone Camera : TK_startSoundToPhone
Camera : stopSoundToPhone Camera : TK_stopSoundToPhone
Camera : startSoundToDevice: Camera : TK_startSoundToDevice
Camera : startSoundToDevice: resend: Camera : TK_startSoundToDevice: isResend: captureSize:
Camera : startSoundToDevice Camera : TK_stopSoundToDevice
Camera : startRecvAudio: 丢弃
Camera : stopRecvAudio: 丢弃
Camera : initVideoGenerator: 丢弃
Camera : startRecordingForChannel: withDuration: Camera : TK_startRecording: Channel:
Camera : stopRecording Camera : TK_stopRecording
Camera : getChannel: Snapshot: DataSize: ImageType: WithImageWidth: ImageHeight: Camera : TK_getChannel: Snapshot: DataSize: ImageType: WithImageWidth: ImageHeight:
Camera : reStartShow: withCompleteBlock: 丢弃
Camera : camera: didReceiveFrameInfoWithChannel: videoWidth: VideoHeight: VideoFPS: VideoBPS: AudioBPS: OnlineNm: FrameCount: IncompleteFrameCount:  Camera : camera: didReceiveFrameInfoWithChannel: videoWidth: VideoHeight: VideoFPS: VideoBPS: AudioBPS: OnlineNm: FrameCount: IncompleteFrameCount: isHwDecode:
Camera :TK_setOutputFrameData: withChannel: 丢弃
Camera : reStartShow: withCompleteBlock: 丢弃
Camera : TK_startShowWithYUV: isSWDecode: 丢弃
Camera : TK_initVideoGenerator: 丢弃
Camera : isListening 丢弃
Camera : isRecording 丢弃
Camera : sendIOCtrlToChannel: Type: Data: DataSize: Camera : TK_sendIOCtrlToChannel: Type: Data: DataSize:

2. 连线API修改

请使用Camera : TK_connect进行设备连线,使用Camera.TK_start进行AV通道的连线。 具体修改如下:

  1. 修改参数,Camera : TK_start: ====> Camera :TK_start: viewPassword:
  2. 修改参数,TK_start: viewAccount: viewPassword:  authType: is_playback: ====> Camera : TK_start: viewAccount: viewPassword: authType: ecurityMode:
  3. 删除Camera.TK_setDtls,若想使用Dtls方式进行连线,请使用Camera : TK_start: viewAccount: viewPassword: authType: ecurityMode:

3. 视频流API修改

请使用TK_startShow(int avChannel)开启视频流。TK_start 若想获取视频数据,请使用Camera: MeidaDelegate代理方法。 具体修改如下:

  1. 删除Camera : TK_startShowWithYUV,若想获取解码后的yuv数据,请使用TK_startShow: ScreenObject: isDecode: isSWDecode: isDropFrame: renderType:代替
  2. 删除Camera : TK_startRecvFrame/Camera : TK_stopRecvFrame,若想仅获取设备视频流,无需进行解码渲染,请使用TK_startShow: ScreenObject: isDecode: isSWDecode: isDropFrame: renderType:代替
  3. 新增获取视频格式接口 - (NSInteger)TK_getVideoCodecId:(NSInteger)channel;

4. 音频流API修改

请使用TK_startSoundToPhone(int avChannel)开启音频流。与旧API相比,新API====> TK_startSoundToPhone: isDecodeAndPlay: 将isListening参数更改为isDecodeAndPlay。 若想获取音频数据,请使用Camera : MeidaDelegate代理方法。。 具体修改如下:

  1. 修改参数,Camera.startSoundToPhone(int avChannel, boolean isListener) ====> Camera.startSoundToPhone(int avChannel, boolean isDecodeAndPlay),底层自动判断音频是否需要播放,isListener参数更改为isDecodeAndPlay,表示是否需要进行解码播放
  2. 删除Camera.TK_startRecvAudio/Camera.TK_stopRecvAudio。若想仅获取设备传过来的音频,无需进行解码播放,请使用Camera.startSoundToPhone(int avChannel, boolean isDecodeAndPlay)代替
  3. 新增获取监听音频格式接口 - (NSInteger)TK_getAudioOutputCodecId:(NSInteger)channel;
  4. 新增获取对讲音频格式接口 - (NSInteger)TK_getAudioInputCodecId:(NSInteger)channel;

5. 截图API修改

请使用Camera : TK_getSnapShotImageWithChannel 进行截图。 具体修改如下:

6. 录像API修改

请使用 Camera : TK_startRecording: Channel: 进行录像,底层不再限制录像时长,并自动判断是否需要录制音频。 具体修改如下:

  1. 修改API Camera : startRecordingForChannel: withDuration: 改用 TK_startRecording: Channel:
  2. 删除Camera : TK_initVideoGenerator

7. 音视频数据接口修改

新增Camera MediaDelegate 代理方法 来获取音视频数据,删除其它获取音视频数据的API。 删除代理方法如下:

  1. 获取视频接收原始数据回调
    • (void)camera:(Camera *)camera didReceiveTimestamp:(unsigned int)frmTimestamp Channel:(NSInteger)channel; (丢弃)
    • (void)camera:(Camera )camera didReceiveFrameDataInfo:(NSData )frameData Channel:(NSInteger)channel; (丢弃)
  2. 硬解码视频接收原始数据回调
    • (void)camera:(Camera *)camera didUpdateDecodedSampleBuffer: (CMSampleBufferRef)sampleBuffer timestamp:(uint64_t)timestamp Channel:(NSInteger)channel; (丢弃)
    • (void)CameraUpdateDecodedH264SampleBuffer: (CMSampleBufferRef)sampleBuffer; (丢弃)

8. 新增P2P代理方法

修改接口名称 ,修改接口中的参数,整理回调方法。具体修改如下:

  1. 修改代理名称为P2PDelegate
  2. 修改回调参数,- (void)camera:(Camera *)camera didChangeSessionStatus:(NSInteger)status errorCode:(NSInteger)errorCode;
  3. 修改回调参数,- (void)camera:(Camera *)camera didChangeChannelStatus:(NSInteger)channel ChannelStatus:(NSInteger)status errorCode:(NSInteger)errorCode;
    • (void)camera:(Camera *)camera didconnFailErrCode:(NSInteger)connFailErrCode; (丢弃)
  4. 新增回调方法:- (void)camera:(Camera *)camera didRecvVideoChannel:(NSInteger)channel errorCode:(NSInteger)errorCode;
  5. 新增回调方法:- (void)camera:(Camera *)camera didRecvAudioChannel:(NSInteger)channel errorCode:(NSInteger)errorCode;
  6. 修改回调参数,- (void)camera:(Camera )camera didReceiveIOCtrlWithType:(NSInteger)type Data:(const char)data DataSize:(NSInteger)size Channel:(NSInteger)channel;

页面列表

ITEM_HTML