khronosfws/openmax_al/src/mmf_adaptation/xaengineadaptctxmmf.c
branchRCL_3
changeset 20 0ac9a5310753
parent 19 095bea5f582e
child 21 999b2818a0eb
equal deleted inserted replaced
19:095bea5f582e 20:0ac9a5310753
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <string.h>
       
    19 #include "xaengineadaptctxmmf.h"
       
    20 #include "xaadaptationmmf.h"
       
    21 
       
    22 /*
       
    23  * XAAdaptationBaseCtx* XAEngineAdaptMMF_Create()
       
    24  * Allocates memory for Engine Adaptation Context and makes 1st phase initialization
       
    25  * @returns XAEngineAdaptationCtx* - Pointer to created context
       
    26  */
       
    27 XAAdaptationMMFCtx* XAEngineAdaptMMF_Create()
       
    28 {
       
    29     XAEngineAdaptationMMFCtx *pSelf = NULL;
       
    30     DEBUG_API("->XAEngineAdaptMMF_Create");
       
    31 
       
    32     pSelf = (XAEngineAdaptationMMFCtx*)calloc(1, sizeof(XAEngineAdaptationMMFCtx));
       
    33     if ( pSelf)
       
    34     {
       
    35         if( XAAdaptationBaseMMF_Init(&(pSelf->baseObj),XAEngineAdaptation)
       
    36                     != XA_RESULT_SUCCESS )
       
    37             {
       
    38                 DEBUG_ERR("Failed to init base context!!!");
       
    39                 free(pSelf);
       
    40                 pSelf = NULL;
       
    41             }
       
    42             else
       
    43             {
       
    44                 /* Init internal variables */
       
    45             }
       
    46     }
       
    47 
       
    48     DEBUG_API("<-XAEngineAdaptMMF_Create");
       
    49     return (XAAdaptationMMFCtx*)pSelf;
       
    50 }
       
    51 
       
    52 /*
       
    53  * XAresult XAEngineAdaptMMF_PostInit()
       
    54  * 2nd phase initialization of engine Adaptation Context
       
    55  */
       
    56 XAresult XAEngineAdaptMMF_PostInit(XAAdaptationMMFCtx* bCtx)
       
    57 {
       
    58     XAresult ret = XA_RESULT_SUCCESS;
       
    59 
       
    60     DEBUG_API("<-XAEngineAdaptMMF_PostInit");
       
    61     return ret;
       
    62 }
       
    63 
       
    64 /*
       
    65  * void XAEngineAdapt_Destroy(XAEngineAdaptationCtx* ctx)
       
    66  * Destroys Engine Adaptation Context
       
    67  * @param ctx - Engine Adaptation context to be destroyed
       
    68  */
       
    69 void XAEngineAdaptMMF_Destroy(XAAdaptationMMFCtx* bCtx)
       
    70 {
       
    71 	XAEngineAdaptationMMFCtx* ctx = NULL;
       
    72 
       
    73 	DEBUG_API("->XAEngineAdaptMMF_Destroy");
       
    74 //	if( !bCtx || bCtx->ctxId != XAEngineAdaptation )
       
    75 //	{
       
    76 //		DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
       
    77 //		DEBUG_API("<-XAEngineAdaptMMF_Destroy");
       
    78 //		return;
       
    79 //	}
       
    80 	ctx = (XAEngineAdaptationMMFCtx*)bCtx;
       
    81   
       
    82   XAAdaptationBaseMMF_Free(&(ctx->baseObj));
       
    83 
       
    84 
       
    85     free(ctx);
       
    86     ctx = NULL;
       
    87 
       
    88     DEBUG_API("<-XAEngineAdaptMMF_Destroy");
       
    89 }