From 4cacdfcdf9fe578aa5276dd3e67a98a13ecf3dac Mon Sep 17 00:00:00 2001 From: sirmbcode Date: Sun, 31 May 2026 15:16:10 -0700 Subject: [PATCH] added calls to entity-parser.h for entity struct --- src/modules/module-avb/descriptors.c | 37 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/modules/module-avb/descriptors.c b/src/modules/module-avb/descriptors.c index b496d713d..ef20c7fc7 100644 --- a/src/modules/module-avb/descriptors.c +++ b/src/modules/module-avb/descriptors.c @@ -12,6 +12,7 @@ #include "es-builder.h" #include "entity-model-milan-v12.h" +#include "entity-parser.h" static void init_descriptor_legacy_avb(struct server *server) { @@ -331,35 +332,41 @@ static void init_descriptor_milan_v12(struct server *server) /**************************************************************************************/ /* IEEE 1722.1-2021, Sec. 7.2.1 - ENTITY Descriptor */ /* Milan v1.2, Sec. 5.3.3.1 */ + // TODO: Add changes made from prev + struct avb_entity_config entity_conf = conf_load_entity(server->impl->props); - es_builder_add_descriptor(server, AVB_AEM_DESC_ENTITY, 0, - sizeof(struct avb_aem_desc_entity), - &(struct avb_aem_desc_entity) + + struct avb_aem_desc_entity entity_desc = { .entity_id = htobe64(server->entity_id), .entity_model_id = htobe64(DSC_ENTITY_MODEL_ID), - .entity_capabilities = htonl(DSC_ENTITY_MODEL_ENTITY_CAPABILITIES), + .entity_capabilities = htonl(entity_conf.entity_capabilities), .talker_stream_sources = htons(DSC_ENTITY_MODEL_TALKER_STREAM_SOURCES), - .talker_capabilities = htons(DSC_ENTITY_MODEL_TALKER_CAPABILITIES), + .talker_capabilities = htons(entity_conf.talker_capabilities), .listener_stream_sinks = htons(DSC_ENTITY_MODEL_LISTENER_STREAM_SINKS), - .listener_capabilities = htons(DSC_ENTITY_MODEL_LISTENER_CAPABILITIES), + .listener_capabilities = htons(entity_conf.listener_capabilities), - .controller_capabilities = htons(DSC_ENTITY_MODEL_CONTROLLER_CAPABILITIES), + .controller_capabilities = htons(entity_conf.controller_capabilities), .available_index = htonl(DSC_ENTITY_MODEL_AVAILABLE_INDEX), .association_id = htobe64(DSC_ENTITY_MODEL_ASSOCIATION_ID), - .entity_name = DSC_ENTITY_MODEL_ENTITY_NAME, - .vendor_name_string = htons(DSC_ENTITY_MODEL_VENDOR_NAME_STRING), - .model_name_string = htons(DSC_ENTITY_MODEL_MODEL_NAME_STRING), - .firmware_version = DSC_ENTITY_MODEL_FIRMWARE_VERSION, - .group_name = DSC_ENTITY_MODEL_GROUP_NAME, - .serial_number = DSC_ENTITY_MODEL_SERIAL_NUMBER, + .vendor_name_string = htons(entity_conf.vendor_name), + .model_name_string = htons(entity_conf.model_name), .configurations_count = htons(DSC_ENTITY_MODEL_CONFIGURATIONS_COUNT), .current_configuration = htons(DSC_ENTITY_MODEL_CURRENT_CONFIGURATION) - }); + }; + + memcpy(entity_desc.entity_name, entity_conf.entity_name, sizeof(entity_desc.entity_name)); + memcpy(entity_desc.firmware_version, entity_conf.firmware_version, sizeof(entity_desc.firmware_version)); + memcpy(entity_desc.group_name, entity_conf.group_name, sizeof(entity_desc.group_name)); + memcpy(entity_desc.serial_number, entity_conf.serial_number, sizeof(entity_desc.serial_number)); + + es_builder_add_descriptor(server, AVB_AEM_DESC_ENTITY, 0, + sizeof(struct avb_aem_desc_entity), + &entity_desc); /**************************************************************************************/ /* IEEE 1722.1-2021, Sec. 7.2.2 - CONFIGURATION Descriptor*/ @@ -854,5 +861,5 @@ void init_descriptors(struct server *server) default: pw_log_error("Unknown AVB mode"); break; - } + } }