mmmw_plat/openmax_al_api/tsrc/openmaxaltestmodule/src/engine/openmaxalaudioencodercapabiltiesitftests.cpp
changeset 14 80975da52420
child 53 eabc8c503852
equal deleted inserted replaced
12:5a06f39ad45b 14:80975da52420
       
     1 /*
       
     2 * Copyright (c) 2009 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: This file contains testclass implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // [INCLUDE FILES] - do not remove
       
    19 #include <e32svr.h>
       
    20 #include <StifParser.h>
       
    21 #include <StifTestInterface.h>
       
    22 #include "openmaxaltestmodule.h"
       
    23 
       
    24 // EXTERNAL DATA STRUCTURES
       
    25 //extern  ?external_data;
       
    26 
       
    27 // EXTERNAL FUNCTION PROTOTYPES  
       
    28 //extern ?external_function( ?arg_type,?arg_type );
       
    29 
       
    30 // CONSTANTS
       
    31 //const ?type ?constant_var = ?constant;
       
    32 
       
    33 // MACROS
       
    34 //#define ?macro ?macro_def
       
    35 
       
    36 // LOCAL CONSTANTS AND MACROS
       
    37 //const ?type ?constant_var = ?constant;
       
    38 //#define ?macro_name ?macro_def
       
    39 
       
    40 // MODULE DATA STRUCTURES
       
    41 //enum ?declaration
       
    42 //typedef ?declaration
       
    43 
       
    44 // LOCAL FUNCTION PROTOTYPES
       
    45 //?type ?function_name( ?arg_type, ?arg_type );
       
    46 
       
    47 // FORWARD DECLARATIONS
       
    48 //class ?FORWARD_CLASSNAME;
       
    49 
       
    50 // ============================= LOCAL FUNCTIONS ===============================
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // ?function_name ?description.
       
    54 // ?description
       
    55 // Returns: ?value_1: ?description
       
    56 //          ?value_n: ?description_line1
       
    57 //                    ?description_line2
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 /*
       
    61 ?type ?function_name(
       
    62     ?arg_type arg,  // ?description
       
    63     ?arg_type arg)  // ?description
       
    64     {
       
    65 
       
    66     ?code  // ?comment
       
    67 
       
    68     // ?comment
       
    69     ?code
       
    70     }
       
    71 */
       
    72 
       
    73 TInt COpenMAXALTestModule::al_audioencodercapitf_GetAudioEncoders( CStifItemParser& aItem )
       
    74     {
       
    75     TInt status(KErrNone);
       
    76     TInt numEncoders(0);
       
    77     XAuint32 deviceIdArr[4];
       
    78     XAresult res;
       
    79     XAuint32 numEnc(0);
       
    80     
       
    81     status = aItem.GetNextInt(numEncoders);
       
    82     if(!status)
       
    83         {
       
    84         numEnc = numEncoders;
       
    85         if(m_AEncCapItf)
       
    86             {
       
    87             res = (*m_AEncCapItf)->GetAudioEncoders(
       
    88                     m_AEncCapItf, &numEnc, deviceIdArr);
       
    89             status = res;
       
    90             }
       
    91         else
       
    92             {
       
    93             status = KErrNotFound;
       
    94             }            
       
    95         }
       
    96     else
       
    97         {
       
    98         if(m_AEncCapItf)
       
    99             {
       
   100             res = (*m_AEncCapItf)->GetAudioEncoders(
       
   101                     m_AEncCapItf, &numEnc, NULL);
       
   102             status = res;
       
   103             }
       
   104         else
       
   105             {
       
   106             status = KErrNotFound;
       
   107             }            
       
   108         }
       
   109     return status;
       
   110     }
       
   111 
       
   112 TInt COpenMAXALTestModule::al_audioencodercapitf_GetAudioEncoderCapabilities( CStifItemParser& aItem )
       
   113     {
       
   114     TInt status(KErrNone);
       
   115     TInt encId(0);
       
   116     XAuint32 encoderid(0);
       
   117     XAuint32 index(0);
       
   118     XAAudioCodecDescriptor desc;
       
   119     XAresult res;
       
   120     
       
   121     status = aItem.GetNextInt(encId);
       
   122     if(!status)
       
   123         {
       
   124         encoderid = encId;
       
   125         if(m_AEncCapItf)
       
   126             {
       
   127             res = (*m_AEncCapItf)->GetAudioEncoderCapabilities(
       
   128                     m_AEncCapItf, encoderid, &index, &desc);
       
   129             status = res;
       
   130             }
       
   131         else
       
   132             {
       
   133             status = KErrNotFound;
       
   134             }                
       
   135         }
       
   136     return status;
       
   137     }