22 #ifdef CCXX_NAMESPACES
30 Listener(InetMcastAddress& ima, tpport_t port) :
38 cout <<
"My SSRC identifier is: "
39 << hex << (int)getLocalSSRC() << endl;
42 "rtplisten demo app.");
43 setExpireTimeout(1000000);
49 while ( (adu = getData(getFirstTimestamp())) ) {
50 cerr <<
"I got an app. data unit - "
52 <<
" payload octets ("
70 cout <<
"* New synchronization source: " <<
71 hex << (int)src.
getID() << endl;
77 RTPSession::onGotSR(source,SR,blocks);
78 cout <<
"I got an SR RTCP report from "
79 << hex << (int)source.
getID() <<
"@"
88 RTPSession::onGotRR(source,RR,blocks);
89 cout <<
"I got an RR RTCP report from "
90 << hex << (int)source.
getID() <<
"@"
99 bool result = RTPSession::onGotSDESChunk(source,chunk,len);
100 cout <<
"I got a SDES chunk from "
101 << hex << (int)source.
getID() <<
"@"
113 cout <<
"I got a Goodbye packet from "
114 << hex << (int)source.
getID() <<
"@"
118 cout <<
" Goodbye reason: \"" << reason <<
"\"" << endl;
122 int main(
int argc,
char *argv[])
124 cout <<
"rtplisten" << endl;
127 cerr <<
"Syntax: " <<
" ip port" << endl;
131 InetMcastAddress ima;
133 ima = InetMcastAddress(argv[1]);
137 tpport_t port = atoi(argv[2]);
138 if ( ima.isInetAddress() ) {
140 cout <<
"Listening on multicast address " << ima <<
":" <<
143 InetHostAddress ia(argv[1]);
144 foo =
new Listener(ia,atoi(argv[2]));
145 cout <<
"Listening on unicast address " << ia <<
":" <<
148 cout <<
"Press Ctrl-C to finish." << endl;
PayloadType getType() const
ITU-T G.711. mu-law audio 8 Khz (RFC 1890)
tpport_t getDataTransportPort() const
Synchronization source in an RTP session.
Interface (envelope) to data received over RTP packets.
Canonical end-point identifier.
bool onGotSDESChunk(SyncSource &source, SDESChunk &chunk, size_t len)
void onGotRR(SyncSource &source, RecvReport &RR, uint8 blocks)
void onGotSR(SyncSource &source, SendReport &SR, uint8 blocks)
void onNewSyncSource(const SyncSource &src)
void onGotGoodbye(const SyncSource &source, const std::string &reason)
Participant * getParticipant() const
Get the participant this synchronization source is asociated to.
void setSDESItem(SDESItemType item, const std::string &val)
Listener(InetHostAddress &ia, tpport_t port)
const InetAddress & getNetworkAddress() const
tpport_t getControlTransportPort() const
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
Listener(InetMcastAddress &ima, tpport_t port)
const SyncSource & getSource() const
Generic and audio/video profile specific RTP interface of ccRTP.
int main(int argc, char *argv[])
__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.