khronosfws/openmax_al/src/mmf_adaptation/xamediaplayeradaptctxmmf.c
changeset 55 e267340986c9
parent 42 1fa3fb47b1e3
equal deleted inserted replaced
52:4ce423f34688 55:e267340986c9
    13  *
    13  *
    14  * Description: Media Player Adapt Code MMF 
    14  * Description: Media Player Adapt Code MMF 
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include <assert.h>
       
    19 #include <stdlib.h>
    18 #include <stdlib.h>
    20 #include "xamediaplayeradaptctxmmf.h"
    19 #include "xamediaplayeradaptctxmmf.h"
    21 #include "xaadaptationmmf.h"
    20 #include "xaadaptationmmf.h"
    22 #include "xaobjectitf.h"
    21 #include "xaobjectitf.h"
    23 #include "cmmfbackendengine.h"
    22 #include "cmmfbackendengine.h"
    80             pSelf->curRotation = 0;
    79             pSelf->curRotation = 0;
    81             pSelf->isobjsrc = XA_BOOLEAN_FALSE;
    80             pSelf->isobjsrc = XA_BOOLEAN_FALSE;
    82             pSelf->cameraSinkSynced = XA_BOOLEAN_FALSE;
    81             pSelf->cameraSinkSynced = XA_BOOLEAN_FALSE;
    83             pSelf->rateprops = XA_RATEPROP_SMOOTHVIDEO | XA_RATEPROP_NOPITCHCORAUDIO;
    82             pSelf->rateprops = XA_RATEPROP_SMOOTHVIDEO | XA_RATEPROP_NOPITCHCORAUDIO;
    84             pSelf->playrate = 1000;
    83             pSelf->playrate = 1000;
       
    84             pSelf->mmfContext = NULL;
    85             }
    85             }
    86         }
    86         }
    87     else
    87     else
    88         {
    88         {
    89         DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
    89         DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
    91         }
    91         }
    92     
    92     
    93     if (pSelf)
    93     if (pSelf)
    94         {
    94         {
    95         res = mmf_backend_engine_init(&(pSelf->mmfContext));
    95         res = mmf_backend_engine_init(&(pSelf->mmfContext));
    96         if (!(pSelf->mmfContext) || (res != XA_RESULT_SUCCESS))
    96         if ((res != XA_RESULT_SUCCESS) || !(pSelf->mmfContext))
    97             {
    97             {
    98             /* TODO Check to make sure there is no undeleted MMF objects here*/
    98             /* TODO Check to make sure there is no undeleted MMF objects here*/
    99             DEBUG_ERR("Failed to init mmf context!!!");
    99             DEBUG_ERR("Failed to init mmf context!!!");
   100             free(pSelf);
   100             free(pSelf);
   101             pSelf = NULL;
   101             pSelf = NULL;
   109                     = mmf_metadata_utility_init(
   109                     = mmf_metadata_utility_init(
   110                             (char *) (((XADataLocator_URI*) (pDataSrc->pLocator))->URI));
   110                             (char *) (((XADataLocator_URI*) (pDataSrc->pLocator))->URI));
   111             if (!pSelf->mmfMetadataContext)
   111             if (!pSelf->mmfMetadataContext)
   112                 {
   112                 {
   113                 DEBUG_ERR("Failed to init mmf metadata context!!!");
   113                 DEBUG_ERR("Failed to init mmf metadata context!!!");
   114                 pSelf->mmfMetadataContext = NULL;
   114                 free(pSelf);
       
   115                 pSelf = NULL;
       
   116                 return NULL;
   115                 }
   117                 }
   116             }
   118             }
   117         else
   119         else
   118             {
   120             {
   119             DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
   121             DEBUG_ERR("Failed to create XAMediaPlayerAdaptationMMFCtx !!!");
       
   122             free(pSelf);
       
   123             pSelf = NULL;
   120             return NULL;
   124             return NULL;
   121             }
   125             }
   122         }
   126         }
   123 
   127 
   124     DEBUG_API("<-XAMediaPlayerAdaptMMF_Create");
   128     DEBUG_API("<-XAMediaPlayerAdaptMMF_Create");