OPAL  Version 3.18.8
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 
25 #ifndef OPAL_OPAL_RTPEP_H
26 #define OPAL_OPAL_RTPEP_H
27 
28 #ifdef P_USE_PRAGMA
29 #pragma interface
30 #endif
31 
32 #include <opal_config.h>
33 
34 #include <opal/endpoint.h>
35 
36 
37 class OpalRTPMediaStream;
38 
39 
40 #if OPAL_RTP_FEC
41 namespace OpalFEC
42 {
43  const OpalMediaType & MediaType();
44 
45  // RFC 2193 media format "place holders"
46  #define OPAL_REDUNDANT_PREFIX "Redundant"
47  #define OPAL_REDUNDANT_AUDIO OPAL_REDUNDANT_PREFIX"-Audio"
48  #define OpalRedundantAudio OpalFEC::RedundantAudio()
49  extern const OpalMediaFormat & RedundantAudio();
50 
51 #if OPAL_VIDEO
52  #define OPAL_REDUNDANT_VIDEO OPAL_REDUNDANT_PREFIX"-Video"
53  #define OpalRedundantVideo OpalFEC::RedundantVideo()
54  extern const OpalMediaFormat & RedundantVideo();
55 #endif
56 
57  // RFC 5109 media format "place holders"
58  #define OPAL_ULP_FEC_PREFIX "ULP-FEC"
59  #define OPAL_ULP_FEC_AUDIO OPAL_ULP_FEC_PREFIX"-Audio"
60  #define OpalUlpFecAudio OpalFEC::UlpFecAudio()
61  extern const OpalMediaFormat & UlpFecAudio();
62 
63 #if OPAL_VIDEO
64  #define OPAL_ULP_FEC_VIDEO OPAL_ULP_FEC_PREFIX"-Video"
65  #define OpalUlpFecVideo OpalFEC::UlpFecVideo()
66  extern const OpalMediaFormat & UlpFecVideo();
67 #endif
68 
69  const PString & MediaTypeOption();
70 };
71 #endif // OPAL_RTP_FEC
72 
73 
78 {
79  PCLASSINFO(OpalRTPEndPoint, OpalEndPoint);
80 
86  OpalManager & manager,
87  const PCaselessString & prefix,
88  Attributes attributes
89  );
90 
93  ~OpalRTPEndPoint();
95 
100  virtual PStringList GetAvailableStringOptions() const;
101 
120  virtual void OnReleased(
121  OpalConnection & connection
122  );
123 
133  virtual OpalMediaFormatList GetMediaFormats() const;
134 
140  virtual void OnClosedMediaStream(
141  const OpalMediaStream & stream
142  );
144 
164  virtual PBoolean IsRTPNATEnabled(
165  OpalConnection & connection,
166  const PIPSocket::Address & localAddr,
167  const PIPSocket::Address & peerAddr,
168  const PIPSocket::Address & signalAddr,
169  PBoolean incoming
170  );
171 
184  virtual bool OnLocalRTP(
185  OpalConnection & connection1,
186  OpalConnection & connection2,
187  unsigned sessionID,
188  bool opened
189  ) const;
190 
191  // Check for local RTP connection. Internal function.
192  bool CheckForLocalRTP(const OpalRTPMediaStream & stream);
193 
194  // Check for local RTP connection. Internal function.
195  void CheckEndLocalRTP(OpalConnection & connection, OpalRTPSession * rtp);
196 
197  // Check for local RTP connection. Internal function.
198  void RegisterLocalRTP(OpalRTPSession * rtp, bool removed);
200 
201  protected:
202  struct LocalRtpInfo {
203  LocalRtpInfo(OpalConnection & connection) : m_connection(connection), m_previousResult(-1) { }
204 
207  };
208  typedef std::map<OpalTransportAddress, LocalRtpInfo> LocalRtpInfoMap;
210  PDECLARE_MUTEX(m_connectionsByRtpMutex);
211 };
212 
213 
214 #endif // OPAL_OPAL_RTPEP_H
Definition: manager.h:150
Definition: endpoint.h:65
int m_previousResult
Definition: rtpep.h:206
Definition: mediatype.h:66
PDECLARE_MUTEX(m_connectionsByRtpMutex)
Definition: rtp_stream.h:47
Definition: mediafmt.h:112
Definition: mediafmt.h:806
std::map< OpalTransportAddress, LocalRtpInfo > LocalRtpInfoMap
Definition: rtpep.h:208
LocalRtpInfoMap m_connectionsByRtpLocalAddr
Definition: rtpep.h:209
Definition: rtp_session.h:90
OpalConnection & m_connection
Definition: rtpep.h:205
LocalRtpInfo(OpalConnection &connection)
Definition: rtpep.h:203
Definition: mediastrm.h:110
Definition: connection.h:415
Definition: rtpep.h:77
Definition: rtpep.h:202