mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-29 06:46:38 -04:00
milan-avb: adjusting the msrp-domain to work accordingly to the milan specification
This commit is contained in:
parent
2746898e9a
commit
219adaa456
1 changed files with 28 additions and 3 deletions
|
|
@ -209,9 +209,34 @@ static int process_domain(struct msrp *msrp, uint64_t now, uint8_t attr_type,
|
|||
const void *m, uint8_t event, uint8_t param, int num)
|
||||
{
|
||||
struct attr *a;
|
||||
spa_list_for_each(a, &msrp->attributes, link)
|
||||
if (a->attr->type == attr_type)
|
||||
avb_mrp_attribute_rx_event(a->attr->mrp, now, event);
|
||||
const struct avb_packet_msrp_domain *d = m;
|
||||
|
||||
spa_list_for_each(a, &msrp->attributes, link) {
|
||||
if (a->attr->type != attr_type) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (msrp->server->avb_mode == AVB_MODE_MILAN_V12)
|
||||
{
|
||||
/** Milan V1.2 Section 4.2.7.2.1:
|
||||
The endstation shall re-adjust the domain according
|
||||
to the from the MSRPDU received on its interface */
|
||||
bool mismatch = (a->attr->attr.domain.sr_class_id != d->sr_class_id
|
||||
|| a->attr->attr.domain.sr_class_priority != d->sr_class_priority
|
||||
|| a->attr->attr.domain.sr_class_vid != d->sr_class_vid);
|
||||
|
||||
if (mismatch) {
|
||||
pw_log_info("Domain mismatch re-adjusting");
|
||||
a->attr->attr.domain = *d;
|
||||
avb_mrp_attribute_leave(a->attr->mrp, now);
|
||||
avb_mrp_attribute_begin(a->attr->mrp, now);
|
||||
avb_mrp_attribute_join(a->attr->mrp, now, true);
|
||||
}
|
||||
}
|
||||
|
||||
avb_mrp_attribute_rx_event(a->attr->mrp, now, event);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue