summaryrefslogtreecommitdiffstats
path: root/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
diff options
context:
space:
mode:
Diffstat (limited to '4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c')
-rw-r--r--4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c b/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
index 4dbe35c..4d42b01 100644
--- a/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
+++ b/4a-hal-utilities/4a-hal-utilities-hal-streams-handler.c
@@ -232,6 +232,8 @@ struct CtlHalMixerData *HalUtlAddStreamDataAndCreateStreamVerb(AFB_ApiT apiHandl
char *verbToCall,
char *streamCardId)
{
+ json_object *streamAddedEventJ;
+
CtlConfigT *ctrlConfig;
struct SpecificHalData *currentSpecificHalData;
@@ -278,6 +280,14 @@ struct CtlHalMixerData *HalUtlAddStreamDataAndCreateStreamVerb(AFB_ApiT apiHandl
return NULL;
}
+ wrap_json_pack(&streamAddedEventJ,
+ "{s:s, s:s, s:s}",
+ "action", "added",
+ "name", createdStreamData->verb,
+ "cardId", createdStreamData->streamCardId);
+
+ AFB_EventPush(currentSpecificHalData->ctlHalSpecificData->streamUpdates, streamAddedEventJ);
+
return createdStreamData;
}
@@ -288,6 +298,8 @@ int8_t HalUtlRemoveStreamDataAndDeleteStreamVerb(AFB_ApiT apiHandle,
{
int8_t returnedErr = 0;
+ json_object *streamRemovedEventJ;
+
CtlConfigT *ctrlConfig;
struct SpecificHalData *currentSpecificHalData;
@@ -307,15 +319,25 @@ int8_t HalUtlRemoveStreamDataAndDeleteStreamVerb(AFB_ApiT apiHandle,
streamCardId)))
return -3;
+ wrap_json_pack(&streamRemovedEventJ,
+ "{s:s, s:s, s:s}",
+ "action", "removed",
+ "name", toRemoveStreamData->verb,
+ "cardId", toRemoveStreamData->streamCardId);
+
if(afb_api_del_verb(apiHandle, verb, NULL)) {
AFB_ApiError(apiHandle,"Error while deleting verb for stream : '%s'", verb);
+ json_object_put(streamRemovedEventJ);
return -4;
}
if((returnedErr = HalUtlRemoveSelectedMixerData(&currentSpecificHalData->ctlHalSpecificData->ctlHalStreamsData, toRemoveStreamData))) {
AFB_ApiError(apiHandle,"Error %i while removing data for stream : '%s'", returnedErr, verb);
+ json_object_put(streamRemovedEventJ);
return -5;
}
+ AFB_EventPush(currentSpecificHalData->ctlHalSpecificData->streamUpdates, streamRemovedEventJ);
+
return 0;
} \ No newline at end of file