khronosfws/openmax_al/src/outputmix/xaoutputmixitf.c
changeset 16 43d09473c595
parent 12 5a06f39ad45b
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "xaoutputmixitf.h"
    18 #include "xaoutputmixitf.h"
    19 #ifdef _GSTREAMER_BACKEND_
    19 
    20 #include "XAOutputMixItfAdaptation.h"
    20 #include "xaoutputmixitfadaptation.h"
    21 #endif
    21 
    22 #include <assert.h>
    22 #include <assert.h>
    23 #include "xathreadsafety.h"
    23 #include "xathreadsafety.h"
    24 #include "e32def.h"
    24 #include "e32def.h"
    25 /**
    25 /**
    26  * XAOutputMixtfImpl* GetImpl(XAOutputMixtfImpl self)
    26  * XAOutputMixtfImpl* GetImpl(XAOutputMixtfImpl self)
    63         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    63         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    64         DEBUG_API("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs");
    64         DEBUG_API("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs");
    65         return XA_RESULT_PARAMETER_INVALID;
    65         return XA_RESULT_PARAMETER_INVALID;
    66     }
    66     }
    67 
    67 
    68 #ifdef _GSTREAMER_BACKEND_
    68 
    69     ret = XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs(impl->adapCtx, pNumDevices, pDeviceIDs );
    69     ret = XAOutputMixItfAdapt_GetDestinationOutputDeviceIDs((XAAdaptationGstCtx*)impl->adapCtx, pNumDevices, pDeviceIDs );
    70 #endif
    70 
    71     XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
    71     XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
    72     DEBUG_API_A1("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs - pNumDevices %ld",*pNumDevices);
    72     DEBUG_API_A1("<-XAOutputMixItfImpl_GetDestinationOutputDeviceIDs - pNumDevices %ld",*pNumDevices);
    73     return ret;
    73     return ret;
    74 }
    74 }
    75 
    75 
    95 
    95 
    96    /* callback may be NULL (to remove callback) */
    96    /* callback may be NULL (to remove callback) */
    97    impl->callback = callback;
    97    impl->callback = callback;
    98    impl->cbContext = pContext;
    98    impl->cbContext = pContext;
    99    impl->cbPtrToSelf = self;
    99    impl->cbPtrToSelf = self;
   100 #ifdef _GSTREAMER_BACKEND_
   100 
   101    if(callback)
   101    if(callback)
   102    {   /* start listening */
   102    {   /* start listening */
   103        XAAdaptationBase_AddEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb, XA_OUTPUTMIXITFEVENTS, (void*)self );
   103        XAAdaptationBase_AddEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb, XA_OUTPUTMIXITFEVENTS, (void*)self );
   104    }
   104    }
   105    else
   105    else
   106    {   /* stop listening */
   106    {   /* stop listening */
   107        XAAdaptationBase_RemoveEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb );
   107        XAAdaptationBase_RemoveEventHandler( impl->adapCtx, &XAOutputMixItfImpl_AdaptCb );
   108    }
   108    }
   109 #endif
   109 
   110 
   110 
   111    DEBUG_API("<-XAOutputMixItfImpl_RegisterDeviceChangeCallback");
   111    DEBUG_API("<-XAOutputMixItfImpl_RegisterDeviceChangeCallback");
   112    return ret;
   112    return ret;
   113 }
   113 }
   114 
   114 
   133        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   133        DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   134        DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
   134        DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
   135        return XA_RESULT_PARAMETER_INVALID;
   135        return XA_RESULT_PARAMETER_INVALID;
   136    }
   136    }
   137 
   137 
   138 #ifdef _GSTREAMER_BACKEND_
   138 
   139    ret = XAOutputMixItfAdapt_ReRoute(impl->adapCtx, numOutputDevices, pOutputDeviceIDs );
   139    ret = XAOutputMixItfAdapt_ReRoute((XAAdaptationGstCtx*)impl->adapCtx, numOutputDevices, pOutputDeviceIDs );
   140 #endif
   140 
   141 
   141 
   142    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
   142    XA_IMPL_THREAD_SAFETY_EXIT(XATSOutputMix);
   143    DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
   143    DEBUG_API("<-XAOutputMixItfImpl_ReRoute");
   144    return ret;
   144    return ret;
   145 
   145 
   146 }
   146 }
   147 
   147 
   148 /**
   148 /**
   149  * XAVolumeItfImpl -specific methods
   149  * XAVolumeItfImpl -specific methods
   150  **/
   150  **/
   151 #ifdef _GSTREAMER_BACKEND_
   151 
   152 
   152 
   153 /*
   153 /*
   154  * XAOutputMixItfImpl* XAOutputMixItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
   154  * XAOutputMixItfImpl* XAOutputMixItfImpl_Create(XAAdaptationBaseCtx *adapCtx)
   155  * Description: Creates new Output mix itf implmementation
   155  * Description: Creates new Output mix itf implmementation
   156  */
   156  */
   221         impl->callback(impl->cbPtrToSelf, impl->cbContext);
   221         impl->callback(impl->cbPtrToSelf, impl->cbContext);
   222      }
   222      }
   223 
   223 
   224      DEBUG_API("<-XAOutputMixItfImpl_AdaptCb");
   224      DEBUG_API("<-XAOutputMixItfImpl_AdaptCb");
   225 }
   225 }
   226 #endif
   226