added communitation between service and GUI part of VOIP plugin.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4990 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-02-25 18:15:36 +00:00
parent 12b3ed02f1
commit db07053214
9 changed files with 107 additions and 7 deletions

View file

@ -35,6 +35,7 @@
#include "services/p3vors.h"
#include "services/rsvoipitems.h"
#include "gui/PluginNotifier.h"
#include <sys/time.h>
@ -142,8 +143,8 @@ static double convert64bitsToTs(uint64_t bits)
return ts;
}
p3VoRS::p3VoRS(RsPluginHandler *handler)
: RsPQIService(RS_SERVICE_TYPE_VOIP_PLUGIN,CONFIG_TYPE_VOIP_PLUGIN,0,handler), mVorsMtx("p3VoRS"), mLinkMgr(handler->getLinkMgr())
p3VoRS::p3VoRS(RsPluginHandler *handler,PluginNotifier *notifier)
: RsPQIService(RS_SERVICE_TYPE_VOIP_PLUGIN,CONFIG_TYPE_VOIP_PLUGIN,0,handler), mVorsMtx("p3VoRS"), mLinkMgr(handler->getLinkMgr()) , mNotify(notifier)
{
addSerialType(new RsVoipSerialiser());
@ -301,7 +302,19 @@ void p3VoRS::handleProtocol(RsVoipProtocolItem *item)
// we notify the notifier that something occurred.
// mNotify->notifyPluginAction(mPluginId, PluginSignalId, (void *)data_to_send_upward);
switch(item->protocol)
{
case RsVoipProtocolItem::VoipProtocol_Ring: std::cerr << "Received protocol ring item." << std::endl;
mNotify->notifyReceivedVoipInvite(item->PeerId());
break ;
case RsVoipProtocolItem::VoipProtocol_Ackn:
case RsVoipProtocolItem::VoipProtocol_Close:
default:
std::cerr << "Received protocol item # " << item->protocol << ": not handled yet ! Sorry" << std::endl;
break ;
}
}
void p3VoRS::handleData(RsVoipDataItem *item)
@ -321,7 +334,7 @@ void p3VoRS::handleData(RsVoipDataItem *item)
{
it->second.incoming_queue.push_back(item) ; // be careful with the delete action!
// notify->notifyPluginAction(mPluginId, PluginSignalId, (void *)data_to_send_upward);
mNotify->notifyReceivedVoipData(item->PeerId());
}
}

View file

@ -36,6 +36,7 @@
#include <interface/rsvoip.h>
class p3LinkMgr;
class PluginNotifier ;
class VorsPeerInfo
{
@ -67,7 +68,7 @@ class p3VoRS: public RsPQIService, public RsVoip
//, public p3Config, public pqiMonitor
{
public:
p3VoRS(RsPluginHandler *cm);
p3VoRS(RsPluginHandler *cm,PluginNotifier *);
/***** overloaded from rsVoip *****/
@ -127,7 +128,7 @@ class p3VoRS: public RsPQIService, public RsVoip
virtual bool loadList(std::list<RsItem*>& load) ;
private:
int sendPackets();
int sendPackets();
void sendPingMeasurements();
int processIncoming();
@ -152,6 +153,7 @@ class p3VoRS: public RsPQIService, public RsVoip
uint32_t mCounter;
p3LinkMgr *mLinkMgr;
PluginNotifier *mNotify ;
int _atransmit ;
int _voice_hold ;