|
1 /* |
|
2 * Copyright (c) 2004 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: Class definition for CTestAppConsole |
|
15 ** |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __TESTAPPCONSOLE_H |
|
21 #define __TESTAPPCONSOLE_H |
|
22 |
|
23 #include <e32cons.h> |
|
24 |
|
25 #include "TestConsoleDef.h" |
|
26 #include "MccJitterBuffer.h" |
|
27 //#include <MmccInterface.h> |
|
28 //#include <MmccCodecInformation.h> |
|
29 //#include <Mccdef.h> |
|
30 |
|
31 |
|
32 class TTimeIntervalMicroSeconds32; |
|
33 #define KTestUid 0x0 |
|
34 |
|
35 const TUint32 KMCCFourCCIdAMRNB = 1380794656; |
|
36 const TUint32 KMCCFourCCIdG711 = 825308999; |
|
37 |
|
38 const TUid KTestApp = { KTestUid }; |
|
39 _LIT(KMainTitle," MCC Console "); |
|
40 |
|
41 class CTestAppConsole : public CActive, MDataSink, MDataSource |
|
42 { |
|
43 public: |
|
44 static CTestAppConsole* NewL(); |
|
45 virtual ~CTestAppConsole(); |
|
46 |
|
47 void StartTesting(); |
|
48 void DisplayMsg(const TDesC& aMsg); |
|
49 |
|
50 private: |
|
51 CTestAppConsole( ); |
|
52 void ConstructL(); |
|
53 |
|
54 void RunL(); |
|
55 void DoCancel(); |
|
56 |
|
57 void ProcessMainInput(); |
|
58 |
|
59 // create console menus |
|
60 void DisplayConsoleMenu(const TDesC& aInstructions); |
|
61 TKeyCode GetStringFromConsole(TDes& aAddr); |
|
62 |
|
63 void DoRead(); |
|
64 |
|
65 void GenerateRandomSourceData( TDes8& aToBuffer ); |
|
66 void PrintBuffer( TDes8& aPayload ); |
|
67 void SetSeqNum(); |
|
68 //Test functions |
|
69 void RunTestFillBuffer(); |
|
70 void RunTestEmptyBuffer(); |
|
71 void RunTestSetupJitterbuffer(); |
|
72 |
|
73 // MDataSink |
|
74 TFourCC SinkDataTypeCode( TMediaId /*aMediaId*/ ); |
|
75 TBool CanCreateSinkBuffer(); |
|
76 CMMFBuffer* CreateSinkBufferL( TMediaId /*aMediaId*/, TBool& /*aReference*/ ); |
|
77 void EmptyBufferL( CMMFBuffer* aBuffer, MDataSource* aSupplier, |
|
78 TMediaId /*aMediaId*/); |
|
79 void BufferFilledL( CMMFBuffer* aBuffer ); |
|
80 void ConstructSinkL( const TDesC8& /*aInitData*/ ); |
|
81 |
|
82 // MDataSource |
|
83 TInt SetSourceDataTypeCode( TFourCC /*aCodec*/, TMediaId /*aMedia*/ ); |
|
84 TFourCC SourceDataTypeCode( TMediaId /*aMediaId*/ ); |
|
85 void FillBufferL( CMMFBuffer* aBuffer, |
|
86 MDataSink* aConsumer, |
|
87 TMediaId /*aMediaId*/ ); |
|
88 void BufferEmptiedL( CMMFBuffer* aBuffer ); |
|
89 // CMMFBuffer* CreateSinkBufferL( TMediaId /*aMediaId*/, TBool& /*aReference*/ ); |
|
90 CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &/*aReference*/); |
|
91 void ConstructSourceL( const TDesC8& /*aInitData*/ ); |
|
92 TBool CanCreateSourceBuffer(); |
|
93 |
|
94 |
|
95 private: |
|
96 |
|
97 CConsoleBase* iConsole; |
|
98 |
|
99 HBufC* iInstruct; |
|
100 //TRtpId iSessionId; |
|
101 //TInt streamID, streamID2; |
|
102 |
|
103 //CMCCInterface* iMccInterface; |
|
104 CMccJitterBuffer* iJitterBuffer; |
|
105 //TInetAddr iRemoteAddr; |
|
106 |
|
107 //RPointerArray<CMCCCodecInformation> iCodecArray; |
|
108 TUint32 iCodec; |
|
109 TInt iSeqNum; |
|
110 }; |
|
111 |
|
112 |
|
113 #endif __TESTAPPCONSOLE_H |