realtimenetprots/rtp/cfrtp/inc/rtp_subconparams.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // RTP SubConParams Definitions.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21  @released
       
    22  @since v9.5
       
    23 */
       
    24 
       
    25 #ifndef __RTP_SUBCONPARAMS_H__
       
    26 #define __RTP_SUBCONPARAMS_H__
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <e32std.h>
       
    30 #include <comms-infras/metadata.h>
       
    31 #include <comms-infras/metatype.h>
       
    32 #include <comms-infras/metabuffer.h>
       
    33 #include <comms-infras/ss_protocolparameterset.h>
       
    34 
       
    35 #include <es_sock.h>
       
    36 
       
    37 #include <rtp_uid.h>
       
    38 
       
    39 
       
    40 const TInt32 KSubConnRTPGenericParamsType = 2;
       
    41 
       
    42 class CSubConRTPGenericParamSet : public ESock::CSubConnectionProtocolParameterSet
       
    43 	{
       
    44 	friend class CSubConRTPParamFactory;
       
    45 	public:
       
    46 
       
    47 	inline static CSubConRTPGenericParamSet* NewL(CSubConParameterFamily& aFamily, CSubConParameterFamily::TParameterSetType aType);
       
    48 	
       
    49 	inline static CSubConRTPGenericParamSet* NewL();
       
    50 	
       
    51 	virtual ~CSubConRTPGenericParamSet();
       
    52 	
       
    53 	virtual TInt SetTierID(TUid aTierId);
       
    54 	
       
    55 	/* RTP Stack Initialisation Parameters Get/Set */
       
    56   	virtual void SetBandWidth(TUint aBandWidth);
       
    57   
       
    58   	virtual void SetMaxDropOut(TUint aMaxDropout);
       
    59 
       
    60 	virtual void SetMaxMisorder(TUint aMaxMisorder);
       
    61 
       
    62 	virtual void SetMinSequencial(TUint aMinSequential);
       
    63 
       
    64 	virtual void SetRtptimeConversion(TUint aRtpTimeConversion);
       
    65 
       
    66 	virtual void SetRtpTimeNow(TUint aRtpTimeNow);
       
    67 
       
    68 	virtual void SetRtpAutoSend(TBool aAutoSendRtcp);
       
    69 	
       
    70 	/* Set the UID of RTP Flow inplementation  */
       
    71 	virtual void SetProtocolUIDRtp(TUid aRTPProtocolUiD);
       
    72 			
       
    73 	virtual void SetServiceProtocolID(TInt aServiceProtocolID);
       
    74 	
       
    75 	virtual void SetLowerSubConnType(RSubConnection::TSubConnType aSubConnType);
       
    76 	
       
    77 	/** Set the CNAME for the session
       
    78 	
       
    79 	@param aCName The CNAME descriptor.This should be same as the one used in the API:
       
    80     			  void RRtpSession::OpenL(RSocketServ& aServer, TSockAddr& aLocalAddr,
       
    81 				  TSockAddr& aRemoteAddr,
       
    82 				  TInt aMaxRXSize, RSubConnection& aSubConnection, TInt aPriority = EPriorityNormal, 
       
    83 				  const TDesC8& aCNAME = KNullDesC8)    				
       
    84 	*/
       
    85 	
       
    86 	virtual void SetCNAMEL(const TDesC8& aCName);
       
    87 	
       
    88 	virtual void SetDefDestinationAddr(TInetAddr& aDefDestAddr);
       
    89 
       
    90 	virtual void SetRtcpReportInterval(const TTimeIntervalMicroSeconds32& aInterval);
       
    91 
       
    92 
       
    93     /* The Get Functions are not made Virtual. They are supposed to be accessed
       
    94        inside the CF Dll */
       
    95 	TUid GetProtocolUiDRtp();
       
    96 	
       
    97 	TInt GetServiceProtocolID();
       
    98 	
       
    99 	RSubConnection::TSubConnType GetLowerSubConnType();
       
   100 
       
   101 	TUint BandWidth() const;
       
   102 	  
       
   103 	TUint MaxDropOut() const;
       
   104 	 
       
   105 	TUint MaxMisorder() const;
       
   106 	  
       
   107 	TUint MinSequencial() const;
       
   108 
       
   109 	TUint RtptimeConversion() const;
       
   110 
       
   111 	TUint RtpTimeNow() const;
       
   112 
       
   113 	TBool RtpAutoSend() const;
       
   114 
       
   115 	const TTimeIntervalMicroSeconds32& GetRtcpReportInterval() const;
       
   116 	
       
   117 	const TDesC8& GetCNAME() const;
       
   118 	
       
   119 	const TInetAddr& GetDefDestinationAddr() const;
       
   120 
       
   121 
       
   122 	DATA_VTABLE
       
   123 	
       
   124 	protected:
       
   125 	
       
   126 	CSubConRTPGenericParamSet();
       
   127     
       
   128 	/* UID of RTP Flow factory */
       
   129 	TUid								iRTPProtocolUiD;
       
   130 	/* Who will be RTP SCPR's Service Provider? */
       
   131 	TInt								iServiceProtocolID;
       
   132 	/* Give EAttachToDefault to stack on Default IpScrpr */
       
   133 	RSubConnection::TSubConnType		iSubConnType;
       
   134 	
       
   135 	/* Bandwdth Available to the RTP Application */
       
   136 	TUint 								iBandWidth;
       
   137 	/* Max Drop Allowed */ 
       
   138 	TUint								iMaxDropout;
       
   139 	/* Max misorder allowed */
       
   140 	TUint 								iMaxMisorder;
       
   141     TUint 								iMinSequencial;
       
   142      
       
   143     /* mapping between RTP Time and "normal" time */
       
   144     TUint 								iRtpTimeConversion;
       
   145 	TUint 								iRtpTimeNow;
       
   146 	/* if ETrue sends RTCP report automatically */ 
       
   147 	TBool 								iAutoSendRtcp;
       
   148 	/* The CName for RTP Session */
       
   149 	RBuf8 								iCName;
       
   150 	/* Set the default destination address */
       
   151 	TInetAddr                           iDefDestAddr;
       
   152 	/* RTCP report interval. Overrides report calculation inside stack */
       
   153 	TTimeIntervalMicroSeconds32			iRtcpInterval;
       
   154 	};
       
   155 
       
   156 
       
   157 class CSubConRTPParamFactory: public CBase
       
   158 /** Factory used to create instances of the RTP SubConnection Parameter Extension Sets.
       
   159 
       
   160 @internalComponent
       
   161 */
       
   162 	{
       
   163 public:
       
   164     enum { iUid = KSubConnRTPParamsImplUid };
       
   165 	static CSubConParameterSet* NewL(TAny* aConstructionParameters);
       
   166 	};
       
   167 
       
   168 
       
   169 CSubConRTPGenericParamSet* CSubConRTPGenericParamSet::NewL(CSubConParameterFamily& aFamily, CSubConParameterFamily::TParameterSetType aType)
       
   170 /** Creates a generic RTP family parameters sub-connection.
       
   171 
       
   172 @param aFamily parameter sets.
       
   173 @param aType parameter type (Requested/Acceptable/Granted) 
       
   174 @return a CSubConRTPGenericParamSet object pointer if successful,
       
   175 otherwise leaves with system error code.
       
   176 */
       
   177 	{
       
   178 	CSubConRTPGenericParamSet* obj = NewL();
       
   179 	CleanupStack::PushL(obj);
       
   180 	aFamily.SetGenericSetL(*obj, aType);
       
   181 	CleanupStack::Pop(obj);
       
   182 	return obj;
       
   183 	}
       
   184 
       
   185 CSubConRTPGenericParamSet* CSubConRTPGenericParamSet::NewL()
       
   186 /** Creates a generic RTP family parameters sub-connection.
       
   187 
       
   188 @return a CSubConRTPGenericParamSet object pointer if successful,
       
   189 otherwise leaves with system error code.
       
   190 */
       
   191 	{
       
   192 	STypeId typeId = STypeId::CreateSTypeId(CSubConRTPParamFactory::iUid, KSubConnRTPGenericParamsType);
       
   193 	return static_cast<CSubConRTPGenericParamSet*>(CSubConParameterSet::NewL(typeId));
       
   194 	}
       
   195 
       
   196 #endif	// __RTP_SUBCONPARAMS_H__