- 浏览: 1478028 次
- 性别:
- 来自: 南京
文章分类
- 全部博客 (419)
- XMPP (19)
- Android (180)
- Java (59)
- Network (4)
- HTML5 (13)
- Eclipse (9)
- SCM (23)
- C/C++ (4)
- UML (4)
- Libjingle (15)
- Tools&Softwares (29)
- Linphone (5)
- Linux&UNIX (6)
- Windows (18)
- Google (10)
- MISC (3)
- SIP (6)
- SQLite (5)
- Security (4)
- Opensource (29)
- Online (2)
- 文章 (3)
- MemoryLeak (10)
- Decompile (5)
- Ruby (1)
- Image (1)
- Bat (4)
- TTS&ASR (28)
- Multimedia (1)
- iOS (20)
- Asciiflow - ASCII Flow Diagram Tool.htm (1)
- Networking (1)
- DLNA&UPnP (2)
- Chrome (2)
- CI (1)
- SmartHome (0)
- CloudComputing (1)
- NodeJS (3)
- MachineLearning (2)
最新评论
-
bzhao:
点赞123!
Windows的adb shell中使用vi不乱码方法及AdbPutty -
wahahachuang8:
我觉得这种东西自己开发太麻烦了,就别自己捣鼓了,找个第三方,方 ...
HTML5 WebSocket 技术介绍 -
obehavior:
view.setOnTouchListenerview是什么
[转]android 一直在最前面的浮动窗口效果 -
wutenghua:
[转]android 一直在最前面的浮动窗口效果 -
zee3.lin:
Sorry~~
When I build "call ...
Step by Step about How to Build libjingle 0.4
call_main.cc的main()方法中创建CallClient对象:
CallClient *client = new CallClient(pump.client());
CallClient is the top level manager for all calls in a voice chat application.
当登陆到Server后, XmppClient的SignalStateChange会传到CallClient::OnStateChange(), 这里会调用函数:
InitPhone();
在InitPhone()中一些很重要的对象被创建, 这些对象会在程序运行过程中一直被使用:
// 创建并运行Worker线程
worker_thread_ = new talk_base::Thread();
worker_thread_->Start();
// 创建NetworkManager对象
network_manager_ = new talk_base::NetworkManager();
// 创建PortAllocator对象
talk_base::SocketAddress stun_addr("stun.l.google.com", 19302);
port_allocator_ =
new cricket::BasicPortAllocator(network_manager_, stun_addr,
talk_base::SocketAddress(), talk_base::SocketAddress(),
talk_base::SocketAddress());
// 创建SessionManager对象
session_manager_ = new cricket::SessionManager(
port_allocator_, worker_thread_);
// 创建并运行SessionManagerTask任务
session_manager_task_ =
new cricket::SessionManagerTask(xmpp_client_, session_manager_);
session_manager_task_->EnableOutgoingMessages();
session_manager_task_->Start();
// 创建MediaEngine对象
media_engine_ = cricket::MediaEngine::Create();
// 创建MediaSessionClient对象
media_client_ = new cricket::MediaSessionClient(
xmpp_client_->jid(),
session_manager_,
media_engine_,
new cricket::DeviceManager());
当要place voice call的时候, CallClient::MakeCallTo()->CallClient::PlaceCall()被调用, 在CallClient::PlaceCall()里, Call对象和Session对象会被创建:
call_ = media_client_->CreateCall();
session_ = call_->InitiateSession(jid, options);
MediaSessionClient is the top level manager for Call objects, each of which represents one or more voice chat connections. It also is the top level manager for handles creating the offer description by collecting the list of codecs supported by the computer. In addition to the base SessionClient tasks, it handles voice chat specific tasks such as reading and generating codec lists, choosing a codec, and managing global audio settings. It creates Call objects and the ChannelManager object. The application instantiates this object.
Call handles one or more Session objects, each representing a connection between two users. A multi-person chat would consist of a single Call object managing several Session objects, one per connection. The Call object handles the top-level jobs for that call, for example ending sessions, making a call to another user, accepting an incoming call, handling audio tasks such as mute and monitoring, and so on. It sends signals when sessions are created, ended, or change state (connecting, running, and so on). For outgoing calls, the application instantiates this object; for incoming calls, it is instantiated for you by MediaSessionClient.
在Call::InitiateSession()里,
Session *session = session_client_->CreateSession(this);
AddSession(session, offer);
session->Initiate(jid.Str(), offer);
在Call::AddSession()里,
voice_channel = session_client_->channel_manager()->CreateVoiceChannel(
session, audio_offer->name, video_);
video_channel = session_client_->channel_manager()->CreateVideoChannel(
session, video_offer->name, true, voice_channel);
在ChannelManager::CreateVoiceChannel()里, 调用CreateVoiceChannel_w(),然后创建VoiceChannel对象:
VoiceChannel* voice_channel = new VoiceChannel(
worker_thread_, media_engine_.get(), media_channel,
session, content_name, rtcp);
而VoiceChannel对象创建时会创建TransportChannel对象:
VoiceChannel::VoiceChannel(talk_base::Thread* thread,
MediaEngine* media_engine,
VoiceMediaChannel* media_channel,
BaseSession* session,
const std::string& content_name,
bool rtcp)
: BaseChannel(thread, media_engine, media_channel, session, content_name,
session->CreateChannel(content_name, "rtp")),
received_media_(false) {
...
}
而Session::CreateChannel()会首先创建(如果已经创建则直接获得)Transport对象:
TransportProxy* transproxy = GetOrCreateTransportProxy(content_name);
return transproxy->CreateChannel(channel_name, content_type_);
在Session::GetOrCreateTransportProxy()中,
Transport* transport =
new P2PTransport(signaling_thread_,
session_manager_->worker_thread(),
session_manager_->port_allocator());
在TransportProxy::CreateChannel()中,
TransportChannelProxy* channel =
new TransportChannelProxy(name, content_type);
在Session::Initiate()里, 会调用SendInitiateMessage()发送session initiate消息给远端. 然后改变状态为STATE_SENTINITIATE, 这个会触发SignalState, 传给Call::OnSessionState().
然后触发SignalSessionState, 传给CallClient::OnSessionState(), CallClient会显示"Calling...".
在Session::Initiate()里, 也会调用SpeculativelyConnectAllTransportChannels(). TransportProxy::SpeculativelyConnectChannels()->Transport::ConnectChannels()->Transport::ConnectChannels_w()
->P2PTransportChannel::Connect()->
// Kick off an allocator session
Allocate();
->SignalRequestSignaling->Transport::OnChannelRequestSignaling()->SignalRequestSignaling->Session::OnTransportRequestSignaling()->SignalRequestSignaling->SessionManager::OnRequestSignaling()->CallClient::OnRequestSignaling()()
->session_manager_->OnSignalingReady()
->Session::OnSignalingReady()->Transport::OnSignalingReady()->P2PTransportChannel::OnSignalingReady()
->AddAllocatorSession(allocator_->CreateSession(name(), content_type()));
->PortAllocatorSession::GetInitialPorts()->BasicPortAllocatorSession::GetInitialPorts()->BasicPortAllocatorSession::OnAllocate()->AllocationSequence::OnMessage()->CreateUDPPorts()/CreateStunPorts()/CreateTCPPorts()
发表评论
-
[Libjingle代码分析]Libjingle的线程机制与Android平台的Handler机制相似
2011-02-27 19:55 2616不愧都是Google写的代码, Libjingle用到的Thr ... -
[Libjingle代码分析]对照Jingle的XMPP stanza理解Libjingle的几个关键数据结构
2011-02-27 13:34 35611. SessionManager管理多个Session: ... -
Libjingle代码分析之Thread篇
2011-02-23 14:59 0Libjingle的Thread机制竟然与Android的Ha ... -
Libjingle另一个很隐藏但却很致命的错误 - WSAECONNRESET (10054) Connection reset by peer.
2011-02-20 18:50 5438无论Libjingle 0.4.0还是0.5.2 (相比较0. ... -
Libjingle一个虽小但却很严重的bug - 误导人的SocketAddress构造函数参数名称
2011-02-19 23:47 3339在Libjingle+Linphone for Windows ... -
Build for Libjingle 0.5.2 + Mediastreamer2
2011-02-18 20:01 2742Mediastreamer support in 0.5.0 ... -
RTP Tools
2011-02-18 01:00 1874http://www.cs.columbia.edu/irt/ ... -
在Windows下编译最新版本的Libjingle
2011-02-17 14:09 12779Libjingle版本: 0.5.2 操作系统: Window ... -
Myjingle src code
2011-02-14 22:38 2659. -
终于搞定Windows下Libjingle+Linphone Voice Engine的语音通信
2011-02-14 20:49 4137Libjingle在Windows下的语音引擎默认的是GIPS ... -
[Libjingle 0.4]LibJingle编译指南
2011-02-14 17:24 1964LibJingle (for Ubuntu) 编译指南 ... -
[Libjingle 0.4]编译Libjingle 0.4+Linphone Voice Engine的总结之一
2011-02-14 16:59 2897在Windows下编译Libjingle 0.4+Linpho ... -
Step by Step about How to Build libjingle 0.4
2011-02-12 17:36 52721. Download and Install Visual ... -
libjingle 0.4和0.5版本之间的区别
2011-02-12 15:19 2621我所知道的主要的区别是: 1. Build方式的区别. 0. ... -
决定花点时间研究下libjingle
2011-02-12 15:02 7057Project and Source Code Locatio ...
相关推荐
目前GOOGLECODE上的最新更新删除了libjingle.vcproj文件,采用scons脚本进行编译,增加了学习门槛,本次下载包增加了libjingle.vcproj文件并且已经通过了vs2005编译,方便大家学习使用。 Libjingle - Google Talk ...
VS2010编译libjingle0.6.2步骤 图文并茂
带GIPS的libjingle source
Libjingle是Google提供的C++组件集,它为Google Talk的点对点通讯与语音呼叫功能提供交互操作性。组件包包括了Jingle和Jingle-Audio的google实现的源代码,它们是XMPP标准的推荐扩展,目前试验版可用。 我们发布此...
android Webrtc ( libjingle_peerconnection_builds 包括例子
libjingle vs2010 编译通过
libjingle-0.5.1.zip,WebRTC nat打洞专用。
libjingle源码(含GIPS LITE),方便大家编译上传
从官网上复制的libjingle开发者指南和源码索引,你也可以访问一下网站: https://developers.google.com/talk/libjingle/developer_guide
libjingle0.6.14 版本,p2p学习
libjingle 中文 手册,很不错的哦,描述的很清楚,还有使用范例
libjingle0.6.14编译好的.lib
libjingle_peerconnection.jar libjingle_peerconnection.so 2016.8.11 号编译
libjingle的封装库,可以快速开发基于XMPP的客户端通信,方便试用
最完全,最全面的Android框架列表libjingle_peerconnection_so
源:https://developers.google.com/talk/libjingle/reference/ 语言:English 源于谷歌的libjingle的API。 个人整理成表格,方便开发时查找。 希望能帮助相关开发者。
作者:Group ArmTalk 文档:2011-11-30 ...1. Libjingle是什么 2. 怎么获取Libjingle 3. 怎么交叉编译Libjingle(arm-linux-) 以下是个人说明: 要在ARM架构的嵌入式设备使用libjingle,可以参考该文档进行操作
基于LibJingle框架的P2P平台介绍。看了一阵子libjingle的代码,对私网穿透有了一些了解。对p2p做一个简单的概述。
libjingle 0.6.6、0.6.9以及最新的0.6.10在windows和ubuntu-linux上编译通过,现将编译过程及遇到的一些问题总结分享一下