Lines Matching refs:halPort

743 status_t HidlUtils::audioPortFromHal(const struct audio_port& halPort, AudioPort* port) {  in audioUsageFromHal()  argument
745 audio_populate_audio_port_v7(&halPort, &halPortV7); in audioUsageFromHal()
749 status_t HidlUtils::audioPortToHal(const AudioPort& port, struct audio_port* halPort) { in audioUsageFromHal() argument
753 if (!audio_populate_audio_port(&halPortV7, halPort)) { in audioUsageFromHal()
759 status_t HidlUtils::audioPortFromHal(const struct audio_port_v7& halPort, AudioPort* port) { in audioUsageFromHal() argument
762 port->id = halPort.id; in audioUsageFromHal()
763 port->name.setToExternal(halPort.name, strlen(halPort.name)); in audioUsageFromHal()
769 switch (halPort.type) { in audioUsageFromHal()
773 halDevice.type = halPort.ext.device.type; in audioUsageFromHal()
774 memcpy(halDevice.address, halPort.ext.device.address, AUDIO_DEVICE_MAX_ADDRESS_LEN); in audioUsageFromHal()
777 halMix.handle = halPort.ext.mix.handle; in audioUsageFromHal()
780 halSession.session = halPort.ext.session.session; in audioUsageFromHal()
783 CONVERT_CHECKED(audioPortExtendedInfoFromHal(halPort.role, halPort.type, halDevice, halMix, in audioUsageFromHal()
786 CONVERT_CHECKED(audioTransportsFromHal(halPort, isInput, &port->transports), result); in audioUsageFromHal()
787 port->gains.resize(halPort.num_gains); in audioUsageFromHal()
788 for (size_t i = 0; i < halPort.num_gains; ++i) { in audioUsageFromHal()
789 CONVERT_CHECKED(audioGainFromHal(halPort.gains[i], isInput, &port->gains[i]), result); in audioUsageFromHal()
791 CONVERT_CHECKED(audioPortConfigFromHal(halPort.active_config, &port->activeConfig), result); in audioUsageFromHal()
795 status_t HidlUtils::audioPortToHal(const AudioPort& port, struct audio_port_v7* halPort) { in audioUsageFromHal() argument
797 halPort->id = port.id; in audioUsageFromHal()
798 strncpy(halPort->name, port.name.c_str(), AUDIO_PORT_MAX_NAME_LEN); in audioUsageFromHal()
799 halPort->name[AUDIO_PORT_MAX_NAME_LEN - 1] = '\0'; in audioUsageFromHal()
804 CONVERT_CHECKED(audioTransportsToHal(port.transports, halPort), result); in audioUsageFromHal()
805 halPort->num_gains = port.gains.size(); in audioUsageFromHal()
806 if (halPort->num_gains > AUDIO_PORT_MAX_GAINS) { in audioUsageFromHal()
807 ALOGE("HIDL Audio Port has too many gains: %u", halPort->num_gains); in audioUsageFromHal()
808 halPort->num_gains = AUDIO_PORT_MAX_GAINS; in audioUsageFromHal()
811 for (size_t i = 0; i < halPort->num_gains; ++i) { in audioUsageFromHal()
812 CONVERT_CHECKED(audioGainToHal(port.gains[i], &halPort->gains[i]), result); in audioUsageFromHal()
819 CONVERT_CHECKED(audioPortExtendedInfoToHal(port.ext, &halPort->role, &halPort->type, &halDevice, in audioUsageFromHal()
822 switch (halPort->type) { in audioUsageFromHal()
826 halPort->ext.device.type = halDevice.type; in audioUsageFromHal()
827 memcpy(halPort->ext.device.address, halDevice.address, AUDIO_DEVICE_MAX_ADDRESS_LEN); in audioUsageFromHal()
830 halPort->ext.mix.handle = halMix.handle; in audioUsageFromHal()
833 halPort->ext.session.session = halSession.session; in audioUsageFromHal()
836 CONVERT_CHECKED(audioPortConfigToHal(port.activeConfig, &halPort->active_config), result); in audioUsageFromHal()
840 status_t HidlUtils::audioTransportsFromHal(const struct audio_port_v7& halPort, bool isInput, in audioUsageFromHal() argument
842 if (halPort.num_audio_profiles > AUDIO_PORT_MAX_AUDIO_PROFILES || in audioUsageFromHal()
843 halPort.num_extra_audio_descriptors > AUDIO_PORT_MAX_EXTRA_AUDIO_DESCRIPTORS) { in audioUsageFromHal()
845 halPort.num_audio_profiles, halPort.num_extra_audio_descriptors); in audioUsageFromHal()
849 transports->resize(halPort.num_audio_profiles + halPort.num_extra_audio_descriptors); in audioUsageFromHal()
851 for (size_t i = 0; i < halPort.num_audio_profiles; ++i) { in audioUsageFromHal()
854 CONVERT_CHECKED(audioProfileFromHal(halPort.audio_profiles[i], isInput, in audioUsageFromHal()
857 CONVERT_CHECKED(encapsulationTypeFromHal(halPort.audio_profiles[i].encapsulation_type, in audioUsageFromHal()
861 for (size_t i = 0; i < halPort.num_extra_audio_descriptors; ++i) { in audioUsageFromHal()
862 switch (halPort.extra_audio_descriptors[i].standard) { in audioUsageFromHal()
865 &halPort.extra_audio_descriptors[i]; in audioUsageFromHal()
885 halPort.extra_audio_descriptors[i].standard); in audioUsageFromHal()
894 struct audio_port_v7* halPort) { in audioUsageFromHal() argument
896 halPort->num_audio_profiles = 0; in audioUsageFromHal()
897 halPort->num_extra_audio_descriptors = 0; in audioUsageFromHal()
901 if (halPort->num_audio_profiles >= AUDIO_PORT_MAX_AUDIO_PROFILES) { in audioUsageFromHal()
908 &halPort->audio_profiles[halPort->num_audio_profiles]), in audioUsageFromHal()
912 &halPort->audio_profiles[halPort->num_audio_profiles++] in audioUsageFromHal()
917 if (halPort->num_extra_audio_descriptors >= in audioUsageFromHal()
930 &halPort->extra_audio_descriptors[halPort->num_extra_audio_descriptors++]; in audioUsageFromHal()