20 #ifdef CCXX_NAMESPACES
29 {
return destinationAddress; }
32 {
return destinationPort; }
35 {
return packetsNumber; }
41 {
return packetsSize; }
45 static const uint16 destinationPort = 34566;
46 static const uint32 packetsNumber = 100;
47 static const uint32 packetsSize = 100;
48 static unsigned char data[65535];
52 InetHostAddress(
"localhost");
61 virtual int doTest() = 0;
77 tx.setSchedulingTimeout(10000);
78 tx.setExpireTimeout(1000000);
90 uint16 inc = tx.getCurrentRTPClockRate()/50;
91 TimerPort::setTimer(period);
94 Thread::sleep(TimerPort::getTimer());
95 TimerPort::incTimer(period);
113 rx.setSchedulingTimeout(10000);
114 rx.setExpireTimeout(1000000);
119 for (
int i = 0; i < 500 ; i++ ) {
121 while ( (adu = rx.
getData(rx.getFirstTimestamp())) ) {
140 const uint32 NSESSIONS = 10;
143 for ( uint32 i = 0; i < NSESSIONS; i++ ) {
144 tx[i] =
new RTPSession(InetHostAddress(
"localhost"));
146 for ( uint32 i = 0; i < NSESSIONS; i++) {
147 tx[i]->setSchedulingTimeout(10000);
148 tx[i]->setExpireTimeout(1000000);
156 rx.setSchedulingTimeout(5000);
157 rx.setExpireTimeout(10000000);
160 for ( uint32 i = 0; i < NSESSIONS; i++) {
161 tx[i]->startRunning();
164 TimerPort::setTimer(period);
170 for ( uint32 s = 0; s < NSESSIONS; s++) {
173 tx[s]->getCurrentRTPClockRate()/50;
176 Thread::sleep(TimerPort::getTimer());
177 TimerPort::incTimer(period);
181 for ( uint32 i = 0; i < NSESSIONS; i++ ) {
184 RTPSession::SyncSourcesIterator it;
185 cout <<
"Sources of synchronization:" << endl;
186 for (it = rx.begin() ; it != rx.end(); it++) {
190 cout <<
" (sender) ";
201 cout <<
"Participants:" << endl;
202 for ( ai = app.
begin(); ai != app.
end(); ai++ ) {
223 int main(
int argc,
char *argv[])
230 for (
int i = 1; i < argc; ++i) {
231 send |= !strcmp(argv[i],
"-s") or !strcmp(argv[i],
"--send");
234 recv |= !strcmp(argv[i],
"-r") or !strcmp(argv[i],
"--recv");
const size_t getPacketSize(uint32 i)
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
tpport_t getDataTransportPort() const
An RTP application, holding identifying RTCP SDES item values.
Synchronization source in an RTP session.
Interface (envelope) to data received over RTP packets.
Canonical end-point identifier.
ParticipantsIterator begin()
uint32 getPacketsNumber() const
const InetHostAddress & getDestinationAddress() const
A class of objects representing remote participants (RTP applications) in a multimedia session...
ParticipantsIterator end()
void startRunning()
Activate stack and start service thread.
SingleThreadRTPSession RTPSession
Uses two pairs of sockets for RTP data and RTCP transmission/reception.
Participant * getParticipant() const
Get the participant this synchronization source is asociated to.
const tpport_t getDestinationPort() const
void setSDESItem(SDESItemType item, const std::string &val)
const InetAddress & getNetworkAddress() const
Iterator through the list of participants in this session.
tpport_t getControlTransportPort() const
const unsigned char * getPacketData(uint32 i)
bool isSender() const
Whether this source sends RTP data packets.
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
static const InetHostAddress destinationAddress
const uint8 *const getData() const
Get data as it is received in RTP packets (i.e.
Generic and audio/video profile specific RTP interface of ccRTP.
static unsigned char data[65535]
__EXPORT RTPApplication & defaultApplication()
Get the RTPApplication object for the "default" application (the only one used by common applications...
const std::string & getSDESItem(SDESItemType type) const
Get the value of an SDES item.
int main(int argc, char *argv[])