diff options
author | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-04-18 11:42:41 +0200 |
---|---|---|
committer | Jonathan Aillet <jonathan.aillet@iot.bzh> | 2019-05-24 16:35:06 +0200 |
commit | 95a00389d224939e809f651cb095c3ecbf594c56 (patch) | |
tree | 6013a33a0cf17c89b5e7b6a3ce95ee6cdd266e14 /lib/4a-hal-utilities/4a-hal-utilities-data.h | |
parent | fc650808aef4b161490d0997be621f17377be684 (diff) |
Add function to handle probed audio device list
Add function to handle probed audio device list.
This list will be used to store incoming 'haldependencies'
section data. It will also be used to store audio card information
resulting from probing requested audio devices specified
in 'haldependencies' section.
BUG-AGL: SPEC-2329
Change-Id: Iaa9aaba7a01263ca2d17be01c32803702568d614
Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to 'lib/4a-hal-utilities/4a-hal-utilities-data.h')
-rw-r--r-- | lib/4a-hal-utilities/4a-hal-utilities-data.h | 47 |
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); |