summaryrefslogtreecommitdiffstats
path: root/lib/4a-hal-utilities/4a-hal-utilities-data.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.h')
-rw-r--r--lib/4a-hal-utilities/4a-hal-utilities-data.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/4a-hal-utilities/4a-hal-utilities-data.h b/lib/4a-hal-utilities/4a-hal-utilities-data.h
index dd89078..c072650 100644
--- a/lib/4a-hal-utilities/4a-hal-utilities-data.h
+++ b/lib/4a-hal-utilities/4a-hal-utilities-data.h
@@ -28,6 +28,8 @@
#include "4a-hal-utilities-alsa-data.h"
+#define HAL_UNKNOWN_DEVICE -1
+
#define HAL_STREAM_UPDATES_EVENT_NAME "stream-updates"
// Enum for hal status
@@ -37,6 +39,40 @@ enum HalStatus {
HAL_STATUS_READY=2
};
+// Enum for probed devices (dependencies) class
+enum ProbedDeviceClasses {
+ INVALID_PROBED_DEVICE=0,
+ STATIC_PROBED_DEVICE=1,
+ DYNAMIC_PROBED_DEVICE=2,
+ MANDATORY_PROBED_DEVICE=3
+};
+
+// Structure to store data for audio devices validated by dependencies
+struct InternalHalDeviceData {
+ int cardNb;
+ char *cardId;
+ char *cardShortName;
+ char *cardLongName;
+ char *cardDriver;
+ char *cardMixerName;
+ char *cardComponents;
+ int playbackDeviceNb;
+ char *playbackDeviceId;
+ char *playbackDeviceName;
+ char *extendedCardNb;
+};
+
+// Structure to store one provided dependency
+struct InternalHalProbedDevice {
+ char *uid;
+ enum ProbedDeviceClasses deviceClass;
+ json_object *requestedDeviceJ;
+
+ struct InternalHalDeviceData *deviceData;
+
+ struct InternalHalProbedDevice *next;
+};
+
// Structure to store stream data
struct InternalHalMixerData {
char *verb;
@@ -53,6 +89,8 @@ struct InternalHalData {
char *prefix;
json_object *halMixerJ;
+ struct InternalHalProbedDevice *probedDevicesList;
+
struct InternalHalMixerData *streamsData;
afb_event_t streamUpdates;
@@ -92,6 +130,15 @@ struct HalMgrData {
struct HalData *halDataList;
};
+// Internal Hal - Probed devices structure handling functions
+enum ProbedDeviceClasses HalUtlGetProbedDeviceClassFromString(char *probedDeviceString);
+struct InternalHalProbedDevice *HalUtlAddProbedDeviceToProbedDeviceList(struct InternalHalProbedDevice **probedDevicesList);
+int HalUtlRemoveSelectedProbedDeviceFromList(struct InternalHalProbedDevice **probedDevicesList, struct InternalHalProbedDevice *probedDeviceToRemove);
+int HalUtlRemoveAllProbedDevicesFromList(struct InternalHalProbedDevice **probedDevicesList);
+int HalUtlGetNumberOfProbedDevicesInList(struct InternalHalProbedDevice **probedDevicesList);
+struct InternalHalProbedDevice *HalUtlSearchProbedDeviceDataById(struct InternalHalProbedDevice **probedDevicesList, char *uid);
+struct InternalHalDeviceData *HalUtlAllocateAndFillProbedDeviceDataUsingInfoGetResponse(json_object *responseJ);
+
// Internal Hal - Streams data handling functions
struct InternalHalMixerData *HalUtlAddMixerDataToMixerDataList(struct InternalHalMixerData **mixerDataList);
int HalUtlRemoveSelectedMixerData(struct InternalHalMixerData **mixerDataList, struct InternalHalMixerData *mixerDataToRemove);