|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // RTCP Flow Definitions. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 |
|
24 #ifndef CRTCPFLOW_H |
|
25 #define CRTCPFLOW_H |
|
26 |
|
27 #include "rtpprovisioninfo.h" |
|
28 #include "rtpbaseflow.h" |
|
29 #include "rtpcontroller.h" |
|
30 |
|
31 |
|
32 const TInt KRtcpDefBufSz = 1500; |
|
33 |
|
34 NONSHARABLE_CLASS(CRtcpFlow) : public CRtpBaseFlow |
|
35 { |
|
36 /** CRtcpFlow implements the RTCP Flow. |
|
37 |
|
38 @internalComponent |
|
39 |
|
40 **/ |
|
41 |
|
42 friend class CRtpFlowFactory; |
|
43 |
|
44 public: |
|
45 static CRtcpFlow* NewL(CSubConnectionFlowFactoryBase& aFactory, |
|
46 const Messages::TNodeId& aSubConn, |
|
47 CProtocolIntfBase* aProtocolIntf); |
|
48 |
|
49 public: |
|
50 |
|
51 virtual TInt Write(RMBufChain& aData, TUint aOptions, TSockAddr* anAddr = NULL ); |
|
52 virtual TInt GetData(RMBufChain& aData, TUint aLength,TUint aOptions,TSockAddr* anAddr=NULL); |
|
53 |
|
54 /* From MRtpDataSender */ |
|
55 virtual void SendData(TDes8& aBuffer,TSockAddr& aRemoteAddr, TInt aFlags, TRequestStatus& aStatus); |
|
56 |
|
57 void SetRtpSession(CRtpController *apRtpSession); |
|
58 |
|
59 public: |
|
60 |
|
61 //CSubConnectionFlowBase |
|
62 virtual void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage); |
|
63 |
|
64 virtual void NewData(TUint aCount); |
|
65 virtual void CanSend(); |
|
66 |
|
67 virtual void DoUpdateLocalAddress(const TSockAddr& anAddr); |
|
68 |
|
69 virtual ~CRtcpFlow(); |
|
70 |
|
71 protected: |
|
72 CRtcpFlow(ESock::CSubConnectionFlowFactoryBase& aFactory, const Messages::TNodeId& aSubConnId, ESock::CProtocolIntfBase* aProtocolIntf); |
|
73 void ConstructL(); |
|
74 /* Worker for Provision */ |
|
75 void DoProvisionL(const CRtpProvisionConfig *apRtpProv); |
|
76 |
|
77 void DoCanClose(MSessionControlNotify::TDelete aDelete); |
|
78 |
|
79 void HandleWriteBlocked(TSockAddr& aAddr,TDes8& aBuffer); |
|
80 |
|
81 virtual TInt DoSetOption(TUint level, TUint name, const TDesC8 &anOption); |
|
82 virtual TInt DoGetOption(TUint level, TUint name, TDes8 &anOption) const; |
|
83 |
|
84 void SetNonRtcpSendData(TBool aNonRtcpData); |
|
85 TBool NonRtcpSendData(); |
|
86 /* RTP Session Pointer */ |
|
87 CRtpController *iRtpSession; |
|
88 |
|
89 /* This buffer is used to pass data to rtp Stack.*/ |
|
90 RBuf8 iRtcpBuffer; |
|
91 |
|
92 /* If the UDP flows us off we will buffer the current packet. If another |
|
93 report comes in during this interval the buffered data will be updated |
|
94 with the new report. This will be send out in CanSend(). */ |
|
95 TBool iBlockedWrite; |
|
96 |
|
97 /* Temp buffers */ |
|
98 RMBufChain iRtcpDataChain; |
|
99 RBuf8 iRtcpTempBuffer; |
|
100 // Non Rtcp Data sending flag |
|
101 TBool iNonRtcpSendData; |
|
102 |
|
103 /* Handler For RTCP Flow */ |
|
104 CCFRtpHandler *iRtcpHandler; |
|
105 }; |
|
106 |
|
107 |
|
108 |
|
109 #endif // CRTCPFLOW_H |
|
110 |