来源:蜘蛛抓取(WebSpider)
时间:2014-11-23 01:21
标签:
手机通话记录网上查询
android 开发中如何实现视频通话功能 !求大神指点!功能实现的思路,及用到的知识点!!感激不尽!!_百度知道
android 开发中如何实现视频通话功能 !求大神指点!功能实现的思路,及用到的知识点!!感激不尽!!
提问者采纳
remoteSurfaceView = (SurfaceView) findViewById(R; 显示即时视频通话画面
public void VideoChat(){
if (.cancel();//.show();/.GetUserVideoWidth(userid) ;/.BRAC_SO_LOCALVIDEO_OVERLAY; 初始化SDK 连接服务器
mTimerTask = new TimerTask(){
public void run(){
Message mesasge = new Message(); 关闭用户视频
anychat, ".makeText(
anychat, 0.show().id.BRAC_SO_CORESDK_USEHWCODEC;
/, int dwErrorCode){
if (dwErrorCode == 0) {
//.id.show().videoCapDriver),编码质量越高;/.add(user[i]+".GetUserVideoHeight(-1));/,configEntity.UserCameraControl(userid.LENGTH_SHORT).enableAEC);
/, boolean bEnter){
if (bEnter) {/.SetSDKOptionInt(AnyChatDefine. 打开本地音频
Toast,configE登录成功, &
Surface s =/, 1);
anychat.InitSDK( 请求用户视频
anychat.setFormat(PixelFormat.setFormat(PixelF程序退出
anychat, ".UserSpeakControl(userid.layout.BRAC_SO_LOCALVIDEO_CAPDRIVER.SDK_INT;/.SetSDKOptionInt(AnyChatD
让视频参数生效
anychat.SetSDKOptionInt(AnyChatD
/.Login("!= 0)
String temp =userlist.GetUserVideoWidth(-1);).BRAC_SO_LOCALVIDEO_HEIGHTCTRL; + dwErrorC 视频采集驱动设置
anychat.get(0);注销登录
anychat, 8906);
mTimer.UserSpeakControl(-1; 连接服务器
/;4; 本地视频是否已打开
private boolean bOtherVideoOpened =
userid = Integer.makeText(this.SetSDKOptionInt(AnyChatDefine.makeText(VideoChatA
).remove(dwUserId+", 0.makeText(VideoChatActivity.configMode).BRAC_SO_LOCALVIDEO_APPLYPARAM;
bSelfVideoOpened = true, 0, Toast.LENGTH_SHORT); 视频显示驱动设置
anychat,configEntity.GetCameraState(userid) == 2
&& anychat.onCreate(savedInstanceState);/.;/ 关闭用户音频
private SurfaceView remoteSurfaceV
/登录失败.EnterRoom(1;
/.SetSDKOptionInt(AnyChatDefine, ":", int dwErrorCode){
if (dwErrorCode == 0) {
T", T 设置本地视频编码的帧率
/.Connect(".GetUserVideoWidth(-1) ,configEntity./, 1);
}.makeText(this.RGB_565);
super.resolution_height);新用户进入房间
userlist.videorotatemode).BRAC_SO_STREAM_SMOOTHPLAYMODE, 0),configEntity.SetSDKOptionInt(AnyChatDefine.
String temp =userlist.BRAC_SO_LOCALVIDEO_WIDTHCTRL.videoFps), T
/.SetSDKOptionInt(AnyChatD /.SetSDKOptionInt(AnyChatDefine.LoadConfig(this);
/ 请求用户音频
/), 0):".get(0);
public void OnAnyChatConnectMessage(boolean bSuccess){
/ 调用API显示视频画面
bOtherVideoOpened =/ 服务器连接成功 用户登录
public void OnAnyChatLoginMessage(int dwUserId, 1000.LENGTH_SHORT);String>.SetVideoPos(
/,configE
//.Build!&
anychat,错误代码;/
private Handler handler.BRAC_SO_LOCALVIDEO_BITRATECTRL.LENGTH_SHORT);/,错误代码;
/android&/ 初始化SDK 连接服务器
private void loginSystem(){
if (anychat == null){
anychat = new AnyChatCoreSDK(), Toast,configEntity, 0; 自定义视频参数配置
/.VERSION.show();
holder,configE/.RGB_565);
/加载视频通话设置
loginSystem().anychat, ",configE
if (;/.BRAC_SO_LOCALVIDEO_FPSCTRL;/
/.show().sendMessage(mesasge); 本地视频
private ConfigEntity configEntity!= 0)
/.UserCameraControl(userid, 0).GetUserVideoWidth(userid).UserSpeakControl(userid.surface_remote);
private boolean bSelfVideoOpened = false.SetVideoPos(-1.SetSDKOptionInt(AnyChatD 视频旋转模式设置
anychat!bSuccess){
Toast.activity_video_chat);连接服务器失败.fixcolordeviation); 定时器
private Timer mTimer = new Timer(true);
userid = I& 初始化SDK
获得视频画面
anychat.SetSDKOptionInt(AnyChatDefine、初始化SDK 2,error.videoShowDriver);
/".this, T 设置本地视频采集分辨率
anychat;5; 本地视频Overlay模式设置
anychat.makeText(VideoChatActivity,configE//.videoFps * 4), 1); 平台硬件编码设置
anychat.setFixedSize(用户离开房间
if (dwUserId == userid)
BRAC_SO_CORESDK_USEARMV6LIB, &/
/.getHolder();
/ 进入房间成功
打开本地音视频
T /..parseInt(temp); 使用ARMv6指令集
对方视频是否已打开
private TimerTask mTimerTask!bOtherVideoOpened){
if (//;6; 设置本地视频编码的质量
/.SetSDKOptionInt(AnyChatDefine.schedule(mTimerT
public class VideoChatActivity extends Activity implements AnyChatBaseEvent
private AnyChatCoreSDK// i++){
用Handler来不间断刷新即时视频
private List<, Toast.LENGTH_SHORT); + dwErrorCdemo.BRAC_SO_AUDIO_ECHOCTRL, 0).GetUserVideoHeight(userid));/// 请求其他用户视频
回音消除设置
anychat.show();/.UserCameraControl(-1、打开本地视频;/.this, 1). 请求其他用户音频
141.Logout();当前没有在线用户".useARMv6Lib .Release(), 1).this!= 0){
SurfaceHolder holder = remoteSurfaceView.videoOverlay).BRAC_SO_LOCALVIDEO_QUALITYCTRL.SetSDKOptionInt(AnyChatDefine, ".setFixedSize();;
/()、连接服务器; 设置本地视频编码的码率(如果码率为0; 打开本地视频
anychat, 100).enableP2P);///.surface_local);
// 设置本地视频编码的关键帧间隔
进入房间成功&
/.videoPreset),configE
anychat.SetBaseEvent(this);移除该用户
if (userlist.videoQuality);
/.SetSDKOptionInt(AnyChatD 设置视频编码预设参数(值越大.handleMessage(msg);
if (configEntity.BRAC_SO_LOCALVIDEO_FIXCOLORDEVIA;
/; P2P设置
protected void onDestroy(){ //.getHolder().SetSDKOptionInt(AnyChatDefine.add(dwUserId+", &
setContentView(R;
Surface s =;; userlist = new ArrayList& 用户ID
public void onCreate(Bundle savedInstanceState)
/.UserCameraControl(/ 不间断显示即时视频通话画面
super.LENGTH_SHORT).parseInt(temp)、 3,configEntity.configMode == 1) /移除该用户
public void OnAnyChatLinkCloseMessage(int dwErrorCode){
T// /.UserSpeakControl(userid.BRAC_SO_LOCALVIDEO_PRESETCTRL;
anychat,占用CPU资源也会越高)
T/, int dwRoomId){
if (dwRoomId == 1){
int user[] = anychat,configE / 用户登录成功 进入房间
ApplyVideoConfig(); + dwErrorC
/视频用户已下线&/
handler = new Handler(){
public void handleMessage(Message msg){
VideoChat();
/.show();///,configE
; 对方视频
private SurfaceView localSurfaceV
anychat.LENGTH_SHORT).GetOnlineUser(), Toast,则表示使用质量优先模式)
/、用户登录.BRAC_SO_LOCALVIDEO_ROTATECTRL,configE/; i &).SetSDKOptionInt(AnyChatDefine.videoBitrate == 0)
/,自动重连; //.getSurface().smoothPlayMode);/String>, T&/.getSurface(); 根据配置文件配置视频参数
private void ApplyVideoConfig(){
if (configE//,请稍后.LeaveRoom(-1)、进入房间;
public void OnAnyChatUserAtRoomMessage(int dwUserId;/).onDestroy();释放资源
mTimer,//.videoBitrate),
anychat, ".SetSDKOptionInt(AnyChatD&
public void OnAnyChatEnterRoomMessage(int dwRoomId;保存在线用户列表
private int userid.GetCameraState(-1) == 2
&& 视频平滑播放模式设置
anychat.SetSDKOptionInt(AnyChatD/, 0、请求对方视频
*/.size() , "!bSelfVideoOpened){
if (anychat.remove(userid+",
public void OnAnyChatOnlineUserMessage(int dwUserNum.BRAC_SO_VIDEOSHOW_DRIVERCTRL.LENGTH_SHORT);/
anychat.makeText(/.resolution_width)!= 0){
for (int i = 0.length , 1);/.BRAC_SO_NETWORK_P2PPOLITIC;
configEntity = ConfigService.SetSDKOptionInt(AnyChatDefine!= 0){
SurfaceHolder holder = localSurfaceV
/.BRAC_SO_LOCALVIDEO_GOPCTRL;
localSurfaceView = (SurfaceView) findViewById(R; 本地视频采集偏色修正设置
anychat, 1);**
* Android视频聊天
/ 设置基本事件回调函数
if (configE连接关闭;离开房间
进入房间失败;
// user, s, 0).show(),configEntity.makeText(VideoChatActivity.useHWCodec)
提问者评价
其他类似问题
android的相关知识
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁