資源簡介
TeamTalk是一套開源的企業(yè)辦公即時通訊軟件,作為整套系統(tǒng)的組成部分之一,TTServer為TeamTalk 客戶端提供用戶登錄,消息轉(zhuǎn)發(fā)及存儲等基礎(chǔ)服務(wù)。
TTServer主要包含了以下幾種服務(wù)器:
LoginServer (C++): 登錄服務(wù)器,分配一個負載小的MsgServer給客戶端使用
MsgServer (C++): 消息服務(wù)器,提供客戶端大部分信令處理功能,包括私人聊天、群組
代碼片段和文件信息
#include?
#include?
#include?
//#include?
//#include?
/*start*/
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
//?the?header?length?of?the?RTP?frame?(must?skip?when?en/decoding)
static?const?int?rtp_header?=?0;
int?codec_status?=?0;
const?int?CODEC_OPENED?=?1;
const?int?CODEC_CLOSED?=?0;
int?aec_status?=?0;
const?int?AEC_OPENED?=?1;
const?int?AEC_CLOSED?=?0;
SpeexEchoState?*echoState;
SpeexPreprocessState?*den;
int?sampleRate?=?16000;
/*end*/
static?int?codec_open?=?0;
static?int?dec_frame_size;
static?int?enc_frame_size;
static?SpeexBits?ebits?dbits;
void?*enc_state;
void?*dec_state;
static?JavaVM?*gJavaVM;
extern?“C“?JNIEXPORT?jint?JNICALL?Java_com_mogujie_tt_support_audio_Speex_open(
JNIEnv?*env?jobject?obj?jint?compression)?{
int?tmp?=?0;
if?(codec_open++?!=?0)
return?(jint)?0;
speex_bits_init(&ebits);
speex_bits_init(&dbits);
enc_state?=?speex_encoder_init(&speex_nb_mode);
dec_state?=?speex_decoder_init(&speex_nb_mode);
tmp?=?compression;
speex_encoder_ctl(enc_state?SPEEX_SET_QUALITY?&tmp);
speex_encoder_ctl(enc_state?SPEEX_GET_frame_SIZE?&enc_frame_size);
speex_decoder_ctl(dec_state?SPEEX_GET_frame_SIZE?&dec_frame_size);
SpeexPreprocessState?*?m_st;
m_st?=?speex_preprocess_state_init(enc_frame_size?8000);
int?denoise?=?1;
int?noiseSuppress?=?-25;
speex_preprocess_ctl(m_st?SPEEX_PREPROCESS_SET_DENOISE?&denoise);
speex_preprocess_ctl(m_st?SPEEX_PREPROCESS_SET_NOISE_SUPPRESS
&noiseSuppress);
return?(jint)?0;
}
extern?“C“?JNIEXPORT?jint?JNICALL?Java_com_mogujie_tt_support_audio_Speex_encode(
JNIEnv?*env?jobject?obj?jshortArray?lin?jint?offset
jbyteArray?encoded?jint?size)?{
jshort?buffer[enc_frame_size];
jbyte?output_buffer[enc_frame_size];
int?nsamples?=?(size?-?1)?/?enc_frame_size?+?1;
int?i?tot_bytes?=?0;
if?(!codec_open)
return?0;
speex_bits_reset(&ebits);
for?(i?=?0;?i? env->GetShortArrayRegion(lin?offset?+?i?*?enc_frame_size
enc_frame_size?buffer);
speex_encode_int(enc_state?buffer?&ebits);
}
//env->GetShortArrayRegion(lin?offset?enc_frame_size?buffer);
//speex_encode_int(enc_state?buffer?&ebits);
tot_bytes?=?speex_bits_write(&ebits?(char?*)?output_buffer
enc_frame_size);
env->SetByteArrayRegion(encoded?0?tot_bytes?output_buffer);
return?(jint)?tot_bytes;
}
extern?“C“?JNIEXPORT?jint?Java_com_mogujie_tt_support_audio_Speex_decode(
JNIEnv?*env?jobject?obj?jbyteArray?encoded?jshortArray?lin
jint?size)?{
jbyte?buffer[dec_frame_size];
jshort?output_buffer[dec_frame_size];
jsize?encoded_length?=?size;
if?(!codec_open)
return?0;
env->GetByteArrayRegion(encoded?0?encoded_length?buffer);
speex_bits_read_from(&dbits?(char?*)?buffer?encoded_length);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-04-14?11:01??mogutt_2015年5月前原版未刪減代碼(52im.net)\
?????文件????????1286??2016-07-11?17:29??mogutt_2015年5月前原版未刪減代碼(52im.net)\52im_readme.txt
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\branches\
?????文件?????????306??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\config
?????文件??????????73??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\desc
?????文件??????????23??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\HEAD
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\
?????文件?????????452??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\applypatch-msg.sample
?????文件?????????896??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\commit-msg.sample
?????文件?????????189??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\post-update.sample
?????文件?????????398??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\pre-applypatch.sample
?????文件????????1642??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\pre-commit.sample
?????文件????????1352??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\pre-push.sample
?????文件????????4951??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\pre-reba
?????文件????????1239??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\prepare-commit-msg.sample
?????文件????????3611??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\hooks\update.sample
?????文件?????????104??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\index
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\info\
?????文件?????????240??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\info\exclude
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\
?????文件?????????190??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\HEAD
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\refs\
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\refs\heads\
?????文件?????????190??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\refs\heads\master
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\refs\remotes\
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\refs\remotes\origin\
?????文件?????????190??2014-10-28?21:48??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\logs\refs\remotes\origin\HEAD
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\ob
?????目錄???????????0??2017-04-14?10:59??mogutt_2015年5月前原版未刪減代碼(52im.net)\README\.git\ob
............此處省略7990個文件信息
評論
共有 條評論