|
使用付费SDK播放RTSP推RTMP到平台上的设备时,会有杂音,但实际客户那边的设备时没有音频,在Web端平台播放时也没有音频,下面是播放的代码
int iDir = this.playerInfo.getBvcuiAVStreamDir();
// 当前设备媒体最大能力
if (this.playerInfo.getBvcuiAVStreamDir() != -1) {
if (iDir != 0) {
if ((iDir & BVCU_MediaDir.BVCU_MEDIADIR_AUDIORECV) == BVCU_MediaDir.BVCU_MEDIADIR_AUDIORECV && (iDir & BVCU_MediaDir.BVCU_MEDIADIR_VIDEORECV) == BVCU_MediaDir.BVCU_MEDIADIR_VIDEORECV) {
iDir = 10;
}
}
}
BVCU_DialogInfo dialogInfo = new BVCU_DialogInfo();
dialogInfo.stParam = new BVCU_DialogParam();
dialogInfo.stParam.iTargetCount = 1;
dialogInfo.stParam.pTarget = new BVCU_DialogTarget[1];
dialogInfo.stParam.pTarget[0] = new BVCU_DialogTarget();
dialogInfo.stParam.pTarget[0].iIndexMajor = 0;
dialogInfo.stParam.pTarget[0].iIndexMinor = -1;
dialogInfo.stParam.pTarget[0].szID = this.playerInfo.getBvcuPUID();
Log.d(TAG, "原始iDir:" + playerInfo.getBvcuiAVStreamDir());
Log.d(TAG, "输出的iDir:" + iDir);
dialogInfo.stParam.iAVStreamDir = iDir;
dialogInfo.stControlParam = new BVCU_DialogControlParam();
dialogInfo.stControlParam.stRender = new BVCU_DialogControlParam_Render();
dialogInfo.stControlParam.stRender.hWnd = streamPlayerSurfaceHolder.getSurface();
BVCU_Display_Param display_param = new BVCU_Display_Param();
display_param.fMulZoom = 0;
display_param.iAngle = 0;
if (nowPlayerSize == 1 && StringUtils.equals(playerInfo.getType(), "0") && phoneFullFlag) {
display_param.iAngle = 90;
}
dialogInfo.stControlParam.stRender.stDisplayParam = display_param;
if (dialogInfo.stControlParam == null) {
dialogInfo.stControlParam = new BVCU_DialogControlParam();
}
if (dialogInfo.stControlParam.stNetwork == null) {
dialogInfo.stControlParam.stNetwork = new BVCU_DialogControlParam_Network();
}
dialogInfo.stControlParam.stNetwork.iDelayMax = 5000;
dialogInfo.stControlParam.stNetwork.iDelayMin = 500;
dialogInfo.stControlParam.stNetwork.iDelayVsSmooth = 3;
int videoToken = BVCU.getSDK().openDialog(dialogInfo);
this.playerInfo.setBvcuVideoToken(videoToken);
BVCU.getSDK().controlDialog(videoToken, dialogInfo.stControlParam);
|
|