module-rtp-sap: Publish sender SSRC if we have it

Can be handy on the receiver side.
This commit is contained in:
Arun Raghavan 2025-02-15 15:51:06 -05:00
parent dbf0442c7e
commit 13e3918f81
2 changed files with 9 additions and 0 deletions

View file

@ -207,6 +207,7 @@ struct sdp_info {
float ptime;
uint32_t framecount;
uint32_t ssrc;
uint32_t ts_offset;
char *ts_refclk;
};
@ -732,6 +733,9 @@ static int make_sdp(struct impl *impl, struct session *sess, char *buffer, size_
"a=source-filter: incl IN %s %s %s\n", dst_ip4 ? "IP4" : "IP6",
dst_addr, src_addr);
if (sdp->ssrc > 0)
spa_strbuf_append(&buf, "a=ssrc:%u\n", sdp->ssrc);
if (sdp->ptime > 0)
spa_strbuf_append(&buf,
"a=ptime:%.6g\n", sdp->ptime);
@ -991,6 +995,10 @@ static struct session *session_new_announce(struct impl *impl, struct node *node
sdp->rate = atoi(str);
if ((str = pw_properties_get(props, "rtp.channels")) != NULL)
sdp->channels = atoi(str);
if ((str = pw_properties_get(props, "rtp.ssrc")) != NULL)
sdp->ssrc = atoi(str);
else
sdp->ssrc = 0;
if ((str = pw_properties_get(props, "rtp.ts-offset")) != NULL)
sdp->ts_offset = atoi(str);
str = pw_properties_get(props, "rtp.ts-refclk");

View file

@ -547,6 +547,7 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
pw_properties_setf(props, "rtp.media", "%s", impl->format_info->media_type);
pw_properties_setf(props, "rtp.mime", "%s", impl->format_info->mime);
pw_properties_setf(props, "rtp.payload", "%u", impl->payload);
pw_properties_setf(props, "rtp.ssrc", "%u", impl->ssrc);
pw_properties_setf(props, "rtp.rate", "%u", impl->rate);
if (impl->info.info.raw.channels > 0)
pw_properties_setf(props, "rtp.channels", "%u", impl->info.info.raw.channels);