JRTPLIB  3.11.2 (development version)
rtpsession.h
Go to the documentation of this file.
1 /*
2 
3  This file is a part of JRTPLIB
4  Copyright (c) 1999-2017 Jori Liesenborgs
5 
6  Contact: jori.liesenborgs@gmail.com
7 
8  This library was developed at the Expertise Centre for Digital Media
9  (http://www.edm.uhasselt.be), a research center of the Hasselt University
10  (http://www.uhasselt.be). The library is based upon work done for
11  my thesis at the School for Knowledge Technology (Belgium/The Netherlands).
12 
13  Permission is hereby granted, free of charge, to any person obtaining a
14  copy of this software and associated documentation files (the "Software"),
15  to deal in the Software without restriction, including without limitation
16  the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  and/or sell copies of the Software, and to permit persons to whom the
18  Software is furnished to do so, subject to the following conditions:
19 
20  The above copyright notice and this permission notice shall be included
21  in all copies or substantial portions of the Software.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29  IN THE SOFTWARE.
30 
31 */
32 
37 #ifndef RTPSESSION_H
38 
39 #define RTPSESSION_H
40 
41 #include "rtpconfig.h"
42 #include "rtplibraryversion.h"
43 #include "rtppacketbuilder.h"
44 #include "rtpsessionsources.h"
45 #include "rtptransmitter.h"
46 #include "rtpcollisionlist.h"
47 #include "rtcpscheduler.h"
48 #include "rtcppacketbuilder.h"
49 #include "rtptimeutilities.h"
51 #include "rtpmemoryobject.h"
52 #include <list>
53 
54 #ifdef RTP_SUPPORT_THREAD
55  #include <jthread/jmutex.h>
56 #endif // RTP_SUPPORT_THREAD
57 
58 namespace jrtplib
59 {
60 
61 class RTPTransmitter;
62 class RTPSessionParams;
63 class RTPTransmissionParams;
64 class RTPAddress;
65 class RTPSourceData;
66 class RTPPacket;
67 class RTPPollThread;
68 class RTPTransmissionInfo;
69 class RTCPCompoundPacket;
70 class RTCPPacket;
71 class RTCPAPPPacket;
72 
80 class JRTPLIB_IMPORTEXPORT RTPSession : public RTPMemoryObject
81 {
82  JRTPLIB_NO_COPY(RTPSession)
83 public:
93  RTPSession(RTPRandom *rnd = 0, RTPMemoryManager *mgr = 0);
94  virtual ~RTPSession();
95 
103 
111  int Create(const RTPSessionParams &sessparams,RTPTransmitter *transmitter);
112 
114  void Destroy();
115 
121  void BYEDestroy(const RTPTime &maxwaittime,const void *reason,size_t reasonlength);
122 
124  bool IsActive();
125 
127  uint32_t GetLocalSSRC();
128 
130  int AddDestination(const RTPAddress &addr);
131 
133  int DeleteDestination(const RTPAddress &addr);
134 
137 
140 
142  int JoinMulticastGroup(const RTPAddress &addr);
143 
145  int LeaveMulticastGroup(const RTPAddress &addr);
146 
149 
155  int SendPacket(const void *data,size_t len);
156 
161  int SendPacket(const void *data,size_t len,
162  uint8_t pt,bool mark,uint32_t timestampinc);
163 
170  int SendPacketEx(const void *data,size_t len,
171  uint16_t hdrextID,const void *hdrextdata,size_t numhdrextwords);
172 
179  int SendPacketEx(const void *data,size_t len,
180  uint8_t pt,bool mark,uint32_t timestampinc,
181  uint16_t hdrextID,const void *hdrextdata,size_t numhdrextwords);
182 #ifdef RTP_SUPPORT_SENDAPP
190  int SendRTCPAPPPacket(uint8_t subtype, const uint8_t name[4], const void *appdata, size_t appdatalen);
191 #endif // RTP_SUPPORT_SENDAPP
192 
193 #ifdef RTP_SUPPORT_RTCPUNKNOWN
199  int SendUnknownPacket(bool sr, uint8_t payload_type, uint8_t subtype, const void *data, size_t len);
200 #endif // RTP_SUPPORT_RTCPUNKNOWN
201 
205  int SendRawData(const void *data, size_t len, bool usertpchannel);
206 
208  int SetDefaultPayloadType(uint8_t pt);
209 
211  int SetDefaultMark(bool m);
212 
214  int SetDefaultTimestampIncrement(uint32_t timestampinc);
215 
222  int IncrementTimestamp(uint32_t inc);
223 
232 
239  int SetPreTransmissionDelay(const RTPTime &delay);
240 
249 
252 
256  int Poll();
257 
263  int WaitForIncomingData(const RTPTime &delay,bool *dataavailable = 0);
264 
268  int AbortWait();
269 
274 
282 
288 
294 
300 
308 
316 
324 
327 
331  RTPSourceData *GetSourceInfo(uint32_t ssrc);
332 
340 
342  uint16_t GetNextSequenceNumber() const;
343 
346 
349 
355 
357  int AddToIgnoreList(const RTPAddress &addr);
358 
361 
364 
366  int AddToAcceptList(const RTPAddress &addr);
367 
370 
373 
375  int SetMaximumPacketSize(size_t s);
376 
378  int SetSessionBandwidth(double bw);
379 
386  int SetTimestampUnit(double u);
387 
394  void SetNameInterval(int count);
395 
402  void SetEMailInterval(int count);
403 
410  void SetLocationInterval(int count);
411 
418  void SetPhoneInterval(int count);
419 
426  void SetToolInterval(int count);
427 
434  void SetNoteInterval(int count);
435 
437  int SetLocalName(const void *s,size_t len);
438 
440  int SetLocalEMail(const void *s,size_t len);
441 
443  int SetLocalLocation(const void *s,size_t len);
444 
446  int SetLocalPhone(const void *s,size_t len);
447 
449  int SetLocalTool(const void *s,size_t len);
450 
452  int SetLocalNote(const void *s,size_t len);
453 
454 #ifdef RTPDEBUG
455  void DumpSources();
456  void DumpTransmitter();
457 #endif // RTPDEBUG
458 protected:
466  virtual RTPTransmitter *NewUserDefinedTransmitter();
467 
474  virtual void OnRTPPacket(RTPPacket *pack,const RTPTime &receivetime, const RTPAddress *senderaddress);
475 
477  virtual void OnRTCPCompoundPacket(RTCPCompoundPacket *pack,const RTPTime &receivetime,
478  const RTPAddress *senderaddress);
479 
485  virtual void OnSSRCCollision(RTPSourceData *srcdat,const RTPAddress *senderaddress,bool isrtp);
486 
488  virtual void OnCNAMECollision(RTPSourceData *srcdat,const RTPAddress *senderaddress,
489  const uint8_t *cname,size_t cnamelength);
490 
492  virtual void OnNewSource(RTPSourceData *srcdat);
493 
495  virtual void OnRemoveSource(RTPSourceData *srcdat);
496 
498  virtual void OnTimeout(RTPSourceData *srcdat);
499 
501  virtual void OnBYETimeout(RTPSourceData *srcdat);
502 
506  virtual void OnAPPPacket(RTCPAPPPacket *apppacket,const RTPTime &receivetime,
507  const RTPAddress *senderaddress);
508 
510  virtual void OnUnknownPacketType(RTCPPacket *rtcppack,const RTPTime &receivetime,
511  const RTPAddress *senderaddress);
512 
514  virtual void OnUnknownPacketFormat(RTCPPacket *rtcppack,const RTPTime &receivetime,
515  const RTPAddress *senderaddress);
516 
518  virtual void OnNoteTimeout(RTPSourceData *srcdat);
519 
521  virtual void OnRTCPSenderReport(RTPSourceData *srcdat);
522 
524  virtual void OnRTCPReceiverReport(RTPSourceData *srcdat);
525 
527  virtual void OnRTCPSDESItem(RTPSourceData *srcdat, RTCPSDESPacket::ItemType t,
528  const void *itemdata, size_t itemlength);
529 #ifdef RTP_SUPPORT_SDESPRIV
531  virtual void OnRTCPSDESPrivateItem(RTPSourceData *srcdat, const void *prefixdata, size_t prefixlen,
532  const void *valuedata, size_t valuelen);
533 #endif // RTP_SUPPORT_SDESPRIV
534 
536  virtual void OnBYEPacket(RTPSourceData *srcdat);
537 
539  virtual void OnSendRTCPCompoundPacket(RTCPCompoundPacket *pack);
540 #ifdef RTP_SUPPORT_THREAD
542  virtual void OnPollThreadError(int errcode);
543 
548  virtual void OnPollThreadStep();
549 
555  virtual void OnPollThreadStart(bool &stop);
556 
560  virtual void OnPollThreadStop();
561 #endif // RTP_SUPPORT_THREAD
562 
565  void SetChangeOutgoingData(bool change) { m_changeOutgoingData = change; }
566 
569  void SetChangeIncomingData(bool change) { m_changeIncomingData = change; }
570 
580  virtual int OnChangeRTPOrRTCPData(const void *origdata, size_t origlen, bool isrtp, void **senddata, size_t *sendlen);
581 
585  virtual void OnSentRTPOrRTCPData(void *senddata, size_t sendlen, bool isrtp);
586 
593  virtual bool OnChangeIncomingData(RTPRawPacket *rawpack);
594 
605  virtual void OnValidatedRTPPacket(RTPSourceData *srcdat, RTPPacket *rtppack, bool isonprobation, bool *ispackethandled);
606 private:
607  int InternalCreate(const RTPSessionParams &sessparams);
608  int CreateCNAME(uint8_t *buffer,size_t *bufferlength,bool resolve);
609  int ProcessPolledData();
610  int ProcessRTCPCompoundPacket(RTCPCompoundPacket &rtcpcomppack,RTPRawPacket *pack);
611  RTPRandom *GetRandomNumberGenerator(RTPRandom *r);
612  int SendRTPData(const void *data, size_t len);
613  int SendRTCPData(const void *data, size_t len);
614 
615  RTPRandom *rtprnd;
616  bool deletertprnd;
617 
618  RTPTransmitter *rtptrans;
619  bool created;
620  bool deletetransmitter;
621  bool usingpollthread, needthreadsafety;
622  bool acceptownpackets;
623  bool useSR_BYEifpossible;
624  size_t maxpacksize;
625  double sessionbandwidth;
626  double controlfragment;
627  double sendermultiplier;
628  double byemultiplier;
629  double membermultiplier;
630  double collisionmultiplier;
631  double notemultiplier;
632  bool sentpackets;
633 
634  bool m_changeIncomingData, m_changeOutgoingData;
635 
636  RTPSessionSources sources;
637  RTPPacketBuilder packetbuilder;
638  RTCPScheduler rtcpsched;
639  RTCPPacketBuilder rtcpbuilder;
640  RTPCollisionList collisionlist;
641 
642  std::list<RTCPCompoundPacket *> byepackets;
643 
644 #ifdef RTP_SUPPORT_THREAD
645  RTPPollThread *pollthread;
646  jthread::JMutex sourcesmutex,buildermutex,schedmutex,packsentmutex;
647 
648  friend class RTPPollThread;
649 #endif // RTP_SUPPORT_THREAD
650  friend class RTPSessionSources;
651  friend class RTCPSessionPacketBuilder;
652 };
653 
655 inline void RTPSession::OnRTPPacket(RTPPacket *, const RTPTime &, const RTPAddress *) { }
657 inline void RTPSession::OnSSRCCollision(RTPSourceData *, const RTPAddress *, bool ) { }
658 inline void RTPSession::OnCNAMECollision(RTPSourceData *, const RTPAddress *, const uint8_t *, size_t ) { }
663 inline void RTPSession::OnAPPPacket(RTCPAPPPacket *, const RTPTime &, const RTPAddress *) { }
664 inline void RTPSession::OnUnknownPacketType(RTCPPacket *, const RTPTime &, const RTPAddress *) { }
669 inline void RTPSession::OnRTCPSDESItem(RTPSourceData *, RTCPSDESPacket::ItemType, const void *, size_t) { }
670 
671 #ifdef RTP_SUPPORT_SDESPRIV
672 inline void RTPSession::OnRTCPSDESPrivateItem(RTPSourceData *, const void *, size_t, const void *, size_t) { }
673 #endif // RTP_SUPPORT_SDESPRIV
674 
677 
678 #ifdef RTP_SUPPORT_THREAD
679 inline void RTPSession::OnPollThreadError(int) { }
681 inline void RTPSession::OnPollThreadStart(bool &) { }
683 #endif // RTP_SUPPORT_THREAD
684 
685 inline int RTPSession::OnChangeRTPOrRTCPData(const void *, size_t, bool, void **, size_t *) {
686  return ERR_RTP_RTPSESSION_CHANGEREQUESTEDBUTNOTIMPLEMENTED;
687 }
688 inline void RTPSession::OnSentRTPOrRTCPData(void *, size_t, bool) { }
689 inline bool RTPSession::OnChangeIncomingData(RTPRawPacket *) { return true; }
690 inline void RTPSession::OnValidatedRTPPacket(RTPSourceData *, RTPPacket *, bool, bool *) { }
691 
692 } // end namespace
693 
694 #endif // RTPSESSION_H
695 
Describes an RTCP APP packet.
Definition: rtcpapppacket.h:55
Represents an RTCP compound packet.
Definition: rtcpcompoundpacket.h:54
This class can be used to build RTCP compound packets, on a higher level than the RTCPCompoundPacketB...
Definition: rtcppacketbuilder.h:64
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:51
ItemType
Identifies the type of an SDES item.
Definition: rtcpsdespacket.h:60
This class determines when RTCP compound packets should be sent.
Definition: rtcpscheduler.h:102
This class is an abstract class which is used to specify destinations, multicast groups etc.
Definition: rtpaddress.h:51
This class represents a list of addresses from which SSRC collisions were detected.
Definition: rtpcollisionlist.h:54
A memory manager.
Definition: rtpmemorymanager.h:151
This class can be used to build RTP packets and is a bit more high-level than the RTPPacket class: it...
Definition: rtppacketbuilder.h:58
Represents an RTP Packet.
Definition: rtppacket.h:57
Interface for generating random numbers.
Definition: rtprandom.h:52
This class is used by the transmission component to store the incoming RTP and RTCP data in.
Definition: rtprawpacket.h:53
Describes the parameters for to be used by an RTPSession instance.
Definition: rtpsessionparams.h:55
High level class for using RTP.
Definition: rtpsession.h:81
int DeleteDestination(const RTPAddress &addr)
Deletes addr from the list of destinations.
void DeleteTransmissionInfo(RTPTransmissionInfo *inf)
Frees the memory used by the transmission information inf.
virtual void OnSendRTCPCompoundPacket(RTCPCompoundPacket *pack)
Is called when an RTCP compound packet has just been sent (useful to inspect outgoing RTCP data).
Definition: rtpsession.h:676
virtual void OnPollThreadError(int errcode)
Is called when error errcode was detected in the poll thread.
Definition: rtpsession.h:679
int SetPreTransmissionDelay(const RTPTime &delay)
This function allows you to inform the library about the delay between sampling the first sample of a...
virtual void OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an incoming RTP packet is about to be processed.
Definition: rtpsession.h:655
bool GotoNextSourceWithData()
Sets the current source to be the next source in the table which has RTPPacket instances that we have...
void SetEMailInterval(int count)
Sets the RTCP interval for the SDES e-mail item.
bool IsActive()
Returns whether the session has been created or not.
virtual int OnChangeRTPOrRTCPData(const void *origdata, size_t origlen, bool isrtp, void **senddata, size_t *sendlen)
If RTPSession::SetChangeOutgoingData was sent to true, overriding this you can change the data packet...
Definition: rtpsession.h:685
bool GotoPreviousSource()
Sets the current source to be the previous source in the table.
int SetLocalTool(const void *s, size_t len)
Sets the SDES tool item for the local participant to the value s with length len.
virtual void OnRTCPSDESItem(RTPSourceData *srcdat, RTCPSDESPacket::ItemType t, const void *itemdata, size_t itemlength)
Is called when a specific SDES item was received for this source.
Definition: rtpsession.h:669
int AddToIgnoreList(const RTPAddress &addr)
Adds addr to the list of addresses to ignore.
virtual RTPTransmitter * NewUserDefinedTransmitter()
Allocate a user defined transmitter.
Definition: rtpsession.h:654
int LeaveMulticastGroup(const RTPAddress &addr)
Leaves the multicast group specified by addr.
int SetLocalName(const void *s, size_t len)
Sets the SDES name item for the local participant to the value s with length len.
int AbortWait()
If the previous function has been called, this one aborts the waiting (only works when you're not usi...
void ClearDestinations()
Clears the list of destinations.
int AddDestination(const RTPAddress &addr)
Adds addr to the list of destinations.
virtual void OnPollThreadStart(bool &stop)
Is called when the poll thread is started.
Definition: rtpsession.h:681
int IncrementTimestampDefault()
This function increments the timestamp with the amount given set by the SetDefaultTimestampIncrement ...
int SetLocalLocation(const void *s, size_t len)
Sets the SDES location item for the local participant to the value s with length len.
virtual void OnAPPPacket(RTCPAPPPacket *apppacket, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an RTCP APP packet apppacket has been received at time receivetime from address sender...
Definition: rtpsession.h:663
int SetDefaultPayloadType(uint8_t pt)
Sets the default payload type for RTP packets to pt.
int SetMaximumPacketSize(size_t s)
Sets the maximum allowed packet size to s.
int JoinMulticastGroup(const RTPAddress &addr)
Joins the multicast group specified by addr.
void SetChangeIncomingData(bool change)
If this is set to true, incoming data will be passed through RTPSession::OnChangeIncomingData,...
Definition: rtpsession.h:569
void SetChangeOutgoingData(bool change)
If this is set to true, outgoing data will be passed through RTPSession::OnChangeRTPOrRTCPData and RT...
Definition: rtpsession.h:565
int WaitForIncomingData(const RTPTime &delay, bool *dataavailable=0)
Waits at most a time delay until incoming data has been detected.
virtual void OnCNAMECollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, const uint8_t *cname, size_t cnamelength)
Is called when another CNAME was received than the one already present for source srcdat.
Definition: rtpsession.h:658
RTPSession(RTPRandom *rnd=0, RTPMemoryManager *mgr=0)
Constructs an RTPSession instance, optionally using a specific instance of a random number generator,...
int SendRTCPAPPPacket(uint8_t subtype, const uint8_t name[4], const void *appdata, size_t appdatalen)
If sending of RTCP APP packets was enabled at compile time, this function creates a compound packet c...
virtual void OnPollThreadStep()
Is called each time the poll thread loops.
Definition: rtpsession.h:680
int Create(const RTPSessionParams &sessparams, RTPTransmitter *transmitter)
Creates an RTP session using transmitter as transmission component.
int Create(const RTPSessionParams &sessparams, const RTPTransmissionParams *transparams=0, RTPTransmitter::TransmissionProtocol proto=RTPTransmitter::IPv4UDPProto)
Creates an RTP session.
void SetPhoneInterval(int count)
Sets the RTCP interval for the SDES phone item.
virtual void OnRemoveSource(RTPSourceData *srcdat)
Is called when the entry srcdat is about to be deleted from the source table.
Definition: rtpsession.h:660
int BeginDataAccess()
The following member functions (till EndDataAccess}) need to be accessed between a call to BeginDataA...
virtual void OnUnknownPacketFormat(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an unknown packet format for a known packet type was detected.
Definition: rtpsession.h:665
void SetNoteInterval(int count)
Sets the RTCP interval for the SDES note item.
int SetDefaultMark(bool m)
Sets the default marker for RTP packets to m.
void LeaveAllMulticastGroups()
Leaves all multicast groups.
virtual bool OnChangeIncomingData(RTPRawPacket *rawpack)
By overriding this function, the raw incoming data can be inspected and modified (e....
Definition: rtpsession.h:689
RTPSourceData * GetSourceInfo(uint32_t ssrc)
Returns the RTPSourceData instance for the participant identified by ssrc, or NULL if no such entry e...
bool GotoPreviousSourceWithData()
Sets the current source to be the previous source in the table which has RTPPacket instances that we ...
virtual void OnSSRCCollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp)
Is called when an SSRC collision was detected.
Definition: rtpsession.h:657
void ClearAcceptList()
Clears the list of addresses to accept.
int SetLocalPhone(const void *s, size_t len)
Sets the SDES phone item for the local participant to the value s with length len.
virtual void OnRTCPSDESPrivateItem(RTPSourceData *srcdat, const void *prefixdata, size_t prefixlen, const void *valuedata, size_t valuelen)
Is called when a specific SDES item of 'private' type was received for this source.
Definition: rtpsession.h:672
int SendUnknownPacket(bool sr, uint8_t payload_type, uint8_t subtype, const void *data, size_t len)
Tries to send an Unknown packet immediately.
virtual void OnBYETimeout(RTPSourceData *srcdat)
Is called when participant srcdat is timed after having sent a BYE packet.
Definition: rtpsession.h:662
int SendPacketEx(const void *data, size_t len, uint8_t pt, bool mark, uint32_t timestampinc, uint16_t hdrextID, const void *hdrextdata, size_t numhdrextwords)
Sends the RTP packet with payload data which has length len.
virtual void OnRTCPReceiverReport(RTPSourceData *srcdat)
Is called when an RTCP receiver report has been processed for this source.
Definition: rtpsession.h:668
void DeletePacket(RTPPacket *p)
Frees the memory used by p.
virtual void OnNewSource(RTPSourceData *srcdat)
Is called when a new entry srcdat is added to the source table.
Definition: rtpsession.h:659
bool GotoFirstSourceWithData()
Sets the current source to be the first source in the table which has RTPPacket instances that we hav...
int SetReceiveMode(RTPTransmitter::ReceiveMode m)
Sets the receive mode to m.
virtual void OnRTCPCompoundPacket(RTCPCompoundPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an incoming RTCP packet is about to be processed.
Definition: rtpsession.h:656
RTPPacket * GetNextPacket()
Extracts the next packet from the received packets queue of the current participant,...
void ClearIgnoreList()
Clears the list of addresses to ignore.
uint16_t GetNextSequenceNumber() const
Returns the Sequence Number that will be used in the next SendPacket function call.
int SetDefaultTimestampIncrement(uint32_t timestampinc)
Sets the default value to increment the timestamp with to timestampinc.
RTPTransmissionInfo * GetTransmissionInfo()
This function returns an instance of a subclass of RTPTransmissionInfo which will give some additiona...
virtual void OnPollThreadStop()
Is called when the poll thread is going to stop.
Definition: rtpsession.h:682
int AddToAcceptList(const RTPAddress &addr)
Adds addr to the list of addresses to accept.
void SetNameInterval(int count)
Sets the RTCP interval for the SDES name item.
int SendPacket(const void *data, size_t len, uint8_t pt, bool mark, uint32_t timestampinc)
Sends the RTP packet with payload data which has length len.
void SetLocationInterval(int count)
Sets the RTCP interval for the SDES location item.
uint32_t GetLocalSSRC()
Returns our own SSRC.
virtual void OnNoteTimeout(RTPSourceData *srcdat)
Is called when the SDES NOTE item for source srcdat has been timed out.
Definition: rtpsession.h:666
int Poll()
If you're not using the poll thread, this function must be called regularly to process incoming data ...
int SetSessionBandwidth(double bw)
Sets the session bandwidth to bw, which is specified in bytes per second.
bool SupportsMulticasting()
Returns true if multicasting is supported.
virtual void OnBYEPacket(RTPSourceData *srcdat)
Is called when a BYE packet has been processed for source srcdat.
Definition: rtpsession.h:675
int EndDataAccess()
See BeginDataAccess.
virtual void OnRTCPSenderReport(RTPSourceData *srcdat)
Is called when an RTCP sender report has been processed for this source.
Definition: rtpsession.h:667
virtual void OnSentRTPOrRTCPData(void *senddata, size_t sendlen, bool isrtp)
This function is called when an RTP or RTCP packet was sent, it can be helpful when data was allocate...
Definition: rtpsession.h:688
int SendRawData(const void *data, size_t len, bool usertpchannel)
With this function raw data can be sent directly over the RTP or RTCP channel (if they are different)...
int SetTimestampUnit(double u)
Sets the timestamp unit for our own data.
bool GotoFirstSource()
Starts the iteration over the participants by going to the first member in the table.
virtual void OnTimeout(RTPSourceData *srcdat)
Is called when participant srcdat is timed out.
Definition: rtpsession.h:661
void Destroy()
Leaves the session without sending a BYE packet.
RTPSourceData * GetCurrentSourceInfo()
Returns the RTPSourceData instance for the currently selected participant.
int DeleteFromIgnoreList(const RTPAddress &addr)
Deletes addr from the list of addresses to ignore.
int DeleteFromAcceptList(const RTPAddress &addr)
Deletes addr from the list of addresses to accept.
virtual void OnValidatedRTPPacket(RTPSourceData *srcdat, RTPPacket *rtppack, bool isonprobation, bool *ispackethandled)
Allows you to use an RTP packet from the specified source directly.
Definition: rtpsession.h:690
bool GotoNextSource()
Sets the current source to be the next source in the table.
int SendPacketEx(const void *data, size_t len, uint16_t hdrextID, const void *hdrextdata, size_t numhdrextwords)
Sends the RTP packet with payload data which has length len.
void BYEDestroy(const RTPTime &maxwaittime, const void *reason, size_t reasonlength)
Sends a BYE packet and leaves the session.
int IncrementTimestamp(uint32_t inc)
This function increments the timestamp with the amount given by inc.
int SetLocalEMail(const void *s, size_t len)
Sets the SDES e-mail item for the local participant to the value s with length len.
void SetToolInterval(int count)
Sets the RTCP interval for the SDES tool item.
virtual void OnUnknownPacketType(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an unknown RTCP packet type was detected.
Definition: rtpsession.h:664
int SendPacket(const void *data, size_t len)
Sends the RTP packet with payload data which has length len.
int SetLocalNote(const void *s, size_t len)
Sets the SDES note item for the local participant to the value s with length len.
RTPTime GetRTCPDelay()
Returns the time interval after which an RTCP compound packet may have to be sent (only works when yo...
Describes an entry in the RTPSources source table.
Definition: rtpsourcedata.h:167
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:86
Base class for additional information about the transmitter.
Definition: rtptransmitter.h:249
Base class for transmission parameters.
Definition: rtptransmitter.h:230
Abstract class from which actual transmission components should be derived.
Definition: rtptransmitter.h:63
ReceiveMode
Three kind of receive modes can be specified.
Definition: rtptransmitter.h:81
TransmissionProtocol
Used to identify a specific transmitter.
Definition: rtptransmitter.h:71
@ IPv4UDPProto
Specifies the internal UDP over IPv4 transmitter.
Definition: rtptransmitter.h:72