khronosfws/openmax_al/src/vibra/xavibraitf.c
changeset 16 43d09473c595
parent 12 5a06f39ad45b
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    17 
    17 
    18 #include <stdio.h>
    18 #include <stdio.h>
    19 #include <stdlib.h>
    19 #include <stdlib.h>
    20 #include <assert.h>
    20 #include <assert.h>
    21 #include "xavibraitf.h"
    21 #include "xavibraitf.h"
    22 #ifdef _GSTREAMER_BACKEND_
    22 
    23 #include "XAVibraItfAdaptation.h"
    23 #include "xavibraitfadaptation.h"
    24 #endif
    24 
    25 #include "xathreadsafety.h"
    25 #include "xathreadsafety.h"
    26 /* XAVibraItfImpl* GetImpl(XAVibraItf self)
    26 /* XAVibraItfImpl* GetImpl(XAVibraItf self)
    27  * Description: Validate interface pointer and cast it to implementation pointer.
    27  * Description: Validate interface pointer and cast it to implementation pointer.
    28 */
    28 */
    29 static XAVibraItfImpl* GetImpl(XAVibraItf self)
    29 static XAVibraItfImpl* GetImpl(XAVibraItf self)
    64     }
    64     }
    65 
    65 
    66     /* check is vibrate mode changed */
    66     /* check is vibrate mode changed */
    67     if( impl->vibrate != vibrate )
    67     if( impl->vibrate != vibrate )
    68     {
    68     {
    69 #ifdef _GSTREAMER_BACKEND_
    69 
    70         ret = XAVibraItfAdapt_Vibrate( impl->adapCtx, vibrate );
    70         ret = XAVibraItfAdapt_Vibrate( (XAAdaptationGstCtx*)impl->adapCtx, vibrate );
    71 #endif
    71 
    72         if ( ret == XA_RESULT_SUCCESS )
    72         if ( ret == XA_RESULT_SUCCESS )
    73         {
    73         {
    74             impl->vibrate = vibrate;
    74             impl->vibrate = vibrate;
    75         }
    75         }
    76     }
    76     }
   133     }
   133     }
   134 
   134 
   135     /* check is vibration frequency changed */
   135     /* check is vibration frequency changed */
   136     if( impl->frequency != frequency )
   136     if( impl->frequency != frequency )
   137     {
   137     {
   138 #ifdef _GSTREAMER_BACKEND_
   138 
   139         ret = XAVibraItfAdapt_SetFrequency( impl->adapCtx, frequency );
   139         ret = XAVibraItfAdapt_SetFrequency( (XAAdaptationGstCtx*)impl->adapCtx, frequency );
   140 #endif
   140 
   141         if( ret == XA_RESULT_SUCCESS )
   141         if( ret == XA_RESULT_SUCCESS )
   142         {
   142         {
   143             impl->frequency = frequency;
   143             impl->frequency = frequency;
   144         }
   144         }
   145     }
   145     }
   192     }
   192     }
   193 
   193 
   194     /* check is vibration intensity changed */
   194     /* check is vibration intensity changed */
   195     if( impl->intensity != intensity )
   195     if( impl->intensity != intensity )
   196     {
   196     {
   197 #ifdef _GSTREAMER_BACKEND_
   197 
   198         ret = XAVibraItfAdapt_SetIntensity( impl->adapCtx, intensity );
   198         ret = XAVibraItfAdapt_SetIntensity( (XAAdaptationGstCtx*)impl->adapCtx, intensity );
   199 #endif
   199 
   200         if( ret == XA_RESULT_SUCCESS )
   200         if( ret == XA_RESULT_SUCCESS )
   201         {
   201         {
   202             impl->intensity = intensity;
   202             impl->intensity = intensity;
   203         }
   203         }
   204     }
   204     }
   230     DEBUG_API_A1("Intensity is %d", *pIntensity);
   230     DEBUG_API_A1("Intensity is %d", *pIntensity);
   231     DEBUG_API("<-XAVibraItfImpl_GetIntensity");
   231     DEBUG_API("<-XAVibraItfImpl_GetIntensity");
   232     return ret;
   232     return ret;
   233 }
   233 }
   234 
   234 
   235 #ifdef _GSTREAMER_BACKEND_
   235 
   236 
   236 
   237 /*****************************************************************************
   237 /*****************************************************************************
   238  * XAVibraItfImpl -specific methods
   238  * XAVibraItfImpl -specific methods
   239  *****************************************************************************/
   239  *****************************************************************************/
   240 /* XAVibraItfImpl* XAVibraItfImpl_Create()
   240 /* XAVibraItfImpl* XAVibraItfImpl_Create()
   264     }
   264     }
   265 
   265 
   266     DEBUG_API("<-XAVibraItfImpl_Create");
   266     DEBUG_API("<-XAVibraItfImpl_Create");
   267     return self;
   267     return self;
   268 }
   268 }
   269 #endif
   269 
   270 /* void XAVibraItfImpl_Free(XAVibraItfImpl* self)
   270 /* void XAVibraItfImpl_Free(XAVibraItfImpl* self)
   271  * Description: Free all resources reserved at XAVibraItfImpl_Create
   271  * Description: Free all resources reserved at XAVibraItfImpl_Create
   272  */
   272  */
   273 void XAVibraItfImpl_Free(XAVibraItfImpl* self)
   273 void XAVibraItfImpl_Free(XAVibraItfImpl* self)
   274 {
   274 {