sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "teststepciadvancedaacencodesettings.h"
|
sl@0
|
17 |
#include "cidefine.h"
|
sl@0
|
18 |
|
sl@0
|
19 |
/*****************************************************************************/
|
sl@0
|
20 |
CTestStepCICreateAdvancedAacEncodeSettings::CTestStepCICreateAdvancedAacEncodeSettings()
|
sl@0
|
21 |
{
|
sl@0
|
22 |
iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0006-HP");
|
sl@0
|
23 |
}
|
sl@0
|
24 |
|
sl@0
|
25 |
/*****************************************************************************/
|
sl@0
|
26 |
TVerdict CTestStepCICreateAdvancedAacEncodeSettings::DoTestStepL()
|
sl@0
|
27 |
{
|
sl@0
|
28 |
iTestStepResult = EFail;
|
sl@0
|
29 |
|
sl@0
|
30 |
INFO_PRINTF1(_L("Initializing test CI device"));
|
sl@0
|
31 |
|
sl@0
|
32 |
//Initialize - with the UID of our test HwDevice
|
sl@0
|
33 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
sl@0
|
34 |
TUid testUID = {KUidAdvancedAacEncodeSettingsTestDevice};
|
sl@0
|
35 |
#else
|
sl@0
|
36 |
TFourCC testUID('T','0','0','5');
|
sl@0
|
37 |
#endif
|
sl@0
|
38 |
|
sl@0
|
39 |
MMMFAdvancedAACEncodeSettings* interface = NULL;
|
sl@0
|
40 |
interface = static_cast<MMMFAdvancedAACEncodeSettings*>(
|
sl@0
|
41 |
InitializeAndInstantiateInterfaceL(testUID, KUidAdvancedAACEncoderSettings));
|
sl@0
|
42 |
|
sl@0
|
43 |
if (interface)
|
sl@0
|
44 |
{
|
sl@0
|
45 |
iTestStepResult = EPass;
|
sl@0
|
46 |
INFO_PRINTF1(_L("Successfully retrieved the interface."));
|
sl@0
|
47 |
}
|
sl@0
|
48 |
else
|
sl@0
|
49 |
{
|
sl@0
|
50 |
iTestStepResult = EFail;
|
sl@0
|
51 |
ERR_PRINTF1(_L("Failed to retrieve the interface"));
|
sl@0
|
52 |
}
|
sl@0
|
53 |
|
sl@0
|
54 |
return iTestStepResult;
|
sl@0
|
55 |
}
|
sl@0
|
56 |
|
sl@0
|
57 |
/*****************************************************************************/
|
sl@0
|
58 |
CTestStepCIAdvancedAacEncodeSettings::CTestStepCIAdvancedAacEncodeSettings(TBool aIsGetTest)
|
sl@0
|
59 |
: iIsGetTest(aIsGetTest)
|
sl@0
|
60 |
{
|
sl@0
|
61 |
if (iIsGetTest)
|
sl@0
|
62 |
{
|
sl@0
|
63 |
iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0099-HP");
|
sl@0
|
64 |
}
|
sl@0
|
65 |
else
|
sl@0
|
66 |
{
|
sl@0
|
67 |
iTestStepName = _L("MM-MMF-DEVSOUNDCI-U-0007-HP");
|
sl@0
|
68 |
}
|
sl@0
|
69 |
}
|
sl@0
|
70 |
|
sl@0
|
71 |
/*****************************************************************************/
|
sl@0
|
72 |
TVerdict CTestStepCIAdvancedAacEncodeSettings::DoTestStepL()
|
sl@0
|
73 |
{
|
sl@0
|
74 |
iTestStepResult = EFail;
|
sl@0
|
75 |
|
sl@0
|
76 |
INFO_PRINTF1(_L("Initializing test CI device"));
|
sl@0
|
77 |
|
sl@0
|
78 |
//Initialize - with the UID of our test HwDevice
|
sl@0
|
79 |
#ifndef SYMBIAN_MULTIMEDIA_A3FDEVSOUND
|
sl@0
|
80 |
TUid testUID = {KUidAdvancedAacEncodeSettingsTestDevice};
|
sl@0
|
81 |
#else
|
sl@0
|
82 |
TFourCC testUID('T','0','0','5');
|
sl@0
|
83 |
#endif
|
sl@0
|
84 |
|
sl@0
|
85 |
MMMFAdvancedAACEncodeSettings* interface = NULL;
|
sl@0
|
86 |
interface = static_cast<MMMFAdvancedAACEncodeSettings*>(
|
sl@0
|
87 |
InitializeAndInstantiateInterfaceL(testUID, KUidAdvancedAACEncoderSettings));
|
sl@0
|
88 |
|
sl@0
|
89 |
if (interface)
|
sl@0
|
90 |
{
|
sl@0
|
91 |
MMMFAdvancedAACEncodeSettings::TAACBitrateMode bitrateMode = MMMFAdvancedAACEncodeSettings::EAACBitrateModeFixed;
|
sl@0
|
92 |
INFO_PRINTF1(_L("Calling test CI method"));
|
sl@0
|
93 |
TInt err = interface->SetAACEncodeBitrateMode(bitrateMode);
|
sl@0
|
94 |
|
sl@0
|
95 |
if (iIsGetTest)
|
sl@0
|
96 |
{
|
sl@0
|
97 |
INFO_PRINTF1(_L("Testing GetAACEncodeBitrateMode"));
|
sl@0
|
98 |
}
|
sl@0
|
99 |
else
|
sl@0
|
100 |
{
|
sl@0
|
101 |
INFO_PRINTF1(_L("Testing SetAACEncodeBitrateMode"));
|
sl@0
|
102 |
}
|
sl@0
|
103 |
|
sl@0
|
104 |
if (err == KErrNone)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
// Successfully set the mode
|
sl@0
|
107 |
INFO_PRINTF1(_L("Set the mode successfully"));
|
sl@0
|
108 |
|
sl@0
|
109 |
MMMFAdvancedAACEncodeSettings::TAACBitrateMode testMode;
|
sl@0
|
110 |
|
sl@0
|
111 |
err = interface->GetAACEncodeBitrateMode(testMode);
|
sl@0
|
112 |
|
sl@0
|
113 |
iTestStepResult = EFail;
|
sl@0
|
114 |
if ((err == KErrNone) && (testMode == bitrateMode))
|
sl@0
|
115 |
{
|
sl@0
|
116 |
INFO_PRINTF1(_L("Test CI method call was successful"));
|
sl@0
|
117 |
iTestStepResult = EPass;
|
sl@0
|
118 |
}
|
sl@0
|
119 |
else
|
sl@0
|
120 |
{
|
sl@0
|
121 |
ERR_PRINTF4(_L("Test CI method failed, error: %d, expected value: %d, actual value: %d"), \
|
sl@0
|
122 |
err, bitrateMode, testMode);
|
sl@0
|
123 |
}
|
sl@0
|
124 |
}
|
sl@0
|
125 |
else
|
sl@0
|
126 |
{
|
sl@0
|
127 |
ERR_PRINTF2(_L("Test CI method failed, error"), err);
|
sl@0
|
128 |
}
|
sl@0
|
129 |
}
|
sl@0
|
130 |
else
|
sl@0
|
131 |
{
|
sl@0
|
132 |
WARN_PRINTF1(_L("Failed to retrieve the custom interface."));
|
sl@0
|
133 |
iTestStepResult = EInconclusive;
|
sl@0
|
134 |
}
|
sl@0
|
135 |
|
sl@0
|
136 |
return iTestStepResult;
|
sl@0
|
137 |
}
|