1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/sdprtpmapvalue.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,117 @@
1.4 +/*
1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : SdpRtpmapValue.h
1.19 +* Part of : SDP Codec
1.20 +* Interface : SDK API, SDP Codec API
1.21 +* Version : 1.0
1.22 +*
1.23 +*/
1.24 +
1.25 +
1.26 +
1.27 +#ifndef TSDPRTPMAPVALUE_H
1.28 +#define TSDPRTPMAPVALUE_H
1.29 +
1.30 +// INCLUDES
1.31 +#include <e32std.h>
1.32 +#include <stringpool.h>
1.33 +#include "_sdpdefs.h"
1.34 +
1.35 +// FORWARD DECLARATIONS
1.36 +class RWriteStream;
1.37 +
1.38 +// CLASS DECLARATION
1.39 +/**
1.40 + * @publishedAll
1.41 + * @released
1.42 + *
1.43 + * Utility class for manipulating the value of an rtpmap-attribute.
1.44 + *
1.45 + * The normative reference for correct formatting and values is
1.46 + * draft-ietf-mmusic-sdp-new-14 unless specified otherwise in
1.47 + * member documentation. The implementation supports this normative
1.48 + * reference, but does not enforce it fully.
1.49 + *
1.50 + * @lib sdpcodec.lib
1.51 + */
1.52 +class TSdpRtpmapValue
1.53 + {
1.54 + public: // Constructors and destructor
1.55 +
1.56 + /**
1.57 + * Initializes the instance to refer to the given rtpmap components.
1.58 + * The parameters must stay in scope as long as this instance exists.
1.59 + * Otherwise, the member variables of this class will point to
1.60 + * a released memory.
1.61 + *
1.62 + * @param aEncodingName Valid rtpmap encoding name value.
1.63 + * @param aClockrate Valid rtpmap clockrate value.
1.64 + * @param aEncodingParameters Valid rtpmap encoding
1.65 + * parameter list.
1.66 + */
1.67 + IMPORT_C TSdpRtpmapValue(
1.68 + const TPtrC8& aEncodingName,
1.69 + const TPtrC8& aClockrate,
1.70 + const TPtrC8& aEncodingParameters );
1.71 +
1.72 + public: // New functions
1.73 +
1.74 + /**
1.75 + * Tries to parse a string as an rtpmap attribute value up to the end
1.76 + * of the string or CRLF, whichever comes first, and set pointers to
1.77 + * the components found. The parameter must stay in scope as long as
1.78 + * this instance exists. Otherwise, the member variables of this class
1.79 + * will point to a released memory.
1.80 + *
1.81 + * @param aText String containing the value of an rtpmap attribute.
1.82 + * @return a new instance
1.83 + * @leave KErrArgument if parsing fails.
1.84 + */
1.85 + IMPORT_C static TSdpRtpmapValue DecodeL( const TDesC8& aText );
1.86 +
1.87 + /**
1.88 + * Outputs the attribute value formatted according to SDP syntax.
1.89 + * The field terminating CRLF is not included in the output.
1.90 + * When constructing CSdpFmtAttributeField, return value of this
1.91 + * function can be used as aValue in CSdpFmtAttributeField::NewL
1.92 + * (RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue)
1.93 + * function.
1.94 + *
1.95 + * @return Encoded value. Ovnership of buffer is changed to caller.
1.96 + */
1.97 + IMPORT_C HBufC8* EncodeL() const;
1.98 +
1.99 + public: // Data
1.100 +
1.101 + /**
1.102 + * Encoding name part of an rtpmap value
1.103 + * @internalComponent
1.104 + */
1.105 + TPtrC8 iEncName;
1.106 +
1.107 + /**
1.108 + * Clockrate part of an rtpmap value.
1.109 + * @internalComponent
1.110 + */
1.111 + TPtrC8 iClockrate;
1.112 +
1.113 + /**
1.114 + * Encoding parameters part of an rtpmap value.
1.115 + * @internalComponent
1.116 + */
1.117 + TPtrC8 iEncParams;
1.118 + };
1.119 +
1.120 +#endif // TSDPRTPMAPVALUE_H