|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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: Class to parse RTP packets.* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CRTPPACKET_H |
|
21 #define CRTPPACKET_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <RtpHeader.h> |
|
25 |
|
26 // CONSTANTS |
|
27 // None |
|
28 |
|
29 // MACROS |
|
30 // None |
|
31 |
|
32 // DATA TYPES |
|
33 // None |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 // None |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Class for RTP header. |
|
42 * |
|
43 * @lib RtpClipHandler.lib |
|
44 * @since Series 60 3.0 |
|
45 */ |
|
46 class CRtpPacket : public CBase |
|
47 { |
|
48 |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * @return a pointer to the newly created RTP packet object. |
|
54 */ |
|
55 IMPORT_C static CRtpPacket* NewL(); |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 * @return a pointer to the newly created RTP packet object. |
|
60 */ |
|
61 IMPORT_C static CRtpPacket* NewLC(); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 IMPORT_C virtual ~CRtpPacket(); |
|
67 |
|
68 public: // New functions |
|
69 |
|
70 /** |
|
71 * Parse RTCP packet buffer to retrive RTCP fields. |
|
72 * @since Series 60 3.0 |
|
73 * @param aPktBuf a RTP packet. |
|
74 * @return system wide error code. |
|
75 */ |
|
76 IMPORT_C TInt ParseRtp( const TDesC8& aPktBuf ); |
|
77 |
|
78 /** |
|
79 * Sets syncronised time stamp of packet. |
|
80 * @since Series 60 3.0 |
|
81 * @param aTs a new timestamp value. |
|
82 * @return none. |
|
83 */ |
|
84 IMPORT_C void SetTimeStamp( const TUint32 aTs ); |
|
85 |
|
86 private: // Constructors and destructor |
|
87 |
|
88 /** |
|
89 * By default Symbian 2nd phase constructor is private. |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 * @since Series 60 3.0 |
|
96 */ |
|
97 CRtpPacket(); |
|
98 |
|
99 private: // New functions |
|
100 |
|
101 /** |
|
102 * Read 32 bits from current offset. |
|
103 * @since Series 60 3.0 |
|
104 * @param aPktBuf a packet buffer. |
|
105 * @param aByte a byte index. |
|
106 * @return an readed unsigned integer. |
|
107 */ |
|
108 TUint Read32Bits( const TPtrC8& aPktBuf, |
|
109 TInt& aByte ); |
|
110 |
|
111 public: // Data |
|
112 |
|
113 /** |
|
114 * Header of the packet. |
|
115 */ |
|
116 TRtpRecvHeader iRtpRecvHeader; |
|
117 |
|
118 /** |
|
119 * Payload off the packet. |
|
120 */ |
|
121 TPtrC8 iPayload; |
|
122 |
|
123 }; |
|
124 |
|
125 #endif // CRTPPACKET_H |
|
126 |
|
127 // End of File |