khronosfws/openmax_al/src/radio/xaradiodevice.c
changeset 52 4ce423f34688
parent 42 1fa3fb47b1e3
child 53 eabc8c503852
equal deleted inserted replaced
47:c2e43643db4c 52:4ce423f34688
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <stdio.h>
    18 #include <stdio.h>
    19 #include <stdlib.h>
    19 #include <stdlib.h>
    20 #include <assert.h>
       
    21 #include "xaradiodevice.h"
    20 #include "xaradiodevice.h"
    22 #include "xaradioitf.h"
    21 #include "xaradioitf.h"
    23 #include "xaconfigextensionsitf.h"
    22 #include "xaconfigextensionsitf.h"
    24 #include "xadynintmgmtitf.h"
    23 #include "xadynintmgmtitf.h"
    25 #include "xathreadsafety.h"
    24 #include "xathreadsafety.h"
   117             }
   116             }
   118         }
   117         }
   119     }
   118     }
   120 
   119 
   121     *pDevice = (XAObjectItf)&(pBaseObj->self);
   120     *pDevice = (XAObjectItf)&(pBaseObj->self);
   122     pImpl->adaptationCtx = XARadioAdapt_Create();   
   121     pImpl->adaptationCtx = XARadioAdapt_Create();
   123 
   122     if (pImpl->adaptationCtx == NULL)
       
   123     {
       
   124         XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
       
   125         DEBUG_API("<-XARadioDeviceImpl_Create With ERROR");
       
   126         return XA_RESULT_RESOURCE_ERROR;
       
   127     }
   124     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
   128     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
   125 
       
   126     DEBUG_API("<-XARadioDeviceImpl_Create");
   129     DEBUG_API("<-XARadioDeviceImpl_Create");
   127     return XA_RESULT_SUCCESS;
   130     return XA_RESULT_SUCCESS;
   128 }
   131 }
   129 
   132 
   130 /* XAResult XARadioDeviceImpl_QueryNumSupportedInterfaces
   133 /* XAResult XARadioDeviceImpl_QueryNumSupportedInterfaces
   275     XARadioDeviceImpl* pImpl = (XARadioDeviceImpl*)(*self);
   278     XARadioDeviceImpl* pImpl = (XARadioDeviceImpl*)(*self);
   276     XAuint8 itfIdx = 0;
   279     XAuint8 itfIdx = 0;
   277     DEBUG_API("->XARadioDeviceImpl_FreeResources");
   280     DEBUG_API("->XARadioDeviceImpl_FreeResources");
   278     XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSRadio);
   281     XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSRadio);
   279 
   282 
   280     
       
   281     assert( pObj && pImpl && pObj == pObj->self );
       
   282 
       
   283 
       
   284     /* free all allocated interfaces */
   283     /* free all allocated interfaces */
   285     for(itfIdx = 0; itfIdx < RADIO_ITFCOUNT; itfIdx++)
   284     for(itfIdx = 0; itfIdx < RADIO_ITFCOUNT; itfIdx++)
   286     {
   285     {
   287         void *pItf = pObj->interfaceMap[itfIdx].pItf;
   286         void *pItf = pObj->interfaceMap[itfIdx].pItf;
   288         if(pItf)
   287         if(pItf)