rtp/rtpstack/tsrc/rtptestapp/src/rtptestapp.h
changeset 29 5f12516512fa
equal deleted inserted replaced
23:8798b8c7bbfb 29:5f12516512fa
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 /*
       
     3 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     4 * All rights reserved.
       
     5 * This component and the accompanying materials are made available
       
     6 * under the terms of "Eclipse Public License v1.0"
       
     7 * which accompanies this distribution, and is available
       
     8 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 *
       
    10 * Initial Contributors:
       
    11 * Nokia Corporation - initial contribution.
       
    12 *
       
    13 * Contributors:
       
    14 *
       
    15 * Description: Header for class specific to rtp functional tests
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __RTPTESTAPP_H
       
    22 #define __RTPTESTAPP_H
       
    23 
       
    24 #include "rtpapi.h"
       
    25 
       
    26 
       
    27 // Class Declaration
       
    28 class CRtpTestApp : public CBase, public MRtpErrNotify, public MRtcpObserver, public MRtpObserver, public MRtpPostProcessingObserver
       
    29 	{
       
    30 public:
       
    31     
       
    32     static CRtpTestApp*  NewL();
       
    33         
       
    34     void ConstructL();
       
    35     
       
    36     void SendRtpPacketL();
       
    37     
       
    38     void SendRtpPacketLoopbackL();
       
    39     
       
    40     void SendZeroLengthRtpPacketL();
       
    41     
       
    42 	~CRtpTestApp();
       
    43 	
       
    44 	//From observer interface
       
    45     void ErrorNotify( TInt aErrCode ) ;
       
    46     
       
    47     // from MRtcpObserver
       
    48 
       
    49     void SdesReceived( TRtpSSRC aSSRC,
       
    50                        const TRtpSdesParams& aParams );
       
    51 
       
    52     void ByeReceived( TRtpId aStreamId, TRtpSSRC aSSRC,
       
    53                       const TDesC8& aReason );
       
    54 
       
    55     void AppReceived( TRtpId aStreamId, TRtpSSRC aSSRC,
       
    56                       const TRtcpApp& aApp );
       
    57 
       
    58     void SrReceived( TRtpId aStreamId, TRtpSSRC aSSRC,
       
    59                      const TTimeStamps& aTimeStamps );
       
    60 
       
    61     void RrReceived( TRtpId aStreamId, TRtpSSRC aSSRC );
       
    62     
       
    63     // From MRtpObserver
       
    64     void RtpPacketReceived( TRtpId aStreamId, const TRtpRecvHeader& aHeaderInfo, const TDesC8& aPayloadData );
       
    65     
       
    66     // From MRtpPostProcessingObserver
       
    67      
       
    68     void ReadyToSendRtpPacket( TRtpId aTranStreamId, TPtr8 &aPacket );
       
    69         
       
    70 	
       
    71 	TInt iError;
       
    72 	TBool iIgnoreIncrease;
       
    73 
       
    74 	private:
       
    75     CRtpTestApp();
       
    76 	CRtpAPI* iRtpApi ;
       
    77     
       
    78     TRtpSdesParams iParams;
       
    79     TCreateSessionParams iSessionParams;
       
    80     TBool       iEnableRtcp;
       
    81     TRtcpParams iRtcpParams;
       
    82     TRtpId iSessionId1;
       
    83     TRtpId iSessionId2;  
       
    84     TUint iPort1;
       
    85     TUint iPort2;
       
    86     CArrayFixFlat<TUint32>* iCsrclist;
       
    87     TInt iNoOfRtpPackets;
       
    88     TRtpId iS1T1;
       
    89     TRtpId iS2R1;
       
    90 	};
       
    91 
       
    92 
       
    93 class CrtpDataSender: public CActive
       
    94     {
       
    95 public:
       
    96     static CrtpDataSender* NewL(CRtpAPI* aRtpApi, TRtpId sessId)
       
    97         {
       
    98         CrtpDataSender *pSelf = new(ELeave) CrtpDataSender();
       
    99         pSelf->iRtpApi = aRtpApi;
       
   100         pSelf->iSessId = sessId;
       
   101         return pSelf;
       
   102         }
       
   103     
       
   104     virtual void DoCancel()
       
   105         {
       
   106         iRtpApi->CancelSend(iSessId);
       
   107         }
       
   108     
       
   109     void RunL();
       
   110     
       
   111     void SendRtpData( TRtpSendPktParams& aHeaderInfo , TArray<TRtpCSRC> aCSRCList)
       
   112         {
       
   113         aHeaderInfo.iStatus = &iStatus;
       
   114         iRtpApi->SendRtpPacket(aHeaderInfo, aCSRCList);
       
   115         SetActive();
       
   116         }
       
   117 private:
       
   118     CrtpDataSender():CActive(EPriorityStandard)
       
   119         {
       
   120         CActiveScheduler::Add(this);
       
   121         }
       
   122     CRtpAPI *iRtpApi;
       
   123     TRtpId  iSessId;
       
   124     };
       
   125 
       
   126 #endif
       
   127 
       
   128