package com.bairuitech.anychat; // 不能修改包的名称
import java.lang.ref.WeakReference;
import android.view.Surface;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
public class AnyChatCoreSDK
{
AnyChatBaseEvent baseEvent;
AnyChatStateChgEvent stateChgEvent;
AnyChatPrivateChatEvent privateChatEvent;
AnyChatTextMsgEvent textMsgEvent;
AnyChatTransDataEvent transDataEvent;
AnyChatVideoCallEvent videoCallEvent;
AnyChatUserInfoEvent userInfoEvent;
AnyChatDataEncDecEvent encdecEvent;
AnyChatRecordEvent recordEvent;
AnyChatObjectEvent objectEvent;
private static AnyChatCoreSDK mAnyChat = null; // 单例模式对象
static MainHandler mHandler = null;
public static AnyChatAudioHelper mAudioHelper = new AnyChatAudioHelper();
public static AnyChatCameraHelper mCameraHelper = new AnyChatCameraHelper();
public AnyChatSensorHelper mSensorHelper = new AnyChatSensorHelper();
public AnyChatVideoHelper mVideoHelper = new AnyChatVideoHelper();
private static int HANDLE_TYPE_NOTIFYMSG = 1; // 消息通知
private static int HANDLE_TYPE_TEXTMSG = 2; // 文字信息
private static int HANDLE_TYPE_TRANSFILE = 3; // 文件传输
private static int HANDLE_TYPE_TRANSBUF = 4; // 缓冲区传输
private static int HANDLE_TYPE_TRANSBUFEX = 5; // 扩展缓冲区传输
private static int HANDLE_TYPE_SDKFILTER = 6; // SDK Filter Data
private static int HANDLE_TYPE_VIDEOCALL = 7; // 视频呼叫
private static int HANDLE_TYPE_RECORD = 8; // 录像、拍照
private static int HANDLE_TYPE_OBJECTEVENT = 9; // 业务对象事件
// 获取单例模式对象
public synchronized static AnyChatCoreSDK getInstance(Context context)
{
if(mAnyChat==null)
mAnyChat = new AnyChatCoreSDK();
return mAnyChat;
}
// 设置AnyChat基本事件通知接口
public void SetBaseEvent(AnyChatBaseEvent e)
{
mHandler = new MainHandler(this);
RegisterNotify();
this.baseEvent = e;
}
// 设置AnyChat状态变化事件通知接口
public void SetStateChgEvent(AnyChatStateChgEvent e)
{
RegisterNotify();
this.stateChgEvent = e;
}
// 设置AnyChat私聊消息通知接口
public void SetPrivateChatEvent(AnyChatPrivateChatEvent e)
{
RegisterNotify();
this.privateChatEvent = e;
}
// 设置文字聊天消息通知接口
public void SetTextMessageEvent(AnyChatTextMsgEvent e)
{
RegisterNotify();
this.textMsgEvent = e;
}
// 设置数据传输消息通知接口
public void SetTransDataEvent(AnyChatTransDataEvent e)
{
RegisterNotify();
this.transDataEvent = e;
}
// 设置视频呼叫事件通知接口
public void SetVideoCallEvent(AnyChatVideoCallEvent e)
{
RegisterNotify();
this.videoCallEvent = e;
}
// 设置用户信息(好友)事件通知接口
public void SetUserInfoEvent(AnyChatUserInfoEvent e)
{
RegisterNotify();
this.userInfoEvent = e;
}
// 设置数据加密、解密回调事件接口
public void SetDataEncDecEvent(AnyChatDataEncDecEvent e)
{
RegisterNotify();
this.encdecEvent = e;
}
// 设置视频录制、拍照事件通知接口
public void SetRecordSnapShotEvent(AnyChatRecordEvent e)
{
RegisterNotify();
this.recordEvent = e;
}
// 设置业务对象事件通知接口
public void SetObjectEvent(AnyChatObjectEvent e)
{
RegisterNotify();
this.objectEvent = e;
}
// 查询SDK主版本号
public int GetSDKMainVersion()
{
return GetSDKOptionInt(AnyChatDefine.BRAC_SO_CORESDK_MAINVERSION);
}
// 查询SDK从版本号
public int GetSDKSubVersion()
{
return GetSDKOptionInt(AnyChatDefine.BRAC_SO_CORESDK_SUBVERSION);
}
// 查询SDK编译时间
public String GetSDKBuildTime()
{
return GetSDKOptionString(AnyChatDefine.BRAC_SO_CORESDK_BUILDTIME);
}
// 注册消息通知
public native int RegisterNotify();
// 初始化SDK
public native int InitSDK(int osver, int flags);
// 连接服务器
public native int Connect(String serverip, int port);
// 登录系统
public native int Login(String username, String password);
// 登录系统(扩展)
public native int LoginEx(String nickname, int userid, String struserid, String appid, int timestamp, String sigstr, String strparam);
// 进入房间(房间ID)
public native int EnterRoom(int roomid, String password);
// 进入房间(房间名称)
public native int EnterRoomEx(String roomname, String password);
// 退出房间
public native int LeaveRoom(int roomid);
// 注销登录
public native int Logout();
// 释放资源
public native int Release();
// 获取在线用户列表(推荐使用GetRoomOnlineUsers)
public native int[] GetOnlineUser();
// 获取指定房间在线用户列表
public native int[] GetRoomOnlineUsers(int roomid);
// 设置视频显示位置
public native int SetVideoPos(int userid, Surface s, int lef, int top, int right, int bottom);
// 用户摄像头控制
public native int UserCameraControl(int userid, int bopen);
// 用户音频控制
public native int UserSpeakControl(int userid, int bopen);
// 用户音、视频录制
public native int StreamRecordCtrl(int userid, int bstartrecord, int flags, int param);
// 用户音、视频录制(扩展)
public native int StreamRecordCtrlEx(int userid, int bstartrecord, int flags, int param, String szUserStr);
// 用户图像抓拍
public native int SnapShot(int userid, int flags, int param);
// 获取指定音频设备的当前音量
public native int AudioGetVolume(int device);
// 设置指定音频设备的音量
public native int AudioSetVolume(int device, int volume);
// 获取指定用户的字符串类型状态
public native String QueryUserStateString(int userid, int infoname);
// 获取指定用户的整型状态
public native int QueryUserStateInt(int userid, int infoname);
// 获取指定用户的说话音量(0 ~ 100)
public native int GetUserSpeakVolume(int userid);
// 获取指定用户的摄像头状态
public native int GetCameraState(int userid);
// 获取指定用户的音频设备状态
public native int GetSpeakState(int userid);
// 获取指定用户的视频分辨率宽度
public native int GetUserVideoWidth(int userid);
// 获取指定用户的视频分辨率高度
public native int GetUserVideoHeight(int userid);
// 获取指定房间的字符串类型状态
public native String QueryRoomStateString(int roomid, int infoname);
// 获取指定房间的整型状态
public native int QueryRoomStateInt(int roomid, int infoname);
// 设置服务器认证密码
public native int SetServerAuthPass(String Password);
// 设置SDK参数(整型值)
public static native int SetSDKOptionInt(int optname, int optvalue);
// 设置SDK参数(字符串值)
public static native int SetSDKOptionString(int optname, String optvalue);
// 查询SDK参数(整型值)
public static native int GetSDKOptionInt(int optname);
// 查询SDK参数(字符串值)
public static native String GetSDKOptionString(int optname);
// 发送文字消息
public native int SendTextMessage(int userid, int secret, String message);
// 传送文件
public native int TransFile(int userid, String filepath, int wparam, int lparam, int flags, AnyChatOutParam outParam);
// 透明通道传送缓冲区
public native int TransBuffer(int userid, byte[] buf, int len);
// 透明通道传送缓冲区扩展
public native int TransBufferEx(int userid, byte[] buf, int len, int wparam, int lparam, int flags, AnyChatOutParam outParam);
// 终止传输任务
public native int CancelTransTask(int userid, int taskid);
// 查询传输任务状�
没有合适的资源?快使用搜索试试~ 我知道了~
android视频聊天大小窗口的实现
共179个文件
class:56个
png:51个
java:31个
4星 · 超过85%的资源 需积分: 50 276 下载量 44 浏览量
2016-08-03
21:59:24
上传
评论 6
收藏 18.19MB ZIP 举报
温馨提示
视频聊天切换。VideoActivity里面changeSize执行切换逻辑
资源推荐
资源详情
资源评论
收起资源包目录
android视频聊天大小窗口的实现 (179个子文件)
resources.ap_ 561KB
HelloAnyChat.apk 8.18MB
jarlist.cache 120B
MainActivity.class 17KB
AnyChatCoreSDK.class 15KB
VideoActivity.class 12KB
AnyChatDefine.class 9KB
VideoConfig.class 9KB
AnyChatCameraHelper.class 9KB
AnyChatAudioHelper.class 5KB
AnyChatCoreSDK$MainHandler.class 5KB
VideoRenderer.class 5KB
HttpUtil.class 4KB
MainActivity$3.class 4KB
AnyChatSensorHelper.class 4KB
AnyChatObjectDefine.class 3KB
RoleListAdapter.class 3KB
ConfigService.class 3KB
WidgetController.class 2KB
R$id.class 2KB
VideoActivity$2.class 2KB
ValueUtils.class 2KB
AnyChatVideoHelper.class 2KB
VideoActivity$1.class 2KB
MainActivity$2.class 2KB
AnyChatAudioHelper$RecordAudioThread.class 2KB
AnyChatAudioHelper$PlayAudioThread.class 2KB
MainActivity$1.class 2KB
MainActivity$3$1.class 2KB
MainActivity$5.class 2KB
AnyChatOutParam.class 1KB
MainActivity$4.class 1KB
R$drawable.class 1KB
VideoConfig$1.class 1KB
AnyChatCameraHelper$1.class 1KB
ConfigEntity.class 1KB
AnyChatOrientationEventListener.class 1KB
RoleInfo.class 994B
VideoActivity$3.class 903B
VideoActivity$4.class 900B
DisPlayUtils.class 876B
R.class 681B
RoleListAdapter$ViewHolder.class 668B
R$color.class 602B
R$layout.class 593B
AnyChatDataEncDecEvent.class 561B
R$string.class 482B
R$style.class 449B
AnyChatBaseEvent.class 378B
AnyChatStateChgEvent.class 360B
R$attr.class 358B
BuildConfig.class 357B
AnyChatTransDataEvent.class 351B
AnyChatRecordEvent.class 297B
AnyChatPrivateChatEvent.class 275B
AnyChatUserInfoEvent.class 218B
AnyChatVideoCallEvent.class 209B
AnyChatObjectEvent.class 202B
AnyChatTextMsgEvent.class 200B
.classpath 475B
classes.dex 783KB
android-support-v4.jar 613KB
android-support-v4-a448147cd0eec87595c275f87ea642d2.jar 232KB
AnyChatCoreSDK.java 28KB
AnyChatDefine.java 27KB
MainActivity.java 20KB
VideoActivity.java 16KB
AnyChatCameraHelper.java 12KB
VideoConfig.java 11KB
AnyChatAudioHelper.java 8KB
AnyChatVideoHelper.java 7KB
R.java 7KB
AnyChatObjectDefine.java 6KB
HttpUtil.java 6KB
AnyChatSensorHelper.java 5KB
ConfigService.java 3KB
WidgetController.java 3KB
RoleListAdapter.java 2KB
ConfigEntity.java 2KB
ValueUtils.java 1KB
AnyChatBaseEvent.java 1KB
AnyChatStateChgEvent.java 1KB
AnyChatOutParam.java 914B
AnyChatDataEncDecEvent.java 899B
AnyChatPrivateChatEvent.java 681B
AnyChatTransDataEvent.java 675B
DisPlayUtils.java 628B
RoleInfo.java 540B
AnyChatUserInfoEvent.java 496B
AnyChatRecordEvent.java 456B
AnyChatTextMsgEvent.java 388B
AnyChatObjectEvent.java 280B
AnyChatVideoCallEvent.java 252B
BuildConfig.java 166B
videoremote_bg.jpg 82KB
background.png 365KB
background.png 352KB
role_4.png 17KB
role_4.png 17KB
role_2.png 16KB
共 179 条
- 1
- 2
wl332197858
- 粉丝: 3
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页