From 90b4a20e5d251014cb5c18ff5312b25ce11519fb Mon Sep 17 00:00:00 2001 From: drbob Date: Thu, 3 Oct 2013 13:15:10 +0000 Subject: [PATCH] updated VoIP to use new Fast packet sending. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6792 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- plugins/VOIP/gui/SpeexProcessor.h | 2 +- plugins/VOIP/services/p3vors.cc | 60 ++++++++++++++++--------------- plugins/VOIP/services/p3vors.h | 3 +- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/plugins/VOIP/gui/SpeexProcessor.h b/plugins/VOIP/gui/SpeexProcessor.h index 13171f60c..2ebb9869e 100644 --- a/plugins/VOIP/gui/SpeexProcessor.h +++ b/plugins/VOIP/gui/SpeexProcessor.h @@ -22,7 +22,7 @@ #define SAMPLING_RATE 16000 //must be the same as the speex setted mode (speex_wb_mode) #define FRAME_SIZE 320 //must be the same as the speex setted mode (speex_wb_mode) -#define ECHOTAILSIZE 25 +#define ECHOTAILSIZE 10 class SpeexBits; diff --git a/plugins/VOIP/services/p3vors.cc b/plugins/VOIP/services/p3vors.cc index 4071f8db4..b5579b803 100644 --- a/plugins/VOIP/services/p3vors.cc +++ b/plugins/VOIP/services/p3vors.cc @@ -168,7 +168,7 @@ int p3VoRS::tick() std::cerr << "ticking p3VoRS" << std::endl; #endif - processIncoming(); + //processIncoming(); sendPackets(); return 0; @@ -393,44 +393,46 @@ bool p3VoRS::getIncomingData(const std::string& peer_id,std::vectorPacketSubType()) { - bool keep = false ; + case RS_PKT_SUBTYPE_VOIP_PING: + handlePing(dynamic_cast(item)); + break; - switch(item->PacketSubType()) - { - case RS_PKT_SUBTYPE_VOIP_PING: handlePing(dynamic_cast(item)); - break; + case RS_PKT_SUBTYPE_VOIP_PONG: + handlePong(dynamic_cast(item)); + break; - case RS_PKT_SUBTYPE_VOIP_PONG: handlePong(dynamic_cast(item)); - break; + case RS_PKT_SUBTYPE_VOIP_PROTOCOL: + handleProtocol(dynamic_cast(item)) ; + break ; - case RS_PKT_SUBTYPE_VOIP_PROTOCOL: handleProtocol(dynamic_cast(item)) ; - break ; - - case RS_PKT_SUBTYPE_VOIP_DATA: handleData(dynamic_cast(item)); - keep = true ; - break; + case RS_PKT_SUBTYPE_VOIP_DATA: + handleData(dynamic_cast(item)); + keep = true ; + break; #if 0 /* THESE ARE ALL FUTURISTIC DATA TYPES */ - case RS_BANDWIDTH_PING_ITEM: handleBandwidthPing(item); - break; + case RS_BANDWIDTH_PING_ITEM: + handleBandwidthPing(item); + break; - case RS_BANDWIDTH_PONG_ITEM: handleBandwidthPong(item); - break; + case RS_BANDWIDTH_PONG_ITEM: + handleBandwidthPong(item); + break; #endif - default: - break; - } - - /* clean up */ - if(!keep) - delete item; + default: + break; } + + /* clean up */ + if(!keep) + delete item; return true ; } diff --git a/plugins/VOIP/services/p3vors.h b/plugins/VOIP/services/p3vors.h index 79bcf6179..740596da9 100644 --- a/plugins/VOIP/services/p3vors.h +++ b/plugins/VOIP/services/p3vors.h @@ -99,6 +99,7 @@ class p3VoRS: public RsPQIService, public RsVoip */ virtual int tick(); virtual int status(); + virtual bool recvItem(RsItem *item); /*************** pqiMonitor callback ***********************/ //virtual void statusChange(const std::list &plist); @@ -130,7 +131,7 @@ class p3VoRS: public RsPQIService, public RsVoip private: int sendPackets(); void sendPingMeasurements(); - int processIncoming(); + //int processIncoming(); int handlePing(RsVoipPingItem *item); int handlePong(RsVoipPongItem *item);