jrtplib  3.6.0
rtpsessionsources.h
Go to the documentation of this file.
1 /*
2 
3  This file is a part of JRTPLIB
4  Copyright (c) 1999-2006 Jori Liesenborgs
5 
6  Contact: jori.liesenborgs@gmail.com
7 
8  This library was developed at the "Expertisecentrum Digitale 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 RTPSESSIONSOURCES_H
38 
39 #define RTPSESSIONSOURCES_H
40 
41 #include "rtpconfig.h"
42 #include "rtpsources.h"
43 
44 class RTPSession;
45 
46 class RTPSessionSources : public RTPSources
47 {
48 public:
49  RTPSessionSources(RTPSession &sess,RTPMemoryManager *mgr) : rtpsession(sess),RTPSources(RTPSources::ProbationStore,mgr)
50  { owncollision = false; }
51  ~RTPSessionSources() { }
52  void ClearOwnCollisionFlag() { owncollision = false; }
53  bool DetectedOwnCollision() const { return owncollision; }
54 private:
55  void OnRTPPacket(RTPPacket *pack,const RTPTime &receivetime,
56  const RTPAddress *senderaddress);
57  void OnRTCPCompoundPacket(RTCPCompoundPacket *pack,const RTPTime &receivetime,
58  const RTPAddress *senderaddress);
59  void OnSSRCCollision(RTPSourceData *srcdat,const RTPAddress *senderaddress,bool isrtp);
60  void OnCNAMECollision(RTPSourceData *srcdat,const RTPAddress *senderaddress,
61  const uint8_t *cname,size_t cnamelength);
62  void OnNewSource(RTPSourceData *srcdat);
63  void OnRemoveSource(RTPSourceData *srcdat);
64  void OnTimeout(RTPSourceData *srcdat);
65  void OnBYETimeout(RTPSourceData *srcdat);
66  void OnBYEPacket(RTPSourceData *srcdat);
67  void OnAPPPacket(RTCPAPPPacket *apppacket,const RTPTime &receivetime,
68  const RTPAddress *senderaddress);
69  void OnUnknownPacketType(RTCPPacket *rtcppack,const RTPTime &receivetime,
70  const RTPAddress *senderaddress);
71  void OnUnknownPacketFormat(RTCPPacket *rtcppack,const RTPTime &receivetime,
72  const RTPAddress *senderaddress);
73  void OnNoteTimeout(RTPSourceData *srcdat);
74 
75  RTPSession &rtpsession;
76  bool owncollision;
77 };
78 
79 #endif // RTPSESSIONSOURCES_H
Store incoming RTP packet from a source that's on probation for later retrieval.
Definition: rtpsources.h:79
virtual void OnBYETimeout(RTPSourceData *srcdat)
Is called when participant srcdat is timed after having sent a BYE packet.
Definition: rtpsources.h:319
High level class for using RTP.
Definition: rtpsession.h:76
Represents an RTP Packet.
Definition: rtppacket.h:53
virtual void OnNewSource(RTPSourceData *srcdat)
Is called when a new entry srcdat is added to the source table.
Definition: rtpsources.h:310
A memory manager.
Definition: rtpmemorymanager.h:144
Represents a table in which information about the participating sources is kept.
Definition: rtpsources.h:71
virtual void OnBYEPacket(RTPSourceData *srcdat)
Is called when a BYE packet has been processed for source srcdat.
Definition: rtpsources.h:322
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: rtpsources.h:327
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: rtpsources.h:335
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:77
Describes an RTCP APP packet.
Definition: rtcpapppacket.h:51
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:47
virtual void OnUnknownPacketType(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an unknown RTCP packet type was detected.
Definition: rtpsources.h:331
virtual void OnTimeout(RTPSourceData *srcdat)
Is called when participant srcdat is timed out.
Definition: rtpsources.h:316
Represents an RTCP compound packet.
Definition: rtcpcompoundpacket.h:50
virtual void OnRTCPCompoundPacket(RTCPCompoundPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an RTCP compound packet is about to be processed.
Definition: rtpsources.h:295
virtual void OnSSRCCollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp)
Is called when an SSRC collision was detected.
Definition: rtpsources.h:303
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: rtpsources.h:306
This class is an abstract class which is used to specify destinations, multicast groups etc...
Definition: rtpaddress.h:47
virtual void OnRemoveSource(RTPSourceData *srcdat)
Is called when the entry srcdat is about to be deleted from the source table.
Definition: rtpsources.h:313
virtual void OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an RTP packet is about to be processed.
Definition: rtpsources.h:292
virtual void OnNoteTimeout(RTPSourceData *srcdat)
Is called when the SDES NOTE item for source srcdat has been timed out.
Definition: rtpsources.h:339
Describes an entry in the RTPSources source table.
Definition: rtpsourcedata.h:164