[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ccrtp-devel] Broadcasting RTP
From: |
Jeremy |
Subject: |
Re: [Ccrtp-devel] Broadcasting RTP |
Date: |
Thu, 16 Oct 2003 12:34:32 +0200 (SAST) |
On Thu, 16 Oct 2003, Federico Montesino Pouzols wrote:
> In order to do this extension you would need to replicate and
> adapt the methods that are already replicated for multicast and
> unicast addresses. Could you provide more info on what does not work?
> I would be glad to integrate this extension into ccRTP.
I grepped for "InetMcastAddress" in /src and /src/ccrtp and added methods
to handle "BroadcastAddress" wherever I found them, with the exception of
the RTPSession constructors which seem to be binding to the local IP.
If I addDestination() with a BroadcastAddress I don't get any errors, but
I don't receive any packets either.
Heres a diff of my modifications:
--------------------------------------------
diff -ru ../ccrtp-1.0.2/src/ccrtp/channel.h src/ccrtp/channel.h
--- ../ccrtp-1.0.2/src/ccrtp/channel.h 2003-06-07 01:18:48.000000000 +0200
+++ src/ccrtp/channel.h 2003-10-15 16:51:20.000000000 +0200
@@ -132,6 +132,10 @@
setMulticast(bool enable)
{ return UDPSocket::setMulticast(enable); }
+ Socket::Error
+ setBroadcast(bool enable)
+ { return UDPSocket::setBroadcast(enable); }
+
inline Socket::Error
join(const InetMcastAddress& ia)
{ return Socket::join(ia); }
@@ -226,6 +230,10 @@
setMulticast(bool enable)
{ return recvSocket->setMulticast(enable); }
+ Socket::Error
+ setBroadcast(bool enable)
+ { return recvSocket->setBroadcast(enable); }
+
inline Socket::Error
join(const InetMcastAddress& ia)
{ return recvSocket->join(ia); }
diff -ru ../ccrtp-1.0.2/src/ccrtp/oqueue.h src/ccrtp/oqueue.h
--- ../ccrtp-1.0.2/src/ccrtp/oqueue.h 2003-06-07 01:18:48.000000000 +0200
+++ src/ccrtp/oqueue.h 2003-10-15 17:01:16.000000000 +0200
@@ -161,6 +161,11 @@
tpport_t controlPort = 0);
bool
+ addDestination(const BroadcastAddress& ia,
+ tpport_t dataPort = DefaultRTPDataPort,
+ tpport_t controlPort = 0);
+
+ bool
addDestination(const InetMcastAddress& ia,
tpport_t dataPort = DefaultRTPDataPort,
tpport_t controlPort = 0);
diff -ru ../ccrtp-1.0.2/src/ccrtp/rtp.h src/ccrtp/rtp.h
--- ../ccrtp-1.0.2/src/ccrtp/rtp.h 2003-06-07 01:18:48.000000000 +0200
+++ src/ccrtp/rtp.h 2003-10-15 16:36:58.000000000 +0200
@@ -283,6 +283,22 @@
}
void
+ build(const BroadcastAddress& ia, tpport_t dataPort,
+ tpport_t controlPort)
+ {
+ if ( 0 == controlPort ) {
+ dataBasePort = even_port(dataPort);
+ controlBasePort = dataBasePort + 1;
+ } else {
+ dataBasePort = dataPort;
+ controlBasePort = controlPort;
+ }
+ dso = new RTPDataChannel(ia,dataBasePort);
+ cso = new RTCPChannel(ia,controlBasePort);
+ dso->setBroadcast(enable);
+ }
+
+ void
build(const InetMcastAddress& ia, tpport_t dataPort,
tpport_t controlPort)
{
diff -ru ../ccrtp-1.0.2/src/outqueue.cpp src/outqueue.cpp
--- ../ccrtp-1.0.2/src/outqueue.cpp 2003-06-07 01:18:47.000000000 +0200
+++ src/outqueue.cpp 2003-10-15 16:59:41.000000000 +0200
@@ -179,6 +179,21 @@
}
bool
+OutgoingDataQueue::addDestination(const BroadcastAddress& ia,
+ tpport_t dataPort,
+ tpport_t controlPort)
+{
+ if ( 0 == controlPort )
+ controlPort = dataPort + 1;
+ bool result = addDestinationToList(ia,dataPort,controlPort);
+ if ( result && isSingleDestination() ) {
+ setDataPeer(ia,dataPort);
+ setControlPeer(ia,controlPort);
+ }
+ return result;
+}
+
+bool
OutgoingDataQueue::addDestination(const InetMcastAddress& ia,
tpport_t dataPort,
tpport_t controlPort)
--------------------------------------------
Thanks,
--J