sipxmedialib  Version 3.3
MpRtpOutputConnection.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2013 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2007 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 
14 #ifndef _MpRtpOutputConnection_h_
15 #define _MpRtpOutputConnection_h_
16 
17 #include "rtcp/RtcpConfig.h"
18 
19 // FORWARD DECLARATIONS
20 class MprDejitter;
21 class MprFromNet;
22 class OsSocket;
23 class SdpCodec;
24 struct IRTCPSession;
25 struct IRTCPConnection;
26 
27 // SYSTEM INCLUDES
28 // APPLICATION INCLUDES
29 #include <os/OsMutex.h>
30 #include <mp/MpResource.h>
31 #include <mp/MpResourceMsg.h>
32 #include <mp/MpTypes.h>
33 #include <mp/MprToNet.h>
34 
35 // DEFINES
36 // MACROS
37 // EXTERNAL FUNCTIONS
38 // EXTERNAL VARIABLES
39 // CONSTANTS
40 // STRUCTS
41 // TYPEDEFS
42 
48 {
49 /* //////////////////////////// PUBLIC //////////////////////////////////// */
50 public:
51 
52  enum {
55  };
56 
57 /* ============================ CREATORS ================================== */
59 
60 
62  MpRtpOutputConnection(const UtlString& resourceName,
63  MpConnectionID myID,
64  IRTCPSession *piRTCPSession);
65 
67  virtual
69 
71 
72 /* ============================ MANIPULATORS ============================== */
74 
75 
77  void setSockets(OsSocket& rRtpSocket, OsSocket& rRtcpSocket);
83  void releaseSockets();
90 #ifdef INCLUDE_RTCP /* [ */
91  virtual void reassignSSRC(void);
93 #endif /* INCLUDE_RTCP ] */
94 
95  // set the # of microseconds of skew to add to the RTCP SR timestamps
96  OsStatus setSRAdjustUSecs(const UtlString& namedResource, OsMsgQ& fgQ, int adjustUSecs);
97 
99 
100 /* ============================ ACCESSORS ================================= */
102 
103 
105  OsStatus setFlowGraph(MpFlowGraphBase* pFlowGraph);
106 
107 #ifdef INCLUDE_RTCP /* [ */
108 
110 
112  IRTCPConnection *getRTCPConnection(void);
113 #endif /* INCLUDE_RTCP ] */
114 
115  inline RtpSRC getSSRC() const;
116 
118 
119 /* ============================ INQUIRY =================================== */
121 
122 
124 
125 /* //////////////////////////// PROTECTED ///////////////////////////////// */
126 protected:
127 
129  UtlBoolean mOutRtpStarted;
130 
131 #ifdef INCLUDE_RTCP /* [ */
132  IRTCPConnection *mpiRTCPConnection;
133 
134 #endif /* INCLUDE_RTCP ] */
135 
137  UtlBoolean processFrame();
138 
140  UtlBoolean connectInput(MpResource& rFrom, int fromPortIdx, int toPortIdx);
141 
142 /* //////////////////////////// PRIVATE /////////////////////////////////// */
143 private:
144 
145  typedef enum
146  {
148  } AddlResMsgTypes;
149 
150  UtlBoolean handleMessage(MpResourceMsg& message);
151 
154 
156  MpRtpOutputConnection(const MpRtpOutputConnection& rMpRtpOutputConnection);
157 
160 };
161 
162 /* ============================ INLINE METHODS ============================ */
163 
165 {
166  return mpToNet->getSSRC();
167 }
168 
169 #endif // _MpRtpOutputConnection_h_
UtlBoolean mOutRtpStarted
Are we currently sending RTP stream?
Definition: MpRtpOutputConnection.h:129
OsStatus setFlowGraph(MpFlowGraphBase *pFlowGraph)
Associates this resource with the indicated flow graph.
Definition: MpRtpOutputConnection.cpp:156
Message object used to communicate with the media processing task.
Definition: MpResourceMsg.h:30
Definition: MpRtpOutputConnection.h:53
Definition: MpResourceMsg.h:56
virtual ~MpRtpOutputConnection()
Destructor.
Definition: MpRtpOutputConnection.cpp:79
OsStatus setSRAdjustUSecs(const UtlString &namedResource, OsMsgQ &fgQ, int adjustUSecs)
Flow graph for coordinating the execution of media processing resources.
Definition: MpFlowGraphBase.h:91
UtlBoolean processFrame()
This method is called in every flowgraph processing cycle.
Definition: MpRtpOutputConnection.cpp:208
RtpSRC getSSRC() const
Definition: MpRtpOutputConnection.h:164
virtual void reassignSSRC(void)
Broadcast announcement that we are changing our SSRC.
Definition: MpResource.cpp:234
MpRtpOutputConnection & operator=(const MpRtpOutputConnection &rhs)
Assignment operator (not implemented for this type)
AddlResMsgTypes
Definition: MpRtpOutputConnection.h:145
Connection container for the inbound and outbound network paths to a single remote party...
Definition: MpRtpOutputConnection.h:47
The "From Network" media processing resource.
Definition: MprFromNet.h:55
UtlBoolean handleMessage(MpResourceMsg &message)
Handles an incoming resource message for this media processing object.
Definition: MpRtpOutputConnection.cpp:131
void setSockets(OsSocket &rRtpSocket, OsSocket &rRtcpSocket)
Set sockets to which data will be sent.
Definition: MpRtpOutputConnection.cpp:87
The RTP writer.
Definition: MprToNet.h:48
RtpSRC getSSRC() const
Definition: MprToNet.h:180
Definition: MpRtpOutputConnection.h:147
MprToNet * mpToNet
Outbound component: ToNet.
Definition: MpRtpOutputConnection.h:128
int MpConnectionID
Flowgraph connection ID.
Definition: MpTypes.h:56
uint32_t RtpSRC
RTP SSRC or CSRC identifier.
Definition: MpTypes.h:61
void releaseSockets()
Release sockets to which data will be sent.
Definition: MpRtpOutputConnection.cpp:106
Abstract base class for all media processing objects.
Definition: MpResource.h:56
The "Dejitter" utility class.
Definition: MprDejitter.h:39
MpRtpOutputConnection()
Default constructor.
Definition: MpRtpOutputConnection.h:54
UtlBoolean connectInput(MpResource &rFrom, int fromPortIdx, int toPortIdx)
Connects the toPortIdx input port on this resource to the fromPortIdx output port of the rFrom resour...
Definition: MpRtpOutputConnection.cpp:213