khronosfws/openmax_al/src/mediarecorder/xaaudioencoderitf.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: 
    15 *
    15  *
    16 */
    16  */
    17 
    17 
    18 #include <assert.h>
    18 #include <assert.h>
    19 #include "xamediarecorderadaptctxmmf.h"
    19 #include "xamediarecorderadaptctxmmf.h"
    20 #include "xaaudioencoderitf.h"
    20 #include "xaaudioencoderitf.h"
    21 #include "xaaudioencoderitfadaptation.h"
    21 #include "xaaudioencoderitfadaptation.h"
    26 
    26 
    27 /* XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
    27 /* XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
    28  * Description: Validate interface pointer and cast it to implementation pointer.
    28  * Description: Validate interface pointer and cast it to implementation pointer.
    29  **/
    29  **/
    30 static XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
    30 static XAAudioEncoderItfImpl* GetImpl(XAAudioEncoderItf self)
    31 {
    31     {
    32     if( self )
    32     if (self)
    33     {
    33         {
    34         XAAudioEncoderItfImpl* impl = (XAAudioEncoderItfImpl*)(*self);
    34         XAAudioEncoderItfImpl* impl = (XAAudioEncoderItfImpl*) (*self);
    35         if( impl && (impl == impl->self) )
    35         if (impl && (impl == impl->self))
    36         {
    36             {
    37             return impl;
    37             return impl;
    38         }
    38             }
    39     }
    39         }
    40     return NULL;
    40     return NULL;
    41 }
    41     }
    42 
    42 
    43 /*****************************************************************************
    43 /*****************************************************************************
    44  * Base interface XAAudioEncoderItf implementation
    44  * Base interface XAAudioEncoderItf implementation
    45  *****************************************************************************/
    45  *****************************************************************************/
    46 
    46 
    48  * XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
    48  * XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
    49  *                                                   XAAudioEncoderSettings *pSettings)
    49  *                                                   XAAudioEncoderSettings *pSettings)
    50  * Description: Set audio encoder settings.
    50  * Description: Set audio encoder settings.
    51  **/
    51  **/
    52 XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
    52 XAresult XAAudioEncoderItfImpl_SetEncoderSettings(XAAudioEncoderItf self,
    53                                                   XAAudioEncoderSettings *pSettings)
    53         XAAudioEncoderSettings *pSettings)
    54 {
    54     {
    55     XAMediaRecorderAdaptationMMFCtx* mCtx;
    55     XAMediaRecorderAdaptationMMFCtx* mCtx;
    56     XAresult ret = XA_RESULT_SUCCESS;
    56     XAresult ret = XA_RESULT_SUCCESS;
    57     XAuint32 recState = XA_RECORDSTATE_STOPPED;
    57     XAuint32 recState = XA_RECORDSTATE_STOPPED;
    58     XAAudioEncoderSettings currentSettings;
    58     XAAudioEncoderSettings currentSettings;
    59     XAAudioEncoderItfImpl *impl = GetImpl(self);
    59     XAAudioEncoderItfImpl *impl = GetImpl(self);
    60 
    60 
    61     DEBUG_API("->XAAudioEncoderItfImpl_SetEncoderSettings");
    61     DEBUG_API("->XAAudioEncoderItfImpl_SetEncoderSettings");
    62     XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
    62     XA_IMPL_THREAD_SAFETY_ENTRY( XATSMediaRecorder );
    63 
    63 
    64     if( !impl || !pSettings )
    64     if (!impl || !pSettings)
    65         {
    65         {
    66         /* invalid parameter */
    66         /* invalid parameter */
    67         XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
    67         XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
    68         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    68         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    69         DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
    69         DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
    70         return XA_RESULT_PARAMETER_INVALID;
    70         return XA_RESULT_PARAMETER_INVALID;
    71         }
    71         }
    72 
    72 
    73     if(impl->adapCtx->fwtype == FWMgrFWMMF)
    73     if (impl->adapCtx->fwtype == FWMgrFWMMF)
    74         {
    74         {
    75         mCtx = (XAMediaRecorderAdaptationMMFCtx*) impl->pObjImpl->adaptationCtx;
    75         mCtx
    76         
    76                 = (XAMediaRecorderAdaptationMMFCtx*) impl->pObjImpl->adaptationCtx;
    77         if(mCtx->xaRecordState != recState)
    77 
       
    78         if (mCtx->xaRecordState != recState)
    78             {
    79             {
    79             XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
    80             XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
    80             DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
    81             DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
    81             DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
    82             DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
    82             return XA_RESULT_PRECONDITIONS_VIOLATED;
    83             return XA_RESULT_PRECONDITIONS_VIOLATED;
    83             }
    84             }
    84 
    85 
    85         XAAudioEncoderItfImpl_GetEncoderSettings(self, &currentSettings);
    86         XAAudioEncoderItfImpl_GetEncoderSettings(self, &currentSettings);
    86         if(pSettings->encoderId == currentSettings.encoderId)
    87         if (pSettings->encoderId == currentSettings.encoderId)
    87             {
    88             {
    88             if(pSettings->channelsIn !=  currentSettings.channelsIn)
    89             if (pSettings->channelsIn != currentSettings.channelsIn)
    89                 {
    90                 {
    90                 ret = mmf_set_destination_channels(mCtx->mmfContext, &(pSettings->channelsIn));
    91                 ret = mmf_set_destination_channels(mCtx->mmfContext,
    91                 }
    92                         &(pSettings->channelsIn));
    92             
    93                 }
    93             if(pSettings->channelsOut != currentSettings.channelsOut)
    94 
    94                 {
    95             if (pSettings->channelsOut != currentSettings.channelsOut)
    95                 ret = mmf_set_destination_channels(mCtx->mmfContext, &(pSettings->channelsOut));
    96                 {
    96                 }
    97                 ret = mmf_set_destination_channels(mCtx->mmfContext,
    97             
    98                         &(pSettings->channelsOut));
    98             if(pSettings->sampleRate != currentSettings.sampleRate)
    99                 }
    99                 {
   100 
   100                 ret = mmf_set_destination_samplerate(mCtx->mmfContext, &(pSettings->sampleRate));
   101             if (pSettings->sampleRate != currentSettings.sampleRate)
   101                 }
   102                 {
   102 
   103                 ret = mmf_set_destination_samplerate(mCtx->mmfContext,
   103             if(pSettings->bitRate != currentSettings.bitRate)
   104                         &(pSettings->sampleRate));
   104                 {
   105                 }
   105                 ret = mmf_set_destination_bitrate(mCtx->mmfContext, &(pSettings->bitRate));
   106 
   106                 }
   107             if (pSettings->bitRate != currentSettings.bitRate)
   107             
   108                 {
   108             if(pSettings->rateControl != currentSettings.rateControl)
   109                 ret = mmf_set_destination_bitrate(mCtx->mmfContext,
   109                 {
   110                         &(pSettings->bitRate));
   110                 ret = XA_RESULT_PARAMETER_INVALID;
   111                 }
   111                 }
   112 
   112             if(pSettings->channelMode != currentSettings.channelMode)
   113             if (pSettings->rateControl != currentSettings.rateControl)
   113                 {
   114                 {
   114                 ret = XA_RESULT_PARAMETER_INVALID;
   115                 ret = XA_RESULT_PARAMETER_INVALID;
   115                 }
   116                 }
   116             if(pSettings->encodeOptions != currentSettings.encodeOptions)
   117             if (pSettings->channelMode != currentSettings.channelMode)
   117                 {
   118                 {
   118                 ret = XA_RESULT_PARAMETER_INVALID;
   119                 ret = XA_RESULT_PARAMETER_INVALID;
   119                 }
   120                 }
   120             if(pSettings->blockAlignment != currentSettings.blockAlignment)
   121             if (pSettings->encodeOptions != currentSettings.encodeOptions)
   121                 {
   122                 {
   122                 ret = XA_RESULT_PARAMETER_INVALID;
   123                 ret = XA_RESULT_PARAMETER_INVALID;
   123                 }    
   124                 }
   124             if(pSettings->bitsPerSample != currentSettings.bitsPerSample)
   125             if (pSettings->blockAlignment != currentSettings.blockAlignment)
   125                 {
   126                 {
   126                 ret = XA_RESULT_PARAMETER_INVALID;
   127                 ret = XA_RESULT_PARAMETER_INVALID;
   127                 }    
   128                 }
   128             if(pSettings->profileSetting != currentSettings.profileSetting)
   129             if (pSettings->bitsPerSample != currentSettings.bitsPerSample)
   129                 {
   130                 {
   130                 ret = XA_RESULT_PARAMETER_INVALID;
   131                 ret = XA_RESULT_PARAMETER_INVALID;
   131                 }    
   132                 }
   132             if(pSettings->levelSetting != currentSettings.levelSetting)
   133             if (pSettings->profileSetting != currentSettings.profileSetting)
   133                 {
   134                 {
   134                 ret = XA_RESULT_PARAMETER_INVALID;
   135                 ret = XA_RESULT_PARAMETER_INVALID;
   135                 }    
   136                 }
       
   137             if (pSettings->levelSetting != currentSettings.levelSetting)
       
   138                 {
       
   139                 ret = XA_RESULT_PARAMETER_INVALID;
       
   140                 }
   136             }
   141             }
   137         else
   142         else
   138             {
   143             {
   139             ret = XA_RESULT_PARAMETER_INVALID;
   144             ret = XA_RESULT_PARAMETER_INVALID;
   140             }
   145             }
   141         }
   146         }
   142     else
   147     else
   143         {
   148         {
   144         XACapabilities temp;
   149         XACapabilities temp;
   145     
   150 
   146         ret = XACapabilitiesMgr_GetCapsById(impl->pObjImpl->adaptationCtx->capslist, (XACapsType)(XACAP_ENCODER|XACAP_AUDIO), pSettings->encoderId, &temp);
   151         ret = XACapabilitiesMgr_GetCapsById(
   147         if( ret == XA_RESULT_SUCCESS )
   152                 impl->pObjImpl->adaptationCtx->capslist,
   148             {
   153                 (XACapsType) (XACAP_ENCODER | XACAP_AUDIO),
   149             ret = XARecordItfAdapt_GetRecordState( (XAAdaptationGstCtx*)impl->adapCtx, &recState );
   154                 pSettings->encoderId, &temp);
   150             if( ret == XA_RESULT_SUCCESS )
   155         if (ret == XA_RESULT_SUCCESS)
   151                 {
   156             {
   152                 if( XA_RECORDSTATE_STOPPED == recState )
   157             ret = XARecordItfAdapt_GetRecordState(
       
   158                     (XAAdaptationGstCtx*) impl->adapCtx, &recState);
       
   159             if (ret == XA_RESULT_SUCCESS)
       
   160                 {
       
   161                 if (XA_RECORDSTATE_STOPPED == recState)
   153                     {
   162                     {
   154                     ret = XAAudioEncoderItfAdapt_SetEncoderSettings( impl->adapCtx, pSettings);
   163                     ret = XAAudioEncoderItfAdapt_SetEncoderSettings(
       
   164                             impl->adapCtx, pSettings);
   155                     }
   165                     }
   156                 else
   166                 else
   157                     {
   167                     {
   158                     DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
   168                     DEBUG_ERR("XA_RESULT_PRECONDITIONS_VIOLATED");
   159                     DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
   169                     DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
   165             {
   175             {
   166             DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
   176             DEBUG_ERR("XA_RESULT_FEATURE_UNSUPPORTED");
   167             DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
   177             DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
   168             return XA_RESULT_FEATURE_UNSUPPORTED;
   178             return XA_RESULT_FEATURE_UNSUPPORTED;
   169             }
   179             }
   170         }    
   180         }
   171     
   181 
   172     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
   182     XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaRecorder );
   173     DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
   183     DEBUG_API("<-XAAudioEncoderItfImpl_SetEncoderSettings");
   174     return ret;
   184     return ret;
   175 }
   185     }
   176 
   186 
   177 /**
   187 /**
   178  * XAresult XAAudioEncoderItfImpl_GetEncoderSettings(XAAudioEncoderItf self,
   188  * XAresult XAAudioEncoderItfImpl_GetEncoderSettings(XAAudioEncoderItf self,
   179  *                                                   XAAudioEncoderSettings *pSettings)
   189  *                                                   XAAudioEncoderSettings *pSettings)
   180  * Description: Get audio encoder settings.
   190  * Description: Get audio encoder settings.
   181  **/
   191  **/
   182 XAresult XAAudioEncoderItfImpl_GetEncoderSettings(XAAudioEncoderItf self,
   192 XAresult XAAudioEncoderItfImpl_GetEncoderSettings(XAAudioEncoderItf self,
   183                                                   XAAudioEncoderSettings *pSettings)
   193         XAAudioEncoderSettings *pSettings)
   184 {
   194     {
   185     XAresult ret = XA_RESULT_SUCCESS;
   195     XAresult ret = XA_RESULT_SUCCESS;
   186     XAuint32 encoderId;
   196     XAuint32 encoderId;
   187     XAuint32 channelsIn;
   197     XAuint32 channelsIn;
   188     XAuint32 channelsOut;
   198     XAuint32 channelsOut;
   189     XAmilliHertz sampleRate;
   199     XAmilliHertz sampleRate;
   190     XAuint32 bitRate;
   200     XAuint32 bitRate;
   191     XAMediaRecorderAdaptationMMFCtx* mCtx;
   201     XAMediaRecorderAdaptationMMFCtx* mCtx;
   192    
   202 
   193     XAAudioEncoderItfImpl *impl = GetImpl(self);
   203     XAAudioEncoderItfImpl *impl = GetImpl(self);
   194     
   204 
   195     DEBUG_API("->XAAudioEncoderItfImpl_GetEncoderSettings");
   205     DEBUG_API("->XAAudioEncoderItfImpl_GetEncoderSettings");
   196     if(!impl || !pSettings )
   206     if (!impl || !pSettings)
   197     {
   207         {
   198         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   208         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   199         /* invalid parameter */
   209         /* invalid parameter */
   200         return XA_RESULT_PARAMETER_INVALID;
   210         return XA_RESULT_PARAMETER_INVALID;
   201     }
   211         }
   202 
   212 
   203     mCtx = (XAMediaRecorderAdaptationMMFCtx*) (impl->pObjImpl->adaptationCtx);
   213     mCtx = (XAMediaRecorderAdaptationMMFCtx*) (impl->pObjImpl->adaptationCtx);
   204     
   214 
   205 
   215     if (impl->adapCtx->fwtype == FWMgrFWMMF)
   206 
       
   207     if(impl->adapCtx->fwtype == FWMgrFWMMF)
       
   208         {
   216         {
   209         mmf_get_codec_id(mCtx->mmfContext, &encoderId);
   217         mmf_get_codec_id(mCtx->mmfContext, &encoderId);
   210         
   218 
   211         switch(encoderId)
   219         switch (encoderId)
   212             {
   220             {
   213             case 0x36315020:
   221             case 0x36315020:
   214                 pSettings->encoderId = XA_AUDIOCODEC_PCM;
   222                 pSettings->encoderId = XA_AUDIOCODEC_PCM;
   215                 pSettings->bitsPerSample = 16;
   223                 pSettings->bitsPerSample = 16;
   216                 pSettings->profileSetting = XA_AUDIOPROFILE_PCM;
   224                 pSettings->profileSetting = XA_AUDIOPROFILE_PCM;
   230                 pSettings->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
   238                 pSettings->profileSetting = XA_AUDIOPROFILE_AAC_AAC;
   231                 pSettings->levelSetting = XA_AUDIOMODE_AAC_LC;
   239                 pSettings->levelSetting = XA_AUDIOMODE_AAC_LC;
   232                 pSettings->streamFormat = XA_AUDIOSTREAMFORMAT_RAW;
   240                 pSettings->streamFormat = XA_AUDIOSTREAMFORMAT_RAW;
   233                 break;
   241                 break;
   234             }
   242             }
   235         
   243 
   236         mmf_get_channels(mCtx->mmfContext, &channelsIn);
   244         mmf_get_channels(mCtx->mmfContext, &channelsIn);
   237         pSettings->channelsIn =  channelsIn;
   245         pSettings->channelsIn = channelsIn;
   238         mmf_get_channels(mCtx->mmfContext, &channelsOut);
   246         mmf_get_channels(mCtx->mmfContext, &channelsOut);
   239         pSettings->channelsOut = channelsOut;
   247         pSettings->channelsOut = channelsOut;
   240         mmf_get_samplerate(mCtx->mmfContext, &sampleRate);
   248         mmf_get_samplerate(mCtx->mmfContext, &sampleRate);
   241         pSettings->sampleRate = sampleRate;
   249         pSettings->sampleRate = sampleRate;
   242         mmf_get_bitrate(mCtx->mmfContext, &bitRate);
   250         mmf_get_bitrate(mCtx->mmfContext, &bitRate);
   246         pSettings->encodeOptions = 0;
   254         pSettings->encodeOptions = 0;
   247         pSettings->blockAlignment = 0;
   255         pSettings->blockAlignment = 0;
   248         }
   256         }
   249     else
   257     else
   250         {
   258         {
   251         ret = XAAudioEncoderItfAdapt_GetEncoderSettings(impl->adapCtx, pSettings);
   259         ret = XAAudioEncoderItfAdapt_GetEncoderSettings(impl->adapCtx,
   252         }
   260                 pSettings);
   253     DEBUG_API("<-XAAudioEncoderItfImpl_GetEncoderSettings");
   261         }DEBUG_API("<-XAAudioEncoderItfImpl_GetEncoderSettings");
   254     return ret;
   262     return ret;
   255 }
   263     }
   256 
   264 
   257 /*****************************************************************************
   265 /*****************************************************************************
   258  * XAAudioEncoderItfImpl -specific methods
   266  * XAAudioEncoderItfImpl -specific methods
   259  *****************************************************************************/
   267  *****************************************************************************/
   260 
   268 
   261 /* XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create()
   269 /* XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create()
   262  * Description: Allocate and initialize XAAudioEncoderItfImpl
   270  * Description: Allocate and initialize XAAudioEncoderItfImpl
   263  */
   271  */
   264 XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create( XAMediaRecorderImpl* impl )
   272 XAAudioEncoderItfImpl* XAAudioEncoderItfImpl_Create(XAMediaRecorderImpl* impl)
   265 {
   273     {
   266     XAAudioEncoderItfImpl* self = (XAAudioEncoderItfImpl*)
   274     XAAudioEncoderItfImpl* self = (XAAudioEncoderItfImpl*) calloc(1,
   267         calloc(1,sizeof(XAAudioEncoderItfImpl));
   275             sizeof(XAAudioEncoderItfImpl));
   268     //XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)(impl->adaptationCtx);
   276     //XAMediaRecorderAdaptationCtx* mCtx = (XAMediaRecorderAdaptationCtx*)(impl->adaptationCtx);
   269     
   277 
   270     DEBUG_API("->XAAudioEncoderItfImpl_Create");
   278     DEBUG_API("->XAAudioEncoderItfImpl_Create");
   271     if( self )
   279     if (self)
   272     {
   280         {
   273         //if(mCtx->fwtype == FWMgrFWMMF)
   281         //if(mCtx->fwtype == FWMgrFWMMF)
   274             {
   282             {
   275             /* init itf default implementation */
   283             /* init itf default implementation */
   276             self->itf.GetEncoderSettings = XAAudioEncoderItfImpl_GetEncoderSettings;
   284             self->itf.GetEncoderSettings
   277             self->itf.SetEncoderSettings = XAAudioEncoderItfImpl_SetEncoderSettings;
   285                     = XAAudioEncoderItfImpl_GetEncoderSettings;
   278             }
   286             self->itf.SetEncoderSettings
   279         
   287                     = XAAudioEncoderItfImpl_SetEncoderSettings;
       
   288             }
       
   289 
   280         self->pObjImpl = impl;
   290         self->pObjImpl = impl;
   281         /* init variables */
   291         /* init variables */
   282         self->adapCtx = impl->adaptationCtx;
   292         self->adapCtx = impl->adaptationCtx;
   283 
   293 
   284         self->self = self;
   294         self->self = self;
   285     }
   295         }DEBUG_API("<-XAAudioEncoderItfImpl_Create");
   286     DEBUG_API("<-XAAudioEncoderItfImpl_Create");
       
   287     return self;
   296     return self;
   288 }
   297     }
   289 
   298 
   290 /* void XAAudioEncoderItfImpl_Free(XAAudioEncoderItfImpl* self)
   299 /* void XAAudioEncoderItfImpl_Free(XAAudioEncoderItfImpl* self)
   291  * Description: Free all resources reserved at XAAudioEncoderItfImpl_Create
   300  * Description: Free all resources reserved at XAAudioEncoderItfImpl_Create
   292  */
   301  */
   293 void XAAudioEncoderItfImpl_Free(XAAudioEncoderItfImpl* self)
   302 void XAAudioEncoderItfImpl_Free(XAAudioEncoderItfImpl* self)
   294 {
   303     {
   295     DEBUG_API("->XAAudioEncoderItfImpl_Free");
   304     DEBUG_API("->XAAudioEncoderItfImpl_Free");
   296     assert( self==self->self );
   305     assert( self==self->self );
   297     free( self );
   306     if(self)
       
   307         {
       
   308         free(self);
       
   309         }
   298     DEBUG_API("<-XAAudioEncoderItfImpl_Free");
   310     DEBUG_API("<-XAAudioEncoderItfImpl_Free");
   299 }
   311     }