]> sjero.net Git - linphone/commitdiff
Stores a different payload in Rtptransport.
authorGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Tue, 20 Dec 2011 16:34:02 +0000 (17:34 +0100)
committerGuillaume Beraudo <guillaume.beraudo@belledonne-communications.com>
Tue, 20 Dec 2011 16:34:02 +0000 (17:34 +0100)
coreapi/TunnelManager.cc
coreapi/TunnelManager.hh
oRTP

index 186575c473f55a88d79546189f9392efdbffd13e..9d4ab7c35c4e28c587e29d889ea4dc1b8bcee938 100644 (file)
@@ -68,7 +68,7 @@ int TunnelManager::eXosipSelect(int max_fds, fd_set *s1, fd_set *s2, fd_set *s3,
        TunnelManager* lTunnelMgr=(TunnelManager*)userdata;
        if (tv!=0 && tv->tv_sec){
                /*this is the select from udp.c, the one that is interesting to us*/
-               unsigned int i;
+               int i;
                int udp_fd=eXosip_get_udp_socket();
                int controlfd=-1;
 
@@ -155,13 +155,13 @@ void TunnelManager::setCallback(StateCallback cb, void *userdata) {
        mCallbackData=userdata;
 }
 
-static void sCloseRtpTransport(void *userData, RtpTransport *t){
-       ((TunnelManager::TunnelManager *) userData)->closeRtpTransport(t);
+static void sCloseRtpTransport(RtpTransport *t, void *userData){
+       TunnelSocket *s=(TunnelSocket*)userData;
+       TunnelManager::TunnelManager *manager=(TunnelManager::TunnelManager*)s->getUserPointer();
+       manager->closeRtpTransport(t, s);
 }
-void TunnelManager::closeRtpTransport(RtpTransport *t){
-       TunnelSocket *socket=(TunnelSocket *) t->data;
-       mTransports.remove(t);
-       mTunnelClient->closeSocket(socket);
+void TunnelManager::closeRtpTransport(RtpTransport *t, TunnelSocket *s){
+       mTunnelClient->closeSocket(s);
        ms_free(t);
 }
 
@@ -170,14 +170,14 @@ static RtpTransport *sCreateRtpTransport(void* userData, int port){
 }
 
 RtpTransport *TunnelManager::createRtpTransport(int port){
+       TunnelSocket *socket=mTunnelClient->createSocket(port);
+       socket->setUserPointer(this);
        RtpTransport *t=ms_new0(RtpTransport,1);
-       t->data=mTunnelClient->createSocket(port);
        t->t_getsocket=NULL;
        t->t_recvfrom=customRecvfrom;
        t->t_sendto=customSendto;
-       t->close_fn=sCloseRtpTransport;
-       t->close_data=this;
-       mTransports.push_back(t);
+       t->t_close=sCloseRtpTransport;
+       t->data=socket;
        return t;
 }
 
index 20bb75d3d653787e4856bf0d938b0a7698eb2460..b6bc46723a884b35e22f9b8ef727df4234211cd0 100644 (file)
@@ -115,7 +115,7 @@ class UdpMirrorClient;
                /**
                 * Destroy the given RtpTransport.
                 */
-               void closeRtpTransport(RtpTransport *t);
+               void closeRtpTransport(RtpTransport *t, TunnelSocket *s);
 
                /**
                 * Create an RtpTransport.
@@ -128,7 +128,6 @@ class UdpMirrorClient;
                LinphoneCore *getLinphoneCore();
        private:
                typedef std::list<UdpMirrorClient> UdpMirrorClientList;
-               typedef std::list<RtpTransport*> RtpTransportList;
                virtual bool isStarted();
                virtual bool isReady() const;
                static int customSendto(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen);
@@ -156,7 +155,6 @@ class UdpMirrorClient;
                void stopClient();
                static Mutex sMutex;
                bool mAutoDetectStarted;
-               RtpTransportList mTransports;
                LinphoneRtpTransportFactories mTransportFactories;
        };
 
diff --git a/oRTP b/oRTP
index 728617bf729b7c27069dd23b95f21508b0fdd6b8..cb6bd1b8684d94d473bed38dd02029bd3a48df6e 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 728617bf729b7c27069dd23b95f21508b0fdd6b8
+Subproject commit cb6bd1b8684d94d473bed38dd02029bd3a48df6e