Class ZegoAudioEncryptDecrypt
- java.lang.Object
-
- com.zego.zegoavkit2.audioencryptdecrypt.ZegoAudioEncryptDecrypt
-
- All Implemented Interfaces:
IZegoAudioEncryptDecryptCallback
public class ZegoAudioEncryptDecrypt extends java.lang.Object implements IZegoAudioEncryptDecryptCallback
-
-
Constructor Summary
Constructors Constructor Description ZegoAudioEncryptDecrypt()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
enableAudioEncryptDecrypt(boolean enable)
音频解密、解密开关。int
onAudioEncryptDecrypt(java.lang.String streamID, java.nio.ByteBuffer inData, int inDataLen, java.nio.ByteBuffer outData, int maxOutBufLen)
音频加密、解密回调。void
setAudioEncryptDecryptCallback(IZegoAudioEncryptDecryptCallback callback)
设置回调,接收音频数据进行加密或者解密后,再回传给sdk。
-
-
-
Method Detail
-
enableAudioEncryptDecrypt
public static void enableAudioEncryptDecrypt(boolean enable)
音频解密、解密开关。注意:init sdk之前调用才能生效
- Parameters:
enable
- true:开启,false:关闭
-
setAudioEncryptDecryptCallback
public void setAudioEncryptDecryptCallback(IZegoAudioEncryptDecryptCallback callback)
设置回调,接收音频数据进行加密或者解密后,再回传给sdk。注意:成功推流、拉流后才会有回调
- Parameters:
callback
- 回调
-
onAudioEncryptDecrypt
public int onAudioEncryptDecrypt(java.lang.String streamID, java.nio.ByteBuffer inData, int inDataLen, java.nio.ByteBuffer outData, int maxOutBufLen)
Description copied from interface:IZegoAudioEncryptDecryptCallback
音频加密、解密回调。- Specified by:
onAudioEncryptDecrypt
in interfaceIZegoAudioEncryptDecryptCallback
- Parameters:
streamID
- 流ID,标识当前回调的音频数据属于哪条流inData
- SDK回调给用户的音频数据, 推流时用于加密,拉流时用于解密inDataLen
- SDK回调给用户的音频数据的长度(单位:btye)outData
- 用户将加密(推流)或者解密(拉流)后的音频数据回传给SDKmaxOutBufLen
- 用户回传数据的缓冲区的最大长度(单位:btye)- Returns:
- 用户实际回传给SDK的数据大小(单位:btye)
-
-