1 // Copyright (C) 1999-2005 Open Source Telecom Corporation.
2 // Copyright (C) 2006-2014 David Sugar, Tycho Softworks.
3 // Copyright (C) 2015 Cherokees of Idaho.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with GNU ccRTP. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free software
19 // library without restriction. Specifically, if other files instantiate
20 // templates or use macros or inline functions from this file, or you compile
21 // this file and link it with other files to produce an executable, this
22 // file does not by itself cause the resulting executable to be covered by
23 // the GNU General Public License. This exception does not however
24 // invalidate any other reasons why the executable file might be covered by
25 // the GNU General Public License.
26 //
27 // This exception applies only to the code released under the name GNU
28 // ccRTP. If you copy code from other releases into a copy of GNU
29 // ccRTP, as the General Public License permits, the exception does
30 // not apply to the code that you add in this way. To avoid misleading
31 // anyone as to the status of such modified files, you must delete
32 // this exception notice from them.
33 //
34 // If you write modifications of your own for GNU ccRTP, it is your choice
35 // whether to permit this exception to apply to your modifications.
36 // If you do not wish that, delete this exception notice.
37 //
38
50 #ifndef CCXX_RTP_RTP_H_
51 #define CCXX_RTP_RTP_H_
52
55
56 NAMESPACE_COMMONCPP
57
88 {
89 public:
100 tpport_t controlPort, uint32 membersSize,
102 ServiceQueue(membersSize,app)
103 { build(ia,dataPort,controlPort); }
104
117 const InetHostAddress& ia,
118 tpport_t dataPort, tpport_t controlPort,
120 ServiceQueue(ssrc,membersSize,app)
121 { build(ia,dataPort,controlPort); }
122
136 tpport_t controlPort, uint32 membersSize,
138 ServiceQueue(membersSize,app)
139 { build(ia,dataPort,controlPort,iface); }
140
156 const InetMcastAddress& ia, tpport_t dataPort,
157 tpport_t controlPort, uint32 membersSize,
159 ServiceQueue(ssrc,membersSize,app)
160 { build(ia,dataPort,controlPort,iface); }
161
163 {
165 }
166
173 inline Socket::Error
175 {
176 Socket::Error error = dso->setMulticast(true);
177 if ( error ) return error;
178 error = dso->setTimeToLive(ttl);
179 if ( error ) return error;
180 error = cso->setMulticast(true);
181 if ( error ) return error;
182 return cso->setTimeToLive(ttl);
183 }
184
185 inline virtual
187 {
188 endSocket();
189 }
190
192 {return dso;}
193
194 protected:
198 inline bool
200 { return dso->isPendingRecv(timeout); }
201
202 InetHostAddress
204 { return dso->getSender(port); }
205
206 inline size_t
208 { return dso->getNextPacketSize(); }
209
219 inline size_t
221 InetHostAddress& na, tpport_t& tp)
222 { na = dso->getSender(tp); return dso->recv(buffer, len); }
223
224 inline void
226 { dso->setPeer(host,port); }
227
228
233 inline size_t
234 sendData(
const unsigned char*
const buffer,
size_t len)
235 { return dso->send(buffer, len); }
236
238 { return dso->getRecvSocket(); }
239
244 inline bool
246 { return cso->isPendingRecv(timeout); }
247
248 InetHostAddress
250 { return cso->getSender(port); }
251
261 inline size_t
263 InetHostAddress& na, tpport_t& tp)
264 { na = cso->getSender(tp); return cso->recv(buffer,len); }
265
266 inline void
268 { cso->setPeer(host,port); }
269
275 inline size_t
277 { return cso->send(buffer,len); }
278
280 { return cso->getRecvSocket(); }
281
288 inline Socket::Error
290 {
291 Socket::Error error = dso->setMulticast(true);
292 if ( error ) return error;
293 error = dso->join(ia,iface);
294 if ( error ) return error;
295 error = cso->setMulticast(true);
296 if ( error ) {
297 dso->drop(ia);
298 return error;
299 }
300 error = cso->join(ia,iface);
301 if ( error ) {
302 dso->drop(ia);
303 return error;
304 }
305 return Socket::errSuccess;
306 }
307
314 inline Socket::Error
316 {
317 Socket::Error error = dso->setMulticast(false);
318 if ( error ) return error;
319 error = dso->leaveGroup(ia);
320 if ( error ) return error;
321 error = cso->setMulticast(false);
322 if ( error ) return error;
323 return cso->leaveGroup(ia);
324 }
325
326 inline void
328 {
329 if (dso) {
330 dso->endSocket();
331 delete dso;
332 }
333 dso = NULL;
334 if (cso) {
335 cso->endSocket();
336 delete cso;
337 }
338 cso = NULL;
339 }
340
341 private:
342 void
343 build(
const InetHostAddress& ia, tpport_t dataPort,
344 tpport_t controlPort)
345 {
346 if ( 0 == controlPort ) {
347 dataBasePort = even_port(dataPort);
348 controlBasePort = dataBasePort + 1;
349 } else {
350 dataBasePort = dataPort;
351 controlBasePort = controlPort;
352 }
353 dso = new RTPDataChannel(ia,dataBasePort);
354 cso = new RTCPChannel(ia,controlBasePort);
355 }
356
357 void
358 build(
const InetMcastAddress& ia, tpport_t dataPort,
359 tpport_t controlPort, uint32 iface)
360 {
361 if ( 0 == controlPort ) {
362 dataBasePort = even_port(dataPort);
363 controlBasePort = dataBasePort + 1;
364 } else {
365 dataBasePort = dataPort;
366 controlBasePort = controlPort;
367 }
368 dso = new RTPDataChannel(InetHostAddress("0.0.0.0"),dataBasePort);
369 cso = new RTCPChannel(InetHostAddress("0.0.0.0"),controlBasePort);
370 joinGroup(ia,iface);
371 }
372
380 inline tpport_t
382 { return (port & 0x01)? (port) : (port - 1); }
383
391 inline tpport_t
393 { return (port & 0x01)? (port - 1) : (port); }
394
397
398 protected:
402 };
403
414 template
419 protected Thread,
421 {
422 public:
425 tpport_t controlPort = 0,
426 int pri = 0,
427 uint32 memberssize =
430 #if defined(_MSC_VER) && _MSC_VER >= 1300
431 );
432 #else
433 ):
434 Thread(pri),
436 (ia,dataPort,controlPort,memberssize,app)
437 { }
438 #endif
439
442 tpport_t controlPort = 0,
443 int pri = 0,
444 uint32 memberssize =
447 #if defined(_MSC_VER) && _MSC_VER >= 1300
448 );
449 #else
450 ):
451 Thread(pri),
453 (ssrc, ia,dataPort,controlPort,memberssize,app)
454 { }
455 #endif
456
459 tpport_t controlPort = 0,
460 int pri = 0,
461 uint32 memberssize =
464 uint32 iface = 0
465 #if defined(_MSC_VER) && _MSC_VER >= 1300
466 );
467 #else
468 ):
469 Thread(pri),
471 (ia,dataPort,controlPort,memberssize,app,iface)
472 { }
473 #endif
474
477 tpport_t controlPort = 0,
478 int pri = 0,
479 uint32 memberssize =
482 uint32 iface = 0
483 #if defined(_MSC_VER) && _MSC_VER >= 1300
484 );
485 #else
486 ):
487 Thread(pri),
489 (ssrc,ia,dataPort,controlPort,memberssize,app,iface)
490 { }
491 #endif
492
493
495 {
496 if (isRunning()) {
497 disableStack(); Thread::join();
498 }
499 }
500
501 #if defined(_MSC_VER) && _MSC_VER >= 1300
502 virtual void startRunning();
503 #else
504
507 void
509 { enableStack(); Thread::start(); }
510 #endif
511
512
513 protected:
516
519
522
525
528
531
534
535 #if defined(_MSC_VER) && _MSC_VER >= 1300
536 virtual void run(void);
537
538 virtual void timerTick(void);
539
541 #else
542
544 {return;}
545
548
554 {
556 while ( ServiceQueue::isActive() ) {
557 if ( timeout < 1000 ){ // !(timeout/1000)
558 timeout = getSchedulingTimeout();
559 }
560 controlReceptionService();
561 controlTransmissionService();
564 // make sure the scheduling timeout is
565 // <= the check interval for RTCP
566 // packets
567 timeout = (timeout > maxWait)? maxWait : timeout;
568 if ( timeout < 1000 ) { // !(timeout/1000)
569 dispatchDataPacket();
570 timerTick();
571 } else {
573 if (ServiceQueue::isActive()) { // take in only if active
574 takeInDataPacket();
575 }
576 }
577 timeout = 0;
578 }
579 }
581 // Thread::exit();
582 }
583
584 #endif
585
588
591 };
592
602
609
620
621 #ifdef CCXX_IPV6
622
644 template <class RTPDataChannel = DualRTPUDPIPv6Channel,
645 class RTCPChannel = DualRTPUDPIPv6Channel,
647 class __EXPORT TRTPSessionBaseIPV6 :
public ServiceQueue
648 {
649 public:
659 TRTPSessionBaseIPV6(const IPV6Host& ia, tpport_t dataPort,
660 tpport_t controlPort, uint32 membersSize,
662 ServiceQueue(membersSize,app)
663 { build(ia,dataPort,controlPort); }
664
676 TRTPSessionBaseIPV6(uint32 ssrc,
677 const IPV6Host& ia,
678 tpport_t dataPort, tpport_t controlPort,
680 ServiceQueue(ssrc,membersSize,app)
681 { build(ia,dataPort,controlPort); }
682
695 TRTPSessionBaseIPV6(const IPV6Multicast& ia, tpport_t dataPort,
696 tpport_t controlPort, uint32 membersSize,
698 ServiceQueue(membersSize,app)
699 { build(ia,dataPort,controlPort,iface); }
700
715 TRTPSessionBaseIPV6(uint32 ssrc,
716 const IPV6Multicast& ia, tpport_t dataPort,
717 tpport_t controlPort, uint32 membersSize,
719 ServiceQueue(ssrc,membersSize,app)
720 { build(ia,dataPort,controlPort,iface); }
721
722 virtual size_t dispatchBYE(const std::string &str)
723 {
725 }
726
727 inline virtual
728 ~TRTPSessionBaseIPV6()
729 {
730 endSocket();
731 }
732
733 inline RTPDataChannel *getDSO(void)
734 {return dso;}
735
736 protected:
740 inline bool
742 { return dso->isPendingRecv(timeout); }
743
744 inline IPV6Host
745 getDataSender(tpport_t *port = NULL) const
746 { return dso->getSender(port); }
747
748 inline size_t
749 getNextDataPacketSize() const
750 { return dso->getNextPacketSize(); }
751
761 inline size_t
762 recvData(unsigned char* buffer, size_t len,
763 IPV6Host& na, tpport_t& tp)
764 { na = dso->getSender(tp); return dso->recv(buffer, len); }
765
766 inline void
767 setDataPeerIPV6(const IPV6Host &host, tpport_t port)
768 { dso->setPeer(host,port); }
769
774 inline size_t
775 sendDataIPV6(const unsigned char* const buffer, size_t len)
776 { return dso->send(buffer, len); }
777
778 inline SOCKET getDataRecvSocket() const
779 { return dso->getRecvSocket(); }
780
785 inline bool
787 { return cso->isPendingRecv(timeout); }
788
789 inline IPV6Host
790 getControlSender(tpport_t *port = NULL) const
791 { return cso->getSender(port); }
792
802 inline size_t
803 recvControl(unsigned char *buffer, size_t len,
804 IPV6Host& na, tpport_t& tp)
805 { na = cso->getSender(tp); return cso->recv(buffer,len); }
806
807 inline void
808 setControlPeerIPV6(const IPV6Host &host, tpport_t port)
809 { cso->setPeer(host,port); }
810
816 inline size_t
817 sendControl(const unsigned char* const buffer, size_t len)
818 { return cso->send(buffer,len); }
819
820 inline SOCKET getControlRecvSocket() const
821 { return cso->getRecvSocket(); }
822
823 inline void
824 endSocket()
825 {
826 dso->endSocket();
827 cso->endSocket();
828 if (dso) delete dso;
829 dso = NULL;
830 if (cso) delete cso;
831 cso = NULL;
832 }
833
834 private:
835 void
836 build(const IPV6Host& ia, tpport_t dataPort,
837 tpport_t controlPort)
838 {
839 if ( 0 == controlPort ) {
840 dataBasePort = even_port(dataPort);
841 controlBasePort = dataBasePort + 1;
842 } else {
843 dataBasePort = dataPort;
844 controlBasePort = controlPort;
845 }
846 dso = new RTPDataChannel(ia,dataBasePort);
847 cso = new RTCPChannel(ia,controlBasePort);
848 }
849
850 void
851 build(const IPV6Multicast& ia, tpport_t dataPort,
852 tpport_t controlPort, uint32 iface)
853 {
854 if ( 0 == controlPort ) {
855 dataBasePort = even_port(dataPort);
856 controlBasePort = dataBasePort + 1;
857 } else {
858 dataBasePort = dataPort;
859 controlBasePort = controlPort;
860 }
861 dso = new RTPDataChannel(IPV6Host("0.0.0.0"),dataBasePort);
862 cso = new RTCPChannel(IPV6Host("0.0.0.0"),controlBasePort);
863 joinGroup(ia,iface);
864 }
865
872 inline Socket::Error
873 joinGroup(const IPV6Multicast& ia, uint32 iface)
874 {
875 Socket::Error error = dso->setMulticast(true);
876 if ( error ) return error;
877 error = dso->join(ia,iface);
878 if ( error ) return error;
879 error = cso->setMulticast(true);
880 if ( error ) {
881 dso->drop(ia);
882 return error;
883 }
884 error = cso->join(ia,iface);
885 if ( error ) {
886 dso->drop(ia);
887 return error;
888 }
889 return Socket::errSuccess;
890 }
891
898 inline Socket::Error
899 leaveGroup(const IPV6Multicast& ia)
900 {
901 Socket::Error error = dso->setMulticast(false);
902 if ( error ) return error;
903 error = dso->leaveGroup(ia);
904 if ( error ) return error;
905 error = cso->setMulticast(false);
906 if ( error ) return error;
907 return cso->leaveGroup(ia);
908 }
909
916 inline Socket::Error
917 setMcastTTL(uint8 ttl)
918 {
919 Socket::Error error = dso->setMulticast(true);
920 if ( error ) return error;
921 error = dso->setTimeToLive(ttl);
922 if ( error ) return error;
923 error = cso->setMulticast(true);
924 if ( error ) return error;
925 return cso->setTimeToLive(ttl);
926 }
927
935 inline tpport_t
936 odd_port(tpport_t port)
937 { return (port & 0x01)? (port) : (port - 1); }
938
946 inline tpport_t
947 even_port(tpport_t port)
948 { return (port & 0x01)? (port - 1) : (port); }
949
950 tpport_t dataBasePort;
951 tpport_t controlBasePort;
952
953 protected:
954 RTPDataChannel* dso;
955 RTCPChannel* cso;
957 };
958
969 template
970 <class RTPDataChannel = DualRTPUDPIPv6Channel,
971 class RTCPChannel = DualRTPUDPIPv6Channel,
973 class __EXPORT SingleThreadRTPSessionIPV6 :
974 protected Thread,
975 public TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>
976 {
977 public:
978 SingleThreadRTPSessionIPV6(const IPV6Host& ia,
980 tpport_t controlPort = 0,
981 int pri = 0,
982 uint32 memberssize =
985 #if defined(_MSC_VER) && _MSC_VER >= 1300
986 );
987 #else
988 ):
989 Thread(pri),
990 TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>
991 (ia,dataPort,controlPort,memberssize,app)
992 { }
993 #endif
994
995 SingleThreadRTPSessionIPV6(const IPV6Multicast& ia,
997 tpport_t controlPort = 0,
998 int pri = 0,
999 uint32 memberssize =
1002 uint32 iface = 0
1003 #if defined(_MSC_VER) && _MSC_VER >= 1300
1004 );
1005 #else
1006 ):
1007 Thread(pri),
1008 TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>
1009 (ia,dataPort,controlPort,memberssize,app,iface)
1010 { }
1011 #endif
1012
1013 ~SingleThreadRTPSessionIPV6()
1014 {
1015 if (isRunning()) {
1016 disableStack(); Thread::join();
1017 }
1018 }
1019
1020 #if defined(_MSC_VER) && _MSC_VER >= 1300
1021 virtual void startRunning();
1022 #else
1023
1026 void
1027 startRunning()
1028 { enableStack(); Thread::start(); }
1029 #endif
1030
1031
1032 protected:
1033 inline void enableStack(void)
1034 {TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::enableStack();}
1035
1036 inline void disableStack(void)
1037 {TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::disableStack();}
1038
1040 {return TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::getSchedulingTimeout();}
1041
1042 inline void controlReceptionService(void)
1043 {TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::controlReceptionService();}
1044
1045 inline void controlTransmissionService(void)
1046 {TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::controlTransmissionService();}
1047
1048 inline timeval getRTCPCheckInterval(void)
1049 {return TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::getRTCPCheckInterval();}
1050
1051 inline size_t dispatchDataPacket(void)
1052 {return TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::dispatchDataPacket();}
1053
1054 #if defined(_MSC_VER) && _MSC_VER >= 1300
1055 virtual void run(void);
1056
1057 virtual void timerTick(void);
1058
1060 #else
1061
1062 virtual void timerTick(void)
1063 {return;}
1064
1066 {return TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::isPendingData(timeout);}
1067
1072 virtual void run(void)
1073 {
1075 while ( ServiceQueue::isActive() ) {
1076 if ( timeout < 1000 ){ // !(timeout/1000)
1077 timeout = getSchedulingTimeout();
1078 }
1079 controlReceptionService();
1080 controlTransmissionService();
1083 // make sure the scheduling timeout is
1084 // <= the check interval for RTCP
1085 // packets
1086 timeout = (timeout > maxWait)? maxWait : timeout;
1087 if ( timeout < 1000 ) { // !(timeout/1000)
1088 dispatchDataPacket();
1089 timerTick();
1090 } else {
1091 if ( isPendingData(timeout/1000) ) {
1092 takeInDataPacket();
1093 }
1094 timeout = 0;
1095 }
1096 }
1097 dispatchBYE("GNU ccRTP stack finishing.");
1098 Thread::exit();
1099 }
1100
1101 #endif
1102
1103 inline size_t takeInDataPacket(void)
1104 {return TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::takeInDataPacket();}
1105
1106 inline size_t dispatchBYE(const std::string &str)
1107 {return TRTPSessionBaseIPV6<RTPDataChannel,RTCPChannel,ServiceQueue>::dispatchBYE(str);}
1108 };
1109
1118 typedef SingleThreadRTPSessionIPV6<> RTPSessionIPV6;
1119
1125 typedef RTPSessionIPV6 RTPSocketIPV6;
1126
1135 typedef SingleThreadRTPSessionIPV6<SymmetricRTPChannelIPV6,
1136 SymmetricRTPChannelIPV6> SymmetricRTPSessionIPV6;
1137
1138
1139 #endif
1140 // sessions
1142
1143 END_NAMESPACE
1144
1145 #endif //CCXX_RTP_RTP_H_
1146
void setControlPeer(const InetAddress &host, tpport_t port)
An RTP application, holding identifying RTCP SDES item values.
void build(const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort)
~SingleThreadRTPSession()
RTPSession RTPSocket
Alias for RTPSession.
SingleThreadRTPSession(const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication(), uint32 iface=0)
InetHostAddress getControlSender(tpport_t *port=NULL) const
DualRTPChannel< RTPBaseUDPIPv4Socket > DualRTPUDPIPv4Channel
virtual void timerTick(void)
uint32 microtimeout_t
Time interval expressed in microseconds.
void controlReceptionService(void)
TRTPSessionBase(uint32 ssrc, const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app, uint32 iface)
Builds a session waiting for packets in a multicast address, with the specified ssrc identifier for t...
Socket::Error setMcastTTL(uint8 ttl)
Set the value of the TTL field in the sent packets.
microtimeout_t timeval2microtimeout(const timeval &t)
Convert a time interval, expressed as a timeval value into a microseconds counter.
size_t dispatchBYE(const std::string &str)
size_t sendData(const unsigned char *const buffer, size_t len)
void setDataPeer(const InetAddress &host, tpport_t port)
tpport_t even_port(tpport_t port)
Ensure a port number is even.
SingleRTPChannel SymmetricRTPChannel
Actually, RTP with a single channel can be called 'Symmetric RTP'.
void build(const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 iface)
SOCKET getDataRecvSocket() const
size_t dispatchDataPacket(void)
InetHostAddress getDataSender(tpport_t *port=NULL) const
virtual bool isPendingData(microtimeout_t timeout)
bool isPendingControl(microtimeout_t timeout)
Socket::Error joinGroup(const InetMcastAddress &ia, uint32 iface)
Join a multicast group.
Definition of socket classes for different underlying transport and/or network protocols that can be ...
SOCKET getControlRecvSocket() const
tpport_t odd_port(tpport_t port)
Ensure a port number is odd.
size_t takeInDataPacket(void)
SingleThreadRTPSession(const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication())
virtual size_t dispatchBYE(const std::string &str)
size_t recvControl(unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp)
Receive data from the control channel/socket.
void startRunning()
Activate stack and start service thread.
SingleThreadRTPSession RTPSession
Uses two pairs of sockets for RTP data and RTCP transmission/reception.
bool isPendingData(microtimeout_t timeout)
static const size_t defaultMembersHashSize
virtual void run(void)
Single runnable method for this RTP stacks, schedules outgoing and incoming RTP data and RTCP packets...
size_t recvData(unsigned char *buffer, size_t len, InetHostAddress &na, tpport_t &tp)
Receive data from the data channel/socket.
Generic RTCP control queues.
TRTPSessionBase(uint32 ssrc, const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app)
Builds a session with the specified ssrc identifier for the local source.
TRTPSessionBase(const InetMcastAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app, uint32 iface)
Builds a session waiting for packets in a multicast address.
const tpport_t DefaultRTPDataPort
registered default RTP data transport port
SingleThreadRTPSession(uint32 ssrc, const InetHostAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication())
Socket::Error leaveGroup(const InetMcastAddress &ia)
Leave a multicast group.
size_t sendControl(const unsigned char *const buffer, size_t len)
This template class adds the threading aspect to the RTPSessionBase template in one of the many possi...
timeval getRTCPCheckInterval(void)
size_t getNextDataPacketSize() const
SingleThreadRTPSession< SymmetricRTPChannel, SymmetricRTPChannel > SymmetricRTPSession
Uses one pair of sockets, (1) for RTP data and (2) for RTCP transmission/reception.
SingleThreadRTPSession(uint32 ssrc, const InetMcastAddress &ia, tpport_t dataPort=DefaultRTPDataPort, tpport_t controlPort=0, int pri=0, uint32 memberssize=MembershipBookkeeping::defaultMembersHashSize, RTPApplication &app=defaultApplication(), uint32 iface=0)
virtual ~TRTPSessionBase()
TRTPSessionBase(const InetHostAddress &ia, tpport_t dataPort, tpport_t controlPort, uint32 membersSize, RTPApplication &app)
Builds a session waiting for packets in a host address.
__EXPORT RTPApplication & defaultApplication()
Get the RTPApplication object for the "default" application (the only one used by common applications...
microtimeout_t getSchedulingTimeout(void)
RTPDataChannel * getDSO(void)
size_t dispatchBYE(const std::string &reason)
This method is used to send an RTCP BYE packet.
void controlTransmissionService(void)
This class, an RTP/RTCP queue, adds audio/video profile (AVP) specific methods to the generic RTCP se...