mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
rtp: add option to ignore SSRC
This is useful when there is a fixed receiver and the sender can be restarted.
This commit is contained in:
parent
b95ed6dcc1
commit
126e03ec73
4 changed files with 5 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ static int rtp_audio_receive(struct impl *impl, uint8_t *buffer, ssize_t len)
|
||||||
if (impl->have_ssrc && impl->ssrc != hdr->ssrc)
|
if (impl->have_ssrc && impl->ssrc != hdr->ssrc)
|
||||||
goto unexpected_ssrc;
|
goto unexpected_ssrc;
|
||||||
impl->ssrc = hdr->ssrc;
|
impl->ssrc = hdr->ssrc;
|
||||||
impl->have_ssrc = true;
|
impl->have_ssrc = !impl->ignore_ssrc;
|
||||||
|
|
||||||
seq = ntohs(hdr->sequence_number);
|
seq = ntohs(hdr->sequence_number);
|
||||||
if (impl->have_seq && impl->seq != seq) {
|
if (impl->have_seq && impl->seq != seq) {
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ static int rtp_midi_receive(struct impl *impl, uint8_t *buffer, ssize_t len)
|
||||||
if (impl->have_ssrc && impl->ssrc != hdr->ssrc)
|
if (impl->have_ssrc && impl->ssrc != hdr->ssrc)
|
||||||
goto unexpected_ssrc;
|
goto unexpected_ssrc;
|
||||||
impl->ssrc = hdr->ssrc;
|
impl->ssrc = hdr->ssrc;
|
||||||
impl->have_ssrc = true;
|
impl->have_ssrc = !impl->ignore_ssrc;
|
||||||
|
|
||||||
seq = ntohs(hdr->sequence_number);
|
seq = ntohs(hdr->sequence_number);
|
||||||
if (impl->have_seq && impl->seq != seq) {
|
if (impl->have_seq && impl->seq != seq) {
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ static int rtp_opus_receive(struct impl *impl, uint8_t *buffer, ssize_t len)
|
||||||
if (impl->have_ssrc && impl->ssrc != hdr->ssrc)
|
if (impl->have_ssrc && impl->ssrc != hdr->ssrc)
|
||||||
goto unexpected_ssrc;
|
goto unexpected_ssrc;
|
||||||
impl->ssrc = hdr->ssrc;
|
impl->ssrc = hdr->ssrc;
|
||||||
impl->have_ssrc = true;
|
impl->have_ssrc = !impl->ignore_ssrc;
|
||||||
|
|
||||||
seq = ntohs(hdr->sequence_number);
|
seq = ntohs(hdr->sequence_number);
|
||||||
if (impl->have_seq && impl->seq != seq) {
|
if (impl->have_seq && impl->seq != seq) {
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ struct impl {
|
||||||
uint32_t ssrc;
|
uint32_t ssrc;
|
||||||
uint16_t seq;
|
uint16_t seq;
|
||||||
unsigned have_ssrc:1;
|
unsigned have_ssrc:1;
|
||||||
|
unsigned ignore_ssrc:1;
|
||||||
unsigned have_seq:1;
|
unsigned have_seq:1;
|
||||||
uint32_t ts_offset;
|
uint32_t ts_offset;
|
||||||
uint32_t psamples;
|
uint32_t psamples;
|
||||||
|
|
@ -363,6 +364,7 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
||||||
if (pw_properties_get(props, PW_KEY_NODE_NETWORK) == NULL)
|
if (pw_properties_get(props, PW_KEY_NODE_NETWORK) == NULL)
|
||||||
pw_properties_set(props, PW_KEY_NODE_NETWORK, "true");
|
pw_properties_set(props, PW_KEY_NODE_NETWORK, "true");
|
||||||
|
|
||||||
|
impl->ignore_ssrc = pw_properties_get_bool(props, "sess.ignore-ssrc", false);
|
||||||
impl->direct_timestamp = pw_properties_get_bool(props, "sess.ts-direct", false);
|
impl->direct_timestamp = pw_properties_get_bool(props, "sess.ts-direct", false);
|
||||||
|
|
||||||
if (direction == PW_DIRECTION_INPUT) {
|
if (direction == PW_DIRECTION_INPUT) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue