Add AudioTransport to replace AudioProfile in AudioPort.
An AudioTransport contains AudioProfile or hardware descriptor to
describe the audio capabilities for an AudioPort and the encapsulation
type to represent the encapsualtion format that must be used when
sending the audio data with the format associated the AudioTransport to
Android.
The hardware descriptor will be used when the format is not recognized
by the platform.
Currently, the short audio descriptor is added as one of the hardware
descriptors. Short audio descriptor is reported from EDID for HDMI.
Bug: 131736540
Bug: 178619392
Test: atest android.hardware.audio.common@7.0-util_tests
Test: atest VtsHalAudioV7_0TargetTest
Change-Id: Ic5ed9ff9b694511fdd7e90cdcda2777bdfa74f65
diff --git a/audio/common/all-versions/default/HidlUtils.h b/audio/common/all-versions/default/HidlUtils.h
index dd4ca4d..98ecc07 100644
--- a/audio/common/all-versions/default/HidlUtils.h
+++ b/audio/common/all-versions/default/HidlUtils.h
@@ -126,6 +126,10 @@
static hidl_vec<AudioTag> filterOutNonVendorTags(const hidl_vec<AudioTag>& tags);
static std::vector<std::string> filterOutNonVendorTags(const std::vector<std::string>& tags);
static std::vector<std::string> splitAudioTags(const char* halTags);
+ static status_t audioTransportsFromHal(const struct audio_port_v7& halPort, bool isInput,
+ hidl_vec<AudioTransport>* transports);
+ static status_t audioTransportsToHal(const hidl_vec<AudioTransport>& transports,
+ struct audio_port_v7* halTransport);
private:
static status_t audioIndexChannelMaskFromHal(audio_channel_mask_t halChannelMask,
@@ -145,6 +149,10 @@
struct audio_port_config_device_ext* device,
struct audio_port_config_mix_ext* mix,
struct audio_port_config_session_ext* session);
+ static status_t encapsulationTypeFromHal(audio_encapsulation_type_t halEncapsulationType,
+ AudioEncapsulationType* encapsulationType);
+ static status_t encapsulationTypeToHal(const AudioEncapsulationType& encapsulationType,
+ audio_encapsulation_type_t* halEncapsulationType);
#endif // MAJOR_VERSION >= 7