added calls to entity-parser.h for entity struct

This commit is contained in:
sirmbcode 2026-05-31 15:16:10 -07:00 committed by Wim Taymans
parent 55172b92f9
commit 4cacdfcdf9

View file

@ -12,6 +12,7 @@
#include "es-builder.h" #include "es-builder.h"
#include "entity-model-milan-v12.h" #include "entity-model-milan-v12.h"
#include "entity-parser.h"
static void init_descriptor_legacy_avb(struct server *server) 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 */ /* IEEE 1722.1-2021, Sec. 7.2.1 - ENTITY Descriptor */
/* Milan v1.2, Sec. 5.3.3.1 */ /* 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 entity_desc =
&(struct avb_aem_desc_entity)
{ {
.entity_id = htobe64(server->entity_id), .entity_id = htobe64(server->entity_id),
.entity_model_id = htobe64(DSC_ENTITY_MODEL_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_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_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), .available_index = htonl(DSC_ENTITY_MODEL_AVAILABLE_INDEX),
.association_id = htobe64(DSC_ENTITY_MODEL_ASSOCIATION_ID), .association_id = htobe64(DSC_ENTITY_MODEL_ASSOCIATION_ID),
.entity_name = DSC_ENTITY_MODEL_ENTITY_NAME, .vendor_name_string = htons(entity_conf.vendor_name),
.vendor_name_string = htons(DSC_ENTITY_MODEL_VENDOR_NAME_STRING), .model_name_string = htons(entity_conf.model_name),
.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,
.configurations_count = htons(DSC_ENTITY_MODEL_CONFIGURATIONS_COUNT), .configurations_count = htons(DSC_ENTITY_MODEL_CONFIGURATIONS_COUNT),
.current_configuration = htons(DSC_ENTITY_MODEL_CURRENT_CONFIGURATION) .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*/ /* IEEE 1722.1-2021, Sec. 7.2.2 - CONFIGURATION Descriptor*/
@ -854,5 +861,5 @@ void init_descriptors(struct server *server)
default: default:
pw_log_error("Unknown AVB mode"); pw_log_error("Unknown AVB mode");
break; break;
} }
} }