|
1 /* |
|
2 * Copyright (c) 2003-2009 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 * Name : SdpRtpmapValue.h |
|
16 * Part of : SDP Codec |
|
17 * Interface : SDK API, SDP Codec API |
|
18 * Version : 1.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 #ifndef TSDPRTPMAPVALUE_H |
|
25 #define TSDPRTPMAPVALUE_H |
|
26 |
|
27 // INCLUDES |
|
28 #include <e32std.h> |
|
29 #include <stringpool.h> |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class RWriteStream; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 /** |
|
36 * @publishedAll |
|
37 * @released |
|
38 * |
|
39 * Utility class for manipulating the value of an rtpmap-attribute. |
|
40 * |
|
41 * The normative reference for correct formatting and values is |
|
42 * draft-ietf-mmusic-sdp-new-14 unless specified otherwise in |
|
43 * member documentation. The implementation supports this normative |
|
44 * reference, but does not enforce it fully. |
|
45 * |
|
46 * @lib sdpcodec.lib |
|
47 */ |
|
48 class TSdpRtpmapValue |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Initializes the instance to refer to the given rtpmap components. |
|
54 * The parameters must stay in scope as long as this instance exists. |
|
55 * Otherwise, the member variables of this class will point to |
|
56 * a released memory. |
|
57 * |
|
58 * @param aEncodingName Valid rtpmap encoding name value. |
|
59 * @param aClockrate Valid rtpmap clockrate value. |
|
60 * @param aEncodingParameters Valid rtpmap encoding |
|
61 * parameter list. |
|
62 */ |
|
63 IMPORT_C TSdpRtpmapValue( |
|
64 const TPtrC8& aEncodingName, |
|
65 const TPtrC8& aClockrate, |
|
66 const TPtrC8& aEncodingParameters ); |
|
67 |
|
68 public: // New functions |
|
69 |
|
70 /** |
|
71 * Tries to parse a string as an rtpmap attribute value up to the end |
|
72 * of the string or CRLF, whichever comes first, and set pointers to |
|
73 * the components found. The parameter must stay in scope as long as |
|
74 * this instance exists. Otherwise, the member variables of this class |
|
75 * will point to a released memory. |
|
76 * |
|
77 * @param aText String containing the value of an rtpmap attribute. |
|
78 * @return a new instance |
|
79 * @leave KErrArgument if parsing fails. |
|
80 */ |
|
81 IMPORT_C static TSdpRtpmapValue DecodeL( const TDesC8& aText ); |
|
82 |
|
83 /** |
|
84 * Outputs the attribute value formatted according to SDP syntax. |
|
85 * The field terminating CRLF is not included in the output. |
|
86 * When constructing CSdpFmtAttributeField, return value of this |
|
87 * function can be used as aValue in CSdpFmtAttributeField::NewL |
|
88 * (RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue) |
|
89 * function. |
|
90 * |
|
91 * @return Encoded value. Ovnership of buffer is changed to caller. |
|
92 */ |
|
93 IMPORT_C HBufC8* EncodeL() const; |
|
94 |
|
95 public: // Data |
|
96 |
|
97 /** |
|
98 * Encoding name part of an rtpmap value |
|
99 * @internalComponent |
|
100 */ |
|
101 TPtrC8 iEncName; |
|
102 |
|
103 /** |
|
104 * Clockrate part of an rtpmap value. |
|
105 * @internalComponent |
|
106 */ |
|
107 TPtrC8 iClockrate; |
|
108 |
|
109 /** |
|
110 * Encoding parameters part of an rtpmap value. |
|
111 * @internalComponent |
|
112 */ |
|
113 TPtrC8 iEncParams; |
|
114 }; |
|
115 |
|
116 #endif // TSDPRTPMAPVALUE_H |