OPAL  Version 3.14.3
rtpep.h
Go to the documentation of this file.
1 /*
2  * Endpoint abstraction
3  *
4  * Open Phone Abstraction Library (OPAL)
5  *
6  * Copyright (C) 2007 Post Increment
7  *
8  * The contents of this file are subject to the Mozilla Public License
9  * Version 1.0 (the "License"); you may not use this file except in
10  * compliance with the License. You may obtain a copy of the License at
11  * http://www.mozilla.org/MPL/
12  *
13  * Software distributed under the License is distributed on an "AS IS"
14  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15  * the License for the specific language governing rights and limitations
16  * under the License.
17  *
18  * The Original Code is Open Phone Abstraction Library.
19  *
20  * The Initial Developer of the Original Code is Post Increment
21  *
22  * Contributor(s): ______________________________________.
23  *
24  * $Revision: 31401 $
25  * $Author: rjongbloed $
26  * $Date: 2014-02-07 17:11:13 +1100 (Fri, 07 Feb 2014) $
27  */
28 
29 #ifndef OPAL_OPAL_RTPEP_H
30 #define OPAL_OPAL_RTPEP_H
31 
32 #ifdef P_USE_PRAGMA
33 #pragma interface
34 #endif
35 
36 #include <opal_config.h>
37 
38 #include <opal/endpoint.h>
39 
40 
41 #if OPAL_RTP_FEC
42 namespace OpalFEC
43 {
44  const OpalMediaType & MediaType();
45 
46  // RFC 2193 media format "place holders"
47  #define OPAL_REDUNDANT_PREFIX "Redundant"
48  #define OPAL_REDUNDANT_AUDIO OPAL_REDUNDANT_PREFIX"-Audio"
49  #define OpalRedundantAudio OpalFEC::RedundantAudio()
50  extern const OpalMediaFormat & RedundantAudio();
51 
52 #if OPAL_VIDEO
53  #define OPAL_REDUNDANT_VIDEO OPAL_REDUNDANT_PREFIX"-Video"
54  #define OpalRedundantVideo OpalFEC::RedundantVideo()
55  extern const OpalMediaFormat & RedundantVideo();
56 #endif
57 
58  // RFC 5109 media format "place holders"
59  #define OPAL_ULP_FEC_PREFIX "ULP-FEC"
60  #define OPAL_ULP_FEC_AUDIO OPAL_ULP_FEC_PREFIX"-Audio"
61  #define OpalUlpFecAudio OpalFEC::UlpFecAudio()
62  extern const OpalMediaFormat & UlpFecAudio();
63 
64 #if OPAL_VIDEO
65  #define OPAL_ULP_FEC_VIDEO OPAL_ULP_FEC_PREFIX"-Video"
66  #define OpalUlpFecVideo OpalFEC::UlpFecVideo()
67  extern const OpalMediaFormat & UlpFecVideo();
68 #endif
69 
70  const PString & MediaTypeOption();
71 };
72 #endif // OPAL_RTP_FEC
73 
74 
79 {
80  PCLASSINFO(OpalRTPEndPoint, OpalEndPoint);
81 
88  const PCaselessString & prefix,
89  Attributes attributes
90  );
91 
94  ~OpalRTPEndPoint();
96 
108  virtual OpalMediaFormatList GetMediaFormats() const;
109 
115  virtual void OnClosedMediaStream(
116  const OpalMediaStream & stream
117  );
119 
139  virtual PBoolean IsRTPNATEnabled(
140  OpalConnection & connection,
141  const PIPSocket::Address & localAddr,
142  const PIPSocket::Address & peerAddr,
143  const PIPSocket::Address & signalAddr,
144  PBoolean incoming
145  );
146 
159  virtual bool OnLocalRTP(
160  OpalConnection & connection1,
161  OpalConnection & connection2,
162  unsigned sessionID,
163  bool opened
164  ) const;
165 
166  // Check for local RTP connection. Internal function.
167  bool CheckForLocalRTP(const OpalRTPMediaStream & stream);
168 
169  // Check for local RTP connection. Internal function.
170  void CheckEndLocalRTP(OpalConnection & connection, OpalRTPSession * rtp);
171 
172  // Check for local RTP connection. Internal function.
173  void RegisterLocalRTP(OpalRTPSession * rtp, bool removed);
175 
176  protected:
177  struct LocalRtpInfo {
178  LocalRtpInfo(OpalConnection & connection) : m_connection(connection), m_previousResult(-1) { }
179 
182  };
183  typedef std::map<OpalTransportAddress, LocalRtpInfo> LocalRtpInfoMap;
186 };
187 
188 
189 #endif // OPAL_OPAL_RTPEP_H