|
9#
楼主 |
发表于 2014-1-15 11:21:33
|
只看该作者
int watcherId = -1;
if (anychat.GetCameraState(watcherId) == 2
&& anychat.GetUserVideoWidth(watcherId) != 0) {
SurfaceHolder holder = firstSurfaceView.getHolder();
holder.setFormat(PixelFormat.RGB_565);
holder.setFixedSize(anychat.GetUserVideoWidth(watcherId),
anychat.GetUserVideoHeight(watcherId));
Surface s = holder.getSurface();
System.out.println("firstSurfaceView=" + watcherId);
anychat.SetVideoPos(watcherId, s, 0, 0, 0, 0);
anychat.UserCameraControl(watcherId, 1);
firstSurfaceOpen = true;
// 如果是采用Java视频显示,则需要将视频窗口与用户关联起来
if (AnyChatCoreSDK
.GetSDKOptionInt(AnyChatDefine.BRAC_SO_VIDEOSHOW_DRIVERCTRL) == AnyChatDefine.VIDEOSHOW_DRIVER_JAVA) {
anychat.mVideoHelper.SetVideoUser(firstVideoIndex, watcherId);
}
}
anychat.UserCameraControl(watcherId, 0);
watcherId = 209;
if (anychat.GetCameraState(watcherId) == 2
&& anychat.GetUserVideoWidth(watcherId) != 0) {
SurfaceHolder holder = firstSurfaceView.getHolder();
holder.setFormat(PixelFormat.RGB_565);
holder.setFixedSize(anychat.GetUserVideoWidth(watcherId),
anychat.GetUserVideoHeight(watcherId));
Surface s = holder.getSurface();
System.out.println("firstSurfaceView=" + watcherId);
anychat.SetVideoPos(watcherId, s, 0, 0, 0, 0);
anychat.UserCameraControl(watcherId, 1);
firstSurfaceOpen = true;
// 如果是采用Java视频显示,则需要将视频窗口与用户关联起来
if (AnyChatCoreSDK
.GetSDKOptionInt(AnyChatDefine.BRAC_SO_VIDEOSHOW_DRIVERCTRL) == AnyChatDefine.VIDEOSHOW_DRIVER_JAVA) {
anychat.mVideoHelper.SetVideoUser(firstVideoIndex, watcherId);
}
}
大概逻辑就是这样,那个watcherId我确定已经改变 |
|