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