37 using namespace COMMONCPP_NAMESPACE;
57 audiooutput=open(
"/dev/audio",O_WRONLY);
59 if( audiooutput > 0 ) {
60 cout <<
"Audio device is ready to play." << endl;
62 cout <<
"I could not open /dev/audio " << endl;
84 InetHostAddress local_ip;
85 local_ip =
"127.0.0.1";
90 cerr <<
": IP address is not correct!" << endl;
94 cout << local_ip.getHostname() <<
95 " is going to listen to perself through " <<
96 local_ip <<
"..." << endl;
104 socket->setSchedulingTimeout(10000);
106 cerr <<
"The receiver could not connect.";
110 socket->startRunning();
111 cout <<
"The RTP queue is ";
112 if( socket->isActive() )
113 cout <<
"active." << endl;
115 cerr <<
"not active." << endl;
117 cout <<
"Waiting for audio packets..." << endl;
120 timerport.setTimer(
PERIOD);
124 for(
int i=0 ; true ; i++ ) {
127 adu = socket->
getData(socket->getFirstTimestamp());
131 }
while ( (NULL == adu) || (adu->
getSize() <= 0) );
147 cout <<
"." << flush;
150 Thread::sleep(timerport.getTimer());
151 timerport.incTimer(
PERIOD);
158 int main(
int argc,
char *argv[])
160 cout <<
"This is audiorx, a simple test program for ccRTP." << endl;
161 cout <<
"I am waiting for audio packets on port " <<
RECEIVER_BASE
163 cout <<
"Do you want to hear something? Run audiotx." << endl;
164 cout <<
"Strike [Enter] when you are fed up. Enjoy!." << endl;
174 cout << endl <<
"That's all." << endl;
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
Interface (envelope) to data received over RTP packets.
This is the class that will do almost everything.
const int RECEIVER_BASE
file audio.h Common header for audiorx and audiotx.
int main(int argc, char *argv[])
const int TRANSMITTER_BASE
SingleThreadRTPSession RTPSession
Uses two pairs of sockets for RTP data and RTCP transmission/reception.
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
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.