|
1 /* |
|
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __RTPSTREAM_H |
|
22 #define __RTPSTREAM_H |
|
23 |
|
24 #include <rtpdef.h> |
|
25 #include "rtputil.h" |
|
26 #include "rtppacket.h" |
|
27 #include "rtpstreamdef.h" |
|
28 |
|
29 /** |
|
30 * Base class for RTP stream. |
|
31 * |
|
32 * @lib RtpService.dll |
|
33 */ |
|
34 class CRtpStream : public CBase |
|
35 { |
|
36 #if defined( _DEBUG ) && defined( RTP_UNIT_TEST ) |
|
37 // Friend class used for testing |
|
38 friend class CRtpUtRtpSession; |
|
39 #endif |
|
40 public: |
|
41 ~CRtpStream(); |
|
42 virtual TInt ResetStreamStat() = 0; |
|
43 inline TBool FirstPkg() const { return iFlagFirstPkg; }; |
|
44 inline void SetFirstPkg( TBool aFlg ) { iFlagFirstPkg = aFlg; }; |
|
45 inline TRtpSSRC GetLocalSSRC() const { return iLocalSSRC; }; |
|
46 inline void SetLocalSSRC( TRtpSSRC aSSRC ) { iLocalSSRC = aSSRC; }; |
|
47 inline void RegisterRtcpObserver( MRtcpObserver& aRtcpObserver ) { iRtcpObserver = &aRtcpObserver; }; |
|
48 inline void UnRegisterRtcpObserver() { iRtcpObserver = NULL; }; |
|
49 inline TRtpId GetStreamID() const { return iStreamId; }; |
|
50 inline void RtcpStats( TRtcpStats& aRtcpStat ) { aRtcpStat = iRtcpStats; }; |
|
51 virtual TInt GetStreamStat( TRtpPeerStat& aStat ) = 0; |
|
52 virtual TRtpRtcpEnum RtpStreamProcessRtcpReportSectionL( CRtpPacket* aPkt ) = 0; |
|
53 virtual void RtpStreamCreateRtcpReportSection( CRtpPacket* aPkt ) = 0; |
|
54 |
|
55 protected: |
|
56 CRtpStream( const TRtpId aReceiveStreamId, |
|
57 const TRtpId aSessionId, |
|
58 const TUint32* aProfileRTPTimeRates, |
|
59 MRtcpObserver* aRtcpObserver, |
|
60 const TRtpPayloadType aPayloadType ); |
|
61 |
|
62 protected: |
|
63 TBool iFlagFirstPkg; |
|
64 TRtpSSRC iLocalSSRC; |
|
65 TRtpId iStreamId; |
|
66 TRtpId iSessionId; // id of session which the stream belongs to |
|
67 |
|
68 TRtpSequence iBaseSeqNum; |
|
69 TRtpSequence iSeqNum; |
|
70 TRtpSequence iSeqNumCycles; |
|
71 TRtpTimeStamp iTimeStamp; |
|
72 TRtpTimeSync iSyncInfo; |
|
73 TRtcpStats iRtcpStats; |
|
74 TRtpPayloadType iPayload; |
|
75 const TUint32* iProfileRTPTimeRates; |
|
76 |
|
77 MRtcpObserver* iRtcpObserver; // rtcp callback |
|
78 private: |
|
79 #ifdef EUNIT_TESTING |
|
80 friend class UT_CRtpSession; |
|
81 friend class UT_CRtpStream; |
|
82 #endif |
|
83 |
|
84 }; |
|
85 |
|
86 |
|
87 #endif // __RTPSTREAM_H |
|
88 |
|
89 // End of File |