khronosfws/openmax_al/src/mmf_adaptation/xammfcapabilitiesmgr.c
changeset 25 6f7ceef7b1d1
parent 19 4a629bc82c5e
child 33 5e8b14bae8c3
equal deleted inserted replaced
21:2ed61feeead6 25:6f7ceef7b1d1
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:
    14  * Description: MMF capabilities mgr
    15 *
    15  *
    16 */
    16  */
    17 #include "xammfcapabilitiesmgr.h"
       
    18 #include <stdio.h>
    17 #include <stdio.h>
    19 #include <string.h>
    18 #include <string.h>
    20 
    19 #include "xammfcapabilitiesmgr.h"
    21 static XAresult XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(XACapabilities **ppNode);
    20 
    22 static XAresult XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(XACapabilities **ppNode);
    21 static XAresult XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(
    23 static XAresult XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(XACapabilities **ppNode);
    22         XACapabilities **ppNode);
       
    23 static XAresult XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(
       
    24         XACapabilities **ppNode);
       
    25 static XAresult XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(
       
    26         XACapabilities **ppNode);
    24 
    27 
    25 /* XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList
    28 /* XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList
    26  * Description: Update the capabilities list supported by GStreamer framework.
    29  * Description: Update the capabilities list supported by GStreamer framework.
    27  */
    30  */
    28 XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList(
    31 XAresult XAMMFCapabilitiesMgr_UpdateCapabilitieList(
    29                 FrameworkMap *frameworkMap,
    32         FrameworkMap *frameworkMap, XACapabilities **ppListHead)
    30                 XACapabilities **ppListHead)
    33 
    31 
    34     {
    32 {
       
    33     XAresult res = XA_RESULT_SUCCESS;
    35     XAresult res = XA_RESULT_SUCCESS;
    34     XACapabilities *lastNode;
    36     XACapabilities *lastNode;
    35     XACapabilities *firstNode;
    37     XACapabilities *firstNode;
    36     XACapabilities *newNode = NULL;
    38     XACapabilities *newNode = NULL;
    37     FWMgrFwType fwtype = FWMgrFWUknown;
    39     FWMgrFwType fwtype = FWMgrFWUknown;
    38     char *uri = NULL;
    40     char *uri = NULL;
    39     DEBUG_API("->XAGSTCapabilitiesMgr_UpdateCapabilitieList");
    41     DEBUG_API("->XAGSTCapabilitiesMgr_UpdateCapabilitieList");
    40 
    42 
    41     if(!frameworkMap || !ppListHead)
    43     if (!frameworkMap || !ppListHead)
    42     {
    44         {
    43         res = XA_RESULT_PARAMETER_INVALID;
    45         res = XA_RESULT_PARAMETER_INVALID;
    44         return res;
    46         return res;
    45     }
    47         }
    46 
    48 
    47     lastNode = firstNode = *ppListHead;
    49     lastNode = firstNode = *ppListHead;
    48     
    50 
    49     /* traverse and point to the last node in the list */
    51     /* traverse and point to the last node in the list */
    50     while(lastNode && lastNode->next)
    52     while (lastNode && lastNode->next)
    51     {
    53         {
    52         lastNode = lastNode->next;
    54         lastNode = lastNode->next;
    53     }
    55         }
    54 
    56 
    55     uri = "file:///c:/test.mp4";
    57     uri = "file:///c:/test.mp4";
    56     fwtype = XAFrameworkMgr_GetFramework(
    58     fwtype = XAFrameworkMgr_GetFramework(frameworkMap, uri, FWMgrMORecorder);
    57             frameworkMap,
    59 
    58             uri,
    60     if (fwtype == FWMgrFWMMF)
    59             FWMgrMORecorder);
    61         {
    60     
       
    61     if(fwtype == FWMgrFWMMF)
       
    62     {
       
    63         /* Add codec capabilities */
    62         /* Add codec capabilities */
    64         newNode = NULL;
    63         newNode = NULL;
    65         res = XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(&newNode);
    64         res = XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(&newNode);
    66         if (res != XA_RESULT_SUCCESS)
    65         if (res != XA_RESULT_SUCCESS)
    67             {
    66             {
    68             return res;
    67             return res;
    69             }
    68             }
    70         if (lastNode)
    69         if (lastNode)
    71         {
    70             {
    72             lastNode->next = newNode;
    71             lastNode->next = newNode;
    73         }
    72             }
    74         if (newNode)
    73         if (newNode)
    75         { /* if a new node is created move lastNode to the new item */
    74             { /* if a new node is created move lastNode to the new item */
    76             if (!firstNode)
    75             if (!firstNode)
       
    76                 {
    77                 firstNode = newNode;
    77                 firstNode = newNode;
       
    78                 }
    78             lastNode = newNode;
    79             lastNode = newNode;
    79         }
    80             }
    80     }
    81         }
    81     
       
    82 
    82 
    83     uri = "file:///c:/test.amr";
    83     uri = "file:///c:/test.amr";
    84     fwtype = XAFrameworkMgr_GetFramework(
    84     fwtype = XAFrameworkMgr_GetFramework(frameworkMap, uri, FWMgrMORecorder);
    85             frameworkMap,
    85 
    86             uri,
    86     if (fwtype == FWMgrFWMMF)
    87             FWMgrMORecorder);
    87         {
    88     
       
    89     if(fwtype == FWMgrFWMMF)
       
    90     {
       
    91         newNode = NULL;
    88         newNode = NULL;
    92         res = XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(&newNode);
    89         res = XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(&newNode);
    93         if (res != XA_RESULT_SUCCESS)
    90         if (res != XA_RESULT_SUCCESS)
    94             {
    91             {
    95             return res;
    92             return res;
    96             }
    93             }
    97         if (lastNode)
    94         if (lastNode)
    98         {
    95             {
    99             lastNode->next = newNode;
    96             lastNode->next = newNode;
   100         }
    97             }
   101         if (newNode)
    98         if (newNode)
   102         { /* if a new node is created move lastNode to the new item */
    99             { /* if a new node is created move lastNode to the new item */
   103             if (!firstNode)
   100             if (!firstNode)
       
   101                 {
   104                 firstNode = newNode;
   102                 firstNode = newNode;
       
   103                 }
   105             lastNode = newNode;
   104             lastNode = newNode;
   106         }
   105             }
   107     }
   106         }
   108 
   107 
   109     uri = "file:///c:/test.wav";
   108     uri = "file:///c:/test.wav";
   110     fwtype = XAFrameworkMgr_GetFramework(
   109     fwtype = XAFrameworkMgr_GetFramework(frameworkMap, uri, FWMgrMORecorder);
   111             frameworkMap,
   110 
   112             uri,
   111     if (fwtype == FWMgrFWMMF)
   113             FWMgrMORecorder);
   112         {
   114     
       
   115     if(fwtype == FWMgrFWMMF)
       
   116     {
       
   117         newNode = NULL;
   113         newNode = NULL;
   118         res = XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(&newNode);
   114         res = XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(&newNode);
   119         if (res != XA_RESULT_SUCCESS)
   115         if (res != XA_RESULT_SUCCESS)
   120             {
   116             {
   121             return res;
   117             return res;
   122             }
   118             }
   123         if (lastNode)
   119         if (lastNode)
   124         {
   120             {
   125             lastNode->next = newNode;
   121             lastNode->next = newNode;
   126         }
   122             }
   127         if (newNode)
   123         if (newNode)
   128         { /* if a new node is created move lastNode to the new item */
   124             { /* if a new node is created move lastNode to the new item */
   129             if (!firstNode)
   125             if (!firstNode)
       
   126                 {
   130                 firstNode = newNode;
   127                 firstNode = newNode;
       
   128                 }
   131             lastNode = newNode;
   129             lastNode = newNode;
   132         }
   130             }
   133     }
   131         }
   134     /* if empty list, then append first node as the head */
   132     /* if empty list, then append first node as the head */
   135     if (!(*ppListHead))
   133     if (!(*ppListHead))
   136         {
   134         {
   137         *ppListHead = firstNode;
   135         *ppListHead = firstNode;
   138         }
   136         }DEBUG_API("<-XAGSTCapabilitiesMgr_UpdateCapabilitieList");
   139     DEBUG_API("<-XAGSTCapabilitiesMgr_UpdateCapabilitieList");
       
   140     return res;
   137     return res;
   141 }
   138     }
   142 
   139 
   143 
   140 XAresult XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(
   144 XAresult XAMMFCapabilitiesMgr_GetAudioAACEncoderCapabilities(XACapabilities **ppNode)
   141         XACapabilities **ppNode)
   145 {
   142     {
   146     XAresult res = XA_RESULT_SUCCESS;
   143     XAresult res = XA_RESULT_SUCCESS;
   147     XACapabilities *newNode = NULL;
   144     XACapabilities *newNode = NULL;
   148     XAAudioCodecDescriptor *entries = NULL;
   145     XAAudioCodecDescriptor *entries = NULL;
   149 
   146 
   150     newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
   147     newNode = (XACapabilities *) calloc(1, sizeof(XACapabilities));
   151     if (!newNode)
   148     if (!newNode)
   152     {
   149         {
   153         res = XA_RESULT_MEMORY_FAILURE;
   150         res = XA_RESULT_MEMORY_FAILURE;
   154         return res;
   151         return res;
   155     }
   152         }
   156 
   153 
   157     newNode->capsType = AUD_E;
   154     newNode->capsType = AUD_E;
   158     newNode->xaid = XA_AUDIOCODEC_AAC;
   155     newNode->xaid = XA_AUDIOCODEC_AAC;
   159     newNode->noOfEntries = 1;
   156     newNode->noOfEntries = 1;
   160 
   157 
   161     /* Allocate array */
   158     /* Allocate array */
   162     entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
   159     entries = (XAAudioCodecDescriptor*) calloc(1,
       
   160             sizeof(XAAudioCodecDescriptor));
   163     if (!entries)
   161     if (!entries)
   164     {
   162         {
   165         res = XA_RESULT_MEMORY_FAILURE;
   163         res = XA_RESULT_MEMORY_FAILURE;
   166         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   164         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   167         return res;
   165         return res;
   168     }
   166         }
   169 
   167 
   170     newNode->pEntry = (void*)entries;
   168     newNode->pEntry = (void*) entries;
   171  
   169 
   172     entries->maxChannels = 2;
   170     entries->maxChannels = 2;
   173     entries->minBitsPerSample = 16;
   171     entries->minBitsPerSample = 16;
   174     entries->maxBitsPerSample = 16;
   172     entries->maxBitsPerSample = 16;
   175     entries->minSampleRate = 8000000;  /*milliHz*/
   173     entries->minSampleRate = 8000000; /*milliHz*/
   176     entries->maxSampleRate = 48000000;
   174     entries->maxSampleRate = 48000000;
   177     entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
   175     entries->isFreqRangeContinuous = XA_BOOLEAN_FALSE;
   178     entries->numSampleRatesSupported = 7;
   176     entries->numSampleRatesSupported = 7;
   179     entries->pSampleRatesSupported = (XAmilliHertz*)calloc(entries->numSampleRatesSupported, sizeof(XAmilliHertz));
   177     entries->pSampleRatesSupported = (XAmilliHertz*) calloc(
       
   178             entries->numSampleRatesSupported, sizeof(XAmilliHertz));
   180     if (!entries->pSampleRatesSupported)
   179     if (!entries->pSampleRatesSupported)
   181     {
   180         {
   182         res = XA_RESULT_MEMORY_FAILURE;
   181         res = XA_RESULT_MEMORY_FAILURE;
   183         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   182         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   184         return res;
   183         return res;
   185     }
   184         }
   186     /* entries in milliHz */
   185     /* entries in milliHz */
   187     entries->pSampleRatesSupported[0] = 8000000;
   186     entries->pSampleRatesSupported[0] = 8000000;
   188     entries->pSampleRatesSupported[1] = 11025000;
   187     entries->pSampleRatesSupported[1] = 11025000;
   189     entries->pSampleRatesSupported[2] = 16000000;
   188     entries->pSampleRatesSupported[2] = 16000000;
   190     entries->pSampleRatesSupported[3] = 22050000;
   189     entries->pSampleRatesSupported[3] = 22050000;
   194 
   193 
   195     entries->minBitRate = 32000;
   194     entries->minBitRate = 32000;
   196     entries->maxBitRate = 256000;
   195     entries->maxBitRate = 256000;
   197     entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
   196     entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
   198     entries->numBitratesSupported = 8;
   197     entries->numBitratesSupported = 8;
   199     entries->pBitratesSupported = (XAuint32*)calloc(entries->numBitratesSupported, sizeof(XAuint32));
   198     entries->pBitratesSupported = (XAuint32*) calloc(
       
   199             entries->numBitratesSupported, sizeof(XAuint32));
   200     if (!entries->pBitratesSupported)
   200     if (!entries->pBitratesSupported)
   201     {
   201         {
   202         res = XA_RESULT_MEMORY_FAILURE;
   202         res = XA_RESULT_MEMORY_FAILURE;
   203         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   203         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   204         return res;
   204         return res;
   205     }
   205         }
   206     (entries->pBitratesSupported)[0] = 32000;
   206     (entries->pBitratesSupported)[0] = 32000;
   207     (entries->pBitratesSupported)[1] = 64000;
   207     (entries->pBitratesSupported)[1] = 64000;
   208     (entries->pBitratesSupported)[2] = 96000;
   208     (entries->pBitratesSupported)[2] = 96000;
   209     (entries->pBitratesSupported)[3] = 128000;
   209     (entries->pBitratesSupported)[3] = 128000;
   210     (entries->pBitratesSupported)[4] = 160000;
   210     (entries->pBitratesSupported)[4] = 160000;
   213     (entries->pBitratesSupported)[7] = 256000;
   213     (entries->pBitratesSupported)[7] = 256000;
   214 
   214 
   215     entries->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
   215     entries->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
   216     entries->modeSetting = XA_AUDIOMODE_AAC_LC;
   216     entries->modeSetting = XA_AUDIOMODE_AAC_LC;
   217 
   217 
   218     newNode->pEntry = (void*)entries;
       
   219 
       
   220     *ppNode = newNode;
   218     *ppNode = newNode;
   221     return res;
   219     return res;
   222 }
   220     }
   223 
   221 
   224 XAresult XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(XACapabilities **ppNode)
   222 XAresult XAMMFCapabilitiesMgr_GetAudioAMREncoderCapabilities(
   225 {
   223         XACapabilities **ppNode)
       
   224     {
   226     XAresult res = XA_RESULT_SUCCESS;
   225     XAresult res = XA_RESULT_SUCCESS;
   227     XACapabilities *newNode = NULL;
   226     XACapabilities *newNode = NULL;
   228     XAAudioCodecDescriptor *entries = NULL;
   227     XAAudioCodecDescriptor *entries = NULL;
   229  
   228 
   230     newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
   229     newNode = (XACapabilities *) calloc(1, sizeof(XACapabilities));
   231     if (!newNode)
   230     if (!newNode)
   232     {
   231         {
   233         res = XA_RESULT_MEMORY_FAILURE;
   232         res = XA_RESULT_MEMORY_FAILURE;
   234         return res;
   233         return res;
   235     }
   234         }
   236 
   235 
   237     newNode->capsType = AUD_E;
   236     newNode->capsType = AUD_E;
   238     newNode->xaid = XA_AUDIOCODEC_AMR;
   237     newNode->xaid = XA_AUDIOCODEC_AMR;
   239     newNode->noOfEntries = 1;
   238     newNode->noOfEntries = 1;
   240 
   239 
   241     /* Allocate array */
   240     /* Allocate array */
   242     entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
   241     entries = (XAAudioCodecDescriptor*) calloc(1,
       
   242             sizeof(XAAudioCodecDescriptor));
   243     if (!entries)
   243     if (!entries)
   244     {
   244         {
   245         res = XA_RESULT_MEMORY_FAILURE;
   245         res = XA_RESULT_MEMORY_FAILURE;
   246         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   246         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   247         return res;
   247         return res;
   248     }
   248         }
   249 
   249 
   250     newNode->pEntry = (void*)entries;
   250     newNode->pEntry = (void*) entries;
   251  
   251 
   252     entries->maxChannels = 1;
   252     entries->maxChannels = 1;
   253     entries->minBitsPerSample = 8;
   253     entries->minBitsPerSample = 8;
   254     entries->maxBitsPerSample = 8;
   254     entries->maxBitsPerSample = 8;
   255     entries->minSampleRate = 8000000;  /*milliHz*/
   255     entries->minSampleRate = 8000000; /*milliHz*/
   256     entries->maxSampleRate = 8000000;
   256     entries->maxSampleRate = 8000000;
   257     entries->isFreqRangeContinuous=XA_BOOLEAN_TRUE;
   257     entries->isFreqRangeContinuous = XA_BOOLEAN_TRUE;
   258     entries->numSampleRatesSupported = 1;
   258     entries->numSampleRatesSupported = 1;
   259     entries->minBitRate=4750;
   259     entries->minBitRate = 4750;
   260     entries->maxBitRate=12200;
   260     entries->maxBitRate = 12200;
   261     entries->isBitrateRangeContinuous=XA_BOOLEAN_FALSE;
   261     entries->isBitrateRangeContinuous = XA_BOOLEAN_FALSE;
   262     entries->numBitratesSupported = 8;
   262     entries->numBitratesSupported = 8;
   263     entries->pBitratesSupported = (XAuint32*)calloc(entries->numBitratesSupported, sizeof(XAuint32));
   263     entries->pBitratesSupported = (XAuint32*) calloc(
       
   264             entries->numBitratesSupported, sizeof(XAuint32));
   264     if (!entries->pBitratesSupported)
   265     if (!entries->pBitratesSupported)
   265     {
   266         {
   266         res = XA_RESULT_MEMORY_FAILURE;
   267         res = XA_RESULT_MEMORY_FAILURE;
   267         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   268         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   268         return res;
   269         return res;
   269     }
   270         }
   270     (entries->pBitratesSupported)[0] = 4750;
   271     (entries->pBitratesSupported)[0] = 4750;
   271     (entries->pBitratesSupported)[1] = 5150;
   272     (entries->pBitratesSupported)[1] = 5150;
   272     (entries->pBitratesSupported)[2] = 5900;
   273     (entries->pBitratesSupported)[2] = 5900;
   273     (entries->pBitratesSupported)[3] = 6700;
   274     (entries->pBitratesSupported)[3] = 6700;
   274     (entries->pBitratesSupported)[4] = 7400;
   275     (entries->pBitratesSupported)[4] = 7400;
   277     (entries->pBitratesSupported)[7] = 12200;
   278     (entries->pBitratesSupported)[7] = 12200;
   278 
   279 
   279     entries->profileSetting = XA_AUDIOPROFILE_AMR;
   280     entries->profileSetting = XA_AUDIOPROFILE_AMR;
   280     entries->modeSetting = 0;
   281     entries->modeSetting = 0;
   281 
   282 
   282     newNode->pEntry = (void*)entries;
       
   283 
       
   284     *ppNode = newNode;
   283     *ppNode = newNode;
   285     return res;
   284     return res;
   286 }
   285     }
   287 
   286 
   288 XAresult XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(XACapabilities **ppNode)
   287 XAresult XAMMFCapabilitiesMgr_GetAudioPCMEncoderCapabilities(
   289 {
   288         XACapabilities **ppNode)
       
   289     {
   290     XAresult res = XA_RESULT_SUCCESS;
   290     XAresult res = XA_RESULT_SUCCESS;
   291     XACapabilities *newNode = NULL;
   291     XACapabilities *newNode = NULL;
   292     XAAudioCodecDescriptor *entries = NULL;
   292     XAAudioCodecDescriptor *entries = NULL;
   293 
   293 
   294     newNode = (XACapabilities *)calloc(1, sizeof(XACapabilities));
   294     newNode = (XACapabilities *) calloc(1, sizeof(XACapabilities));
   295     if (!newNode)
   295     if (!newNode)
   296     {
   296         {
   297         res = XA_RESULT_MEMORY_FAILURE;
   297         res = XA_RESULT_MEMORY_FAILURE;
   298         return res;
   298         return res;
   299     }
   299         }
   300 
   300 
   301     newNode->capsType = AUD_E;
   301     newNode->capsType = AUD_E;
   302     newNode->xaid = XA_AUDIOCODEC_PCM;
   302     newNode->xaid = XA_AUDIOCODEC_PCM;
   303     newNode->noOfEntries = 1;
   303     newNode->noOfEntries = 1;
   304 
   304 
   305     /* Allocate array */
   305     /* Allocate array */
   306     entries = (XAAudioCodecDescriptor*)calloc(1, sizeof(XAAudioCodecDescriptor));
   306     entries = (XAAudioCodecDescriptor*) calloc(1,
       
   307             sizeof(XAAudioCodecDescriptor));
   307     if (!entries)
   308     if (!entries)
   308     {
   309         {
   309         res = XA_RESULT_MEMORY_FAILURE;
   310         res = XA_RESULT_MEMORY_FAILURE;
   310         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   311         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   311         return res;
   312         return res;
   312     }
   313         }
   313 
   314 
   314     newNode->pEntry = (void*)entries;
   315     newNode->pEntry = (void*) entries;
   315 
   316 
   316     entries->maxChannels = 2;
   317     entries->maxChannels = 2;
   317     entries->minBitsPerSample = 16;
   318     entries->minBitsPerSample = 16;
   318     entries->maxBitsPerSample = 16;
   319     entries->maxBitsPerSample = 16;
   319     entries->minSampleRate = 8000000;  /*milliHz*/
   320     entries->minSampleRate = 8000000; /*milliHz*/
   320     entries->maxSampleRate = 96000000;
   321     entries->maxSampleRate = 96000000;
   321     entries->isFreqRangeContinuous=XA_BOOLEAN_FALSE;
   322     entries->isFreqRangeContinuous = XA_BOOLEAN_FALSE;
   322     entries->numSampleRatesSupported = 10;
   323     entries->numSampleRatesSupported = 10;
   323     entries->pSampleRatesSupported = (XAmilliHertz*)calloc(entries->numSampleRatesSupported, sizeof(XAmilliHertz));
   324     entries->pSampleRatesSupported = (XAmilliHertz*) calloc(
       
   325             entries->numSampleRatesSupported, sizeof(XAmilliHertz));
   324     if (!entries->pSampleRatesSupported)
   326     if (!entries->pSampleRatesSupported)
   325     {
   327         {
   326         res = XA_RESULT_MEMORY_FAILURE;
   328         res = XA_RESULT_MEMORY_FAILURE;
   327         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   329         XACapabilitiesMgr_DeleteCapabilitieList(&newNode);
   328         return res;
   330         return res;
   329     }
   331         }
   330     /* entries in milliHz */
   332     /* entries in milliHz */
   331     entries->pSampleRatesSupported[0] = 12000000;
   333     entries->pSampleRatesSupported[0] = 12000000;
   332     entries->pSampleRatesSupported[1] = 16000000;
   334     entries->pSampleRatesSupported[1] = 16000000;
   333     entries->pSampleRatesSupported[2] = 22050000;
   335     entries->pSampleRatesSupported[2] = 22050000;
   334     entries->pSampleRatesSupported[3] = 24000000;
   336     entries->pSampleRatesSupported[3] = 24000000;
   345     entries->pBitratesSupported = NULL;
   347     entries->pBitratesSupported = NULL;
   346     entries->numBitratesSupported = 0;
   348     entries->numBitratesSupported = 0;
   347     entries->profileSetting = XA_AUDIOPROFILE_PCM;
   349     entries->profileSetting = XA_AUDIOPROFILE_PCM;
   348     entries->modeSetting = 0;
   350     entries->modeSetting = 0;
   349 
   351 
   350     newNode->pEntry = (void*)entries;
       
   351 
       
   352     *ppNode = newNode;
   352     *ppNode = newNode;
   353     return res;
   353     return res;
   354 }
   354     }