diff options
Diffstat (limited to '4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c')
-rw-r--r-- | 4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c index 72f62dd..da05498 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-mixer-link.c @@ -26,6 +26,8 @@ #include "4a-hal-utilities-appfw-responses-handler.h" #include "4a-hal-utilities-data.h" + +#include "4a-hal-utilities-hal-streams-handler.h" #include "4a-hal-utilities-verbs-loader.h" #include "../4a-hal-manager/4a-hal-manager.h" @@ -91,47 +93,14 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerData **firstMix if(verbStart == size) verbStart = 0; - if(! (currentMixerData = HalUtlAddMixerDataToMixerDataList(firstMixerData))) { - AFB_ApiError(apiHandle, "Error while adding a stream to stream list"); - err += (int) MIXER_ERROR_STREAM_NOT_ADDED_TO_STREAM_LIST; - break; - } - - currentMixerData->verb = strdup(¤tDataVerbName[verbStart]); - currentMixerData->verbToCall = strdup(currentDataVerbName); - currentMixerData->streamCardId = strdup(currentStreamCardId); - - if((! currentMixerData->verb) || - (! currentMixerData->verbToCall) || - (! currentMixerData->streamCardId)) { - HalUtlRemoveSelectedMixerData(firstMixerData, currentMixerData); - err += (int) MIXER_ERROR_STREAM_ALLOCATION_FAILED; - break; - } - - if(AFB_ApiAddVerb(apiHandle, - currentMixerData->verb, - "Stream action transferred to mixer", - HalCtlsActionOnStream, - (void *) currentMixerData, - NULL, - 0, - 0)) { + if(! HalUtlAddStreamDataAndCreateStreamVerb(apiHandle, + ¤tDataVerbName[verbStart], + currentDataVerbName, + currentStreamCardId)) { AFB_ApiError(apiHandle, - "Error while creating verbs for stream : '%s'", - currentMixerData->verb); - HalUtlRemoveSelectedMixerData(firstMixerData, currentMixerData); - err += (int) MIXER_ERROR_STREAM_VERB_NOT_CREATED; - break; - } - - currentMixerData->event = AFB_EventMake(apiHandle, currentMixerData->verb); - if(! AFB_EventIsValid(currentMixerData->event)) { - AFB_ApiError(apiHandle, - "Error while creating event for stream %s", - currentMixerData->verb); - HalUtlRemoveSelectedMixerData(firstMixerData, currentMixerData); - err += (int) MIXER_ERROR_STREAM_EVENT_NOT_CREATED; + "Error while adding stream '%s'", + currentDataVerbName); + err += (int) MIXER_ERROR_STREAM_NOT_ADDED; } break; @@ -160,7 +129,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerData **firstMix if(AFB_ApiAddVerb(apiHandle, HAL_PLAYBACK_ID, "Playback action transferred to mixer", - HalCtlsActionOnPlayback, + HalUtlActionOnPlayback, (void *) *firstMixerData, NULL, 0, @@ -174,7 +143,7 @@ int HalCtlsHandleMixerData(AFB_ApiT apiHandle, struct CtlHalMixerData **firstMix if(AFB_ApiAddVerb(apiHandle, HAL_CAPTURE_ID, "Capture action transferred to mixer", - HalCtlsActionOnCapture, + HalUtlActionOnCapture, (void *) *firstMixerData, NULL, 0, @@ -218,7 +187,7 @@ int HalCtlsHandleMixerAttachResponse(AFB_ApiT apiHandle, struct CtlHalSpecificDa else if(AFB_ApiAddVerb(apiHandle, HAL_ALL_STREAMS_VERB, "Send a stream action on all streams", - HalCtlsActionOnAllStream, + HalUtlActionOnAllStream, (void *) currentHalSpecificData->ctlHalStreamsData, NULL, 0, |