mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
module-rtp: add framecount to the SDP
Required for RAVENNA hardware. Co-authored-by: Dewi Seignard <dewiweb@gmail.com>
This commit is contained in:
parent
8c4cfa57b6
commit
533161a766
2 changed files with 13 additions and 1 deletions
|
|
@ -183,6 +183,7 @@ struct sdp_info {
|
|||
uint32_t channels;
|
||||
|
||||
float ptime;
|
||||
uint32_t framecount;
|
||||
|
||||
uint32_t ts_offset;
|
||||
char *ts_refclk;
|
||||
|
|
@ -568,6 +569,10 @@ static int send_sap(struct impl *impl, struct session *sess, bool bye)
|
|||
spa_strbuf_append(&buf,
|
||||
"a=ptime:%.6g\n", sdp->ptime);
|
||||
|
||||
if (sdp->framecount > 0)
|
||||
spa_strbuf_append(&buf,
|
||||
"a=framecount:%u\n", sdp->framecount);
|
||||
|
||||
if (sdp->ts_refclk != NULL) {
|
||||
spa_strbuf_append(&buf,
|
||||
"a=ts-refclk:%s\n"
|
||||
|
|
@ -691,6 +696,10 @@ static struct session *session_new_announce(struct impl *impl, struct node *node
|
|||
if (!spa_atof(str, &sdp->ptime))
|
||||
sdp->ptime = 0.0;
|
||||
|
||||
if ((str = pw_properties_get(props, "rtp.framecount")) != NULL)
|
||||
if (!spa_atou32(str, &sdp->framecount))
|
||||
sdp->framecount = 0;
|
||||
|
||||
if ((str = pw_properties_get(props, "rtp.media")) != NULL)
|
||||
sdp->media_type = strdup(str);
|
||||
if ((str = pw_properties_get(props, "rtp.mime")) != NULL)
|
||||
|
|
|
|||
|
|
@ -421,10 +421,13 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
|||
} else {
|
||||
impl->psamples = impl->mtu / impl->stride;
|
||||
impl->psamples = SPA_CLAMP(impl->psamples, min_samples, max_samples);
|
||||
if (direction == PW_DIRECTION_INPUT)
|
||||
if (direction == PW_DIRECTION_INPUT) {
|
||||
pw_properties_set(props, "rtp.ptime",
|
||||
spa_dtoa(tmp, sizeof(tmp),
|
||||
impl->psamples * 1000.0 / impl->rate));
|
||||
|
||||
pw_properties_setf(props, "rtp.framecount", "%u", impl->psamples);
|
||||
}
|
||||
}
|
||||
latency_msec = pw_properties_get_uint32(props,
|
||||
"sess.latency.msec", DEFAULT_SESS_LATENCY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue