22 #ifdef CCXX_NAMESPACES
33 Sender(
const unsigned char* data,
const InetHostAddress& ia,
34 tpport_t port, uint32 tstamp, uint16 count) :
35 RTPSession(InetHostAddress(
"0.0.0.0")), packetsPerSecond(10)
37 uint32 timestamp = tstamp? tstamp : 0;
39 cout <<
"My SSRC identifier is: "
40 << hex << (int)getLocalSSRC() << endl;
43 setSchedulingTimeout(10000);
44 setExpireTimeout(1000000);
46 if ( !addDestination(ia,port) ) {
47 cerr <<
"Could not connect" << endl;
54 uint16 tstampInc = getCurrentRTPClockRate()/packetsPerSecond;
55 uint32 period = 1000/packetsPerSecond;
56 TimerPort::setTimer(period);
57 for (
int i = 0; i < count ; i++ ) {
58 putData(timestamp + i*tstampInc,
59 data,strlen((
char *)data) + 1);
60 Thread::sleep(TimerPort::getTimer());
61 TimerPort::incTimer(period);
69 int main(
int argc,
char *argv[])
71 cout <<
"rtpsend..." << endl;
74 cerr <<
"Syntax: " <<
"data host port timestamp count" << endl;
78 Sender sender((
unsigned char *)argv[1], InetHostAddress(argv[2]),
79 atoi(argv[3]), atoi(argv[4]), atoi(argv[5]));
81 cout <<
"I have sent " << argv[5]
82 <<
" RTP packets containing \"" << argv[1]
83 <<
"\", with timestamp " << argv[4]
84 <<
" to " << argv[2] <<
":" << argv[3]
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
int main(int argc, char *argv[])
const uint16 packetsPerSecond
void setSDESItem(SDESItemType item, const std::string &val)
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
Generic and audio/video profile specific RTP interface of ccRTP.
Sender(const unsigned char *data, const InetHostAddress &ia, tpport_t port, uint32 tstamp, uint16 count)
__EXPORT RTPApplication & defaultApplication()
Get the RTPApplication object for the "default" application (the only one used by common applications...
This class sends an RTP Packet.