summaryrefslogtreecommitdiffstats
path: root/4a-hal-utilities/4a-hal-utilities-data.h
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2019-01-10 09:49:24 +0100
committerJonathan Aillet <jonathan.aillet@iot.bzh>2019-01-28 15:38:43 +0100
commite3f74a9f59c05df601aa26554612fc68901c1646 (patch)
treede604ee593e46f57595a068dc261e048defd7668 /4a-hal-utilities/4a-hal-utilities-data.h
parent4f44ee8f17789ac27cd1e29a451ac450c7dbeb06 (diff)
Use linked-list to handle hal stream list
Use linked-list instead of an array to handle hal stream list. Usefull to add/remove dynamic stream (e.g. bluetooth). Change-Id: I39bbf0f16941f1c4642c916fdc5143a683c6460c Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal-utilities/4a-hal-utilities-data.h')
-rw-r--r--4a-hal-utilities/4a-hal-utilities-data.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/4a-hal-utilities/4a-hal-utilities-data.h b/4a-hal-utilities/4a-hal-utilities-data.h
index 031fa9b..a2f1f1a 100644
--- a/4a-hal-utilities/4a-hal-utilities-data.h
+++ b/4a-hal-utilities/4a-hal-utilities-data.h
@@ -41,12 +41,8 @@ struct CtlHalMixerData {
char *verbToCall;
char *streamCardId;
AFB_EventT event;
-};
-// Structure to store stream data table
-struct CtlHalMixerDataT {
- struct CtlHalMixerData *data;
- unsigned int count;
+ struct CtlHalMixerData *next;
};
// Structure to store specific controller hal data
@@ -55,9 +51,11 @@ struct CtlHalSpecificData {
char *prefix;
json_object *halMixerJ;
- struct CtlHalMixerDataT ctlHalStreamsData;
- struct CtlHalMixerDataT ctlHalPlaybacksData;
- struct CtlHalMixerDataT ctlHalCapturesData;
+ struct CtlHalMixerData *ctlHalStreamsData;
+
+ struct CtlHalMixerData *ctlHalPlaybacksData;
+ struct CtlHalMixerData *ctlHalCapturesData;
+
struct CtlHalAlsaMapT *ctlHalAlsaMapT;
AFB_ApiT apiHandle;
@@ -93,6 +91,13 @@ struct HalMgrData {
struct SpecificHalData *first;
};
+// Specfic Hal controller streams data handling functions
+struct CtlHalMixerData *HalUtlAddMixerDataToMixerDataList(struct CtlHalMixerData **firstMixerData);
+int8_t HalUtlRemoveSelectedMixerData(struct CtlHalMixerData **firstMixerData, struct CtlHalMixerData *mixerDataToRemove);
+int64_t HalUtlRemoveAllMixerData(struct CtlHalMixerData **firstMixerData);
+int64_t HalUtlGetNumberOfMixerDataInList(struct CtlHalMixerData **firstMixerData);
+struct CtlHalMixerData *HalUtlSearchMixerDataByProperties(struct CtlHalMixerData **firstMixerData, char *verb, char *verbToCall, char *streamCardId);
+
// Exported verbs for 'struct SpecificHalData' handling
struct SpecificHalData *HalUtlAddHalApiToHalList(struct SpecificHalData **firstHalData);
int8_t HalUtlRemoveSelectedHalFromList(struct SpecificHalData **firstHalData, struct SpecificHalData *ApiToRemove);