khronosfws/openmax_al/src/radio/xaradioitf.c
changeset 16 43d09473c595
parent 12 5a06f39ad45b
child 21 2ed61feeead6
child 31 8dfd592727cb
--- a/khronosfws/openmax_al/src/radio/xaradioitf.c	Mon May 03 12:59:52 2010 +0300
+++ b/khronosfws/openmax_al/src/radio/xaradioitf.c	Fri May 14 16:22:35 2010 +0300
@@ -20,9 +20,9 @@
 #include <assert.h>
 #include <string.h>
 #include "xaradioitf.h"
-#ifdef _GSTREAMER_BACKEND_
-#include "XARadioItfAdaptation.h"
-#endif
+
+#include "xaradioitfadaptation.h"
+
 #include "xathreadsafety.h"
 
 /**
@@ -54,9 +54,9 @@
 XAresult XARadioItfImpl_SetFreqRange(XARadioItf self, XAuint8 range)
 {
     XAresult ret = XA_RESULT_SUCCESS;
-#ifdef _GSTREAMER_BACKEND_
+
     XAboolean isSupported = XA_BOOLEAN_FALSE;
-#endif
+
     XARadioItfImpl* impl = GetImpl(self);
 
     DEBUG_API("->XARadioItfImpl_SetFreqRange");
@@ -72,14 +72,14 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_IsFreqRangeSupported(impl->adapCtx, range, &isSupported);
+
+    ret = XARadioItfAdapt_IsFreqRangeSupported((XAAdaptationGstCtx*)impl->adapCtx, range, &isSupported);
 
     if ( ret == XA_RESULT_SUCCESS && isSupported == XA_BOOLEAN_TRUE )
     {
-        ret = XARadioItfAdapt_SetFreqRange(impl->adapCtx, range);
+        ret = XARadioItfAdapt_SetFreqRange((XAAdaptationGstCtx*)impl->adapCtx, range);
     }
-#endif
+
     
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_SetFreqRange");
@@ -106,9 +106,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetFreqRange( impl->adapCtx, pRange);
-#endif
+
+    ret = XARadioItfAdapt_GetFreqRange( (XAAdaptationGstCtx*)impl->adapCtx, pRange);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetFreqRange");
     return ret;
@@ -138,9 +138,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_IsFreqRangeSupported( impl->adapCtx, range, pSupported );
-#endif
+
+    ret = XARadioItfAdapt_IsFreqRangeSupported( (XAAdaptationGstCtx*)impl->adapCtx, range, pSupported );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_IsFreqRangeSupported");
     return ret;
@@ -176,9 +176,9 @@
         DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
         return XA_RESULT_PARAMETER_INVALID;
     }
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_IsFreqRangeSupported( impl->adapCtx, range, &isSupported );
-#endif
+
+    ret = XARadioItfAdapt_IsFreqRangeSupported( (XAAdaptationGstCtx*)impl->adapCtx, range, &isSupported );
+
     if (isSupported != XA_BOOLEAN_TRUE || ret != XA_RESULT_SUCCESS)
     {
         XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
@@ -188,10 +188,10 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetFreqRangeProperties( impl->adapCtx,
+
+    ret = XARadioItfAdapt_GetFreqRangeProperties( (XAAdaptationGstCtx*)impl->adapCtx,
             range, pMinFreq, pMaxFreq, pFreqInterval );
-#endif
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetFreqRangeProperties");
     return ret;
@@ -220,9 +220,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_SetFrequency( impl->adapCtx, freq );
-#endif
+
+    ret = XARadioItfAdapt_SetFrequency( (XAAdaptationGstCtx*)impl->adapCtx, freq );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_SetFrequency");
     return ret;
@@ -251,9 +251,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_CancelSetFrequency( impl->adapCtx );
-#endif
+
+    ret = XARadioItfAdapt_CancelSetFrequency( (XAAdaptationGstCtx*)impl->adapCtx );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_CancelSetFrequency");
     return ret;
@@ -279,9 +279,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetFrequency( impl->adapCtx, pFreq);
-#endif
+
+    ret = XARadioItfAdapt_GetFrequency( (XAAdaptationGstCtx*)impl->adapCtx, pFreq);
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetFrequency");
     return ret;
@@ -309,9 +309,9 @@
 
     if (impl->squelch != squelch)
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XARadioItfAdapt_SetSquelch( impl->adapCtx, squelch );
-#endif
+
+        ret = XARadioItfAdapt_SetSquelch( (XAAdaptationGstCtx*)impl->adapCtx, squelch );
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->squelch = squelch;
@@ -368,9 +368,9 @@
 
     if ( impl->stereoMode != mode)
     {
-#ifdef _GSTREAMER_BACKEND_
-        ret = XARadioItfAdapt_SetStereoMode( impl->adapCtx, mode );
-#endif
+
+        ret = XARadioItfAdapt_SetStereoMode( (XAAdaptationGstCtx*)impl->adapCtx, mode );
+
         if ( ret == XA_RESULT_SUCCESS )
         {
             impl->stereoMode = mode;
@@ -426,9 +426,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_GetSignalStrength( impl->adapCtx, pStrength );
-#endif
+
+    ret = XARadioItfAdapt_GetSignalStrength( (XAAdaptationGstCtx*)impl->adapCtx, pStrength );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_GetSignalStrength");
     return ret;
@@ -458,9 +458,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_Seek( impl->adapCtx, upwards );
-#endif
+
+    ret = XARadioItfAdapt_Seek( (XAAdaptationGstCtx*)impl->adapCtx, upwards );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_Seek");
     return ret;
@@ -488,9 +488,9 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
-    ret = XARadioItfAdapt_StopSeeking( impl->adapCtx );
-#endif
+
+    ret = XARadioItfAdapt_StopSeeking( (XAAdaptationGstCtx*)impl->adapCtx );
+
     XA_IMPL_THREAD_SAFETY_EXIT(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_StopSeeking");
     return ret;
@@ -579,7 +579,7 @@
         return XA_RESULT_PARAMETER_INVALID;
     }
 
-#ifdef _GSTREAMER_BACKEND_
+
     
     free(impl->presets[preset].name);
 
@@ -588,7 +588,7 @@
     impl->presets[preset].stereoMode = mode;
     impl->presets[preset].name = calloc(1, RADIO_PRESET_NAME_MAX_LENGTH+1);
     strncpy( impl->presets[preset].name, (char*)name, RADIO_PRESET_NAME_MAX_LENGTH );
-#endif
+
     DEBUG_API("<-XARadioItfImpl_SetPreset");
     return ret;
 }
@@ -633,7 +633,7 @@
             DEBUG_API("<-XARadioItfImpl_GetPreset");
             return XA_RESULT_PARAMETER_INVALID;
         }
-#ifdef _GSTREAMER_BACKEND_
+
         *pFreq = impl->presets[preset].freq;
         *pRange = impl->presets[preset].range;
         *pMode = impl->presets[preset].stereoMode;
@@ -646,7 +646,7 @@
         {
             strncpy( (char*)pName, impl->presets[preset].name, RADIO_PRESET_NAME_MAX_LENGTH );
         }
-#endif        
+        
     }
     /*Just adding some meaninful value, when supporting new spec this must be fetch the system*/
     *pNameLength = RADIO_PRESET_NAME_MAX_LENGTH;
@@ -688,7 +688,6 @@
 /**
  * XARadioItfImpl -specific methods
  **/
-#ifdef _GSTREAMER_BACKEND_
 
 /**
  * XARadioItfImplImpl* XARadioItfImpl_Create()
@@ -756,18 +755,18 @@
     DEBUG_API("<-XARadioItfImpl_Create");
     return self;
 }
-#endif
+
 /**
  * void XARadioItfImpl_Free(XARadioItfImpl* self)
  * Description: Free all resources reserved at XARadioItfImpl_Create
  **/
 void XARadioItfImpl_Free(XARadioItfImpl* self)
 {
-    
+    XAuint16 index = 0;
     DEBUG_API("->XARadioItfImpl_Free");
     XA_IMPL_THREAD_SAFETY_ENTRY_FOR_VOID_FUNCTIONS(XATSRadio);
-#ifdef _GSTREAMER_BACKEND_
-    XAuint16 index = 0;
+
+    
     XAAdaptationBase_RemoveEventHandler( self->adapCtx, &XARadioItfImpl_AdaptCb );
 
     XARadioItfAdapt_Free(self->adapCtx);
@@ -776,14 +775,14 @@
     {
         free(self->presets[index].name);
     }
-#endif
+
     assert(self==self->self);
     free(self);
 
     XA_IMPL_THREAD_SAFETY_EXIT_FOR_VOID_FUNCTIONS(XATSRadio);
     DEBUG_API("<-XARadioItfImpl_Free");
 }
-#ifdef _GSTREAMER_BACKEND_
+
 /* void XARadioItfimpl_AdaptCb( void *pHandlerCtx, XAAdaptEvent *event )
  * Description: Event handler for adaptation events
  */
@@ -821,5 +820,5 @@
     }
     DEBUG_API("<-XARadioItfimpl_AdaptCb");
 }
-#endif
 
+