mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-01 06:46:47 -04:00
milan-avb: hook stream output to MSRP listener_observed + add max_transit_time_ns
This commit is contained in:
parent
a5fbeef6f8
commit
197bab7931
2 changed files with 28 additions and 4 deletions
|
|
@ -219,6 +219,15 @@ struct aecp_aem_stream_output_state {
|
|||
* MSRP_ACC_LAT_VALID flag. Range 0 .. 0x7FFFFFFF. */
|
||||
uint32_t presentation_time_offset_ns;
|
||||
|
||||
/** IEEE 1722.1-2021 Section 7.4.39 max_transit_time, nanoseconds. The maximum
|
||||
* time between an AVTP frame's transmission by this Talker and its
|
||||
* consumption by any Listener. Read by stream_activate() to seed
|
||||
* stream->mtt (the per-PDU presentation_time = txtime + mtt) and by
|
||||
* GET_MAX_TRANSIT_TIME; updated by SET_MAX_TRANSIT_TIME. Default
|
||||
* 2_000_000 (2 ms) — kept in sync with presentation_time_offset_ns
|
||||
* until the two opcodes are wired up to set them independently. */
|
||||
uint64_t max_transit_time_ns;
|
||||
|
||||
bool stream_info_dirty;
|
||||
|
||||
/* Milan Section 5.4.5 counter unsolicited rate-limit (see avb_interface_state). */
|
||||
|
|
|
|||
|
|
@ -222,12 +222,27 @@ static void notify_listener(struct msrp *msrp, uint64_t now, struct attr *attr,
|
|||
else if (notify == AVB_MRP_NOTIFY_LEAVE)
|
||||
stream_out->listener_observed = false;
|
||||
|
||||
/* listener_observed flips flags_ex.REGISTERING in the
|
||||
* GET_STREAM_INFO answer (Milan Table 5.12). Hint AECP to
|
||||
* re-emit so controllers see the update. */
|
||||
if (prev != stream_out->listener_observed)
|
||||
if (prev != stream_out->listener_observed) {
|
||||
/* listener_observed flips flags_ex.REGISTERING in the
|
||||
* GET_STREAM_INFO answer (Milan Table 5.12). Hint AECP
|
||||
* to re-emit so controllers see the update. */
|
||||
avb_aecp_aem_mark_stream_info_dirty(msrp->server,
|
||||
AVB_AEM_DESC_STREAM_OUTPUT, s->index);
|
||||
|
||||
/* Milan Section 4.3.3.1: a foreign Listener registration is the
|
||||
* "matching declaration" condition for starting AVTP TX.
|
||||
* Activate the data plane on false→true; tear it down on
|
||||
* true→false. The internal source/!source guards make the
|
||||
* calls idempotent against the listener_observed bit, so a
|
||||
* spurious flip won't double-start. */
|
||||
if (stream_out->listener_observed) {
|
||||
if (s->source == NULL)
|
||||
stream_activate(s, s->index, now);
|
||||
} else {
|
||||
if (s->source != NULL)
|
||||
stream_deactivate(s, now);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue