From fd747d088da861367bfd4f4199244e87310f3f38 Mon Sep 17 00:00:00 2001 From: Nicolas Tizon Date: Wed, 7 Aug 2024 17:27:04 +0200 Subject: [PATCH] fixe merge --- cmake/modules.cmake | 2 +- include/baresip.h | 1 - src/call.c | 2 +- src/config.c | 4 +++- src/core.h | 1 + src/rtprecv.c | 12 +++++++++++- src/stream.c | 11 +++-------- 7 files changed, 20 insertions(+), 13 deletions(-) diff --git a/cmake/modules.cmake b/cmake/modules.cmake index 1a35bce6f1..e7d3ebbd72 100644 --- a/cmake/modules.cmake +++ b/cmake/modules.cmake @@ -84,7 +84,7 @@ set(MODULES wincons winwave x11 - x11_grab + x11grab CACHE STRING "List of modules like 'turn;pipewire;alsa'" ) diff --git a/include/baresip.h b/include/baresip.h index 58db58f4ba..d46d875ff7 100644 --- a/include/baresip.h +++ b/include/baresip.h @@ -1462,7 +1462,6 @@ const char *video_get_disp_dev(const struct video *v); int video_debug(struct re_printf *pf, const struct video *v); struct stream *video_strm(const struct video *v); const struct vidcodec *video_codec(const struct video *vid, bool tx); -void video_encode_refresh(struct video *v); void video_sdp_attr_decode(struct video *v); void video_req_keyframe(struct video *vid); diff --git a/src/call.c b/src/call.c index e44f16d395..acebe29f32 100644 --- a/src/call.c +++ b/src/call.c @@ -2074,7 +2074,7 @@ static void call_handle_info_req(struct call *call, const struct sip_msg *req) /* Poor-mans XML parsing */ if (0 == re_regex(body.p, body.l, "picture_fast_update")) { debug("call: receive media control: fast_update=%d\n"); - video_encode_refresh(call->video); + video_req_keyframe(call->video); } } diff --git a/src/config.c b/src/config.c index b5413fb9b1..02e69ded2b 100644 --- a/src/config.c +++ b/src/config.c @@ -77,6 +77,8 @@ static struct config core_config = { "", "", 640, 480, 1000000, + 0, + 0, 30, true, VID_FMT_YUV420P, @@ -793,7 +795,7 @@ int config_print(struct re_printf *pf, const struct config *cfg) rtp_receive_mode_str(cfg->avt.rxmode), cfg->net.ifname, - net_af_str(cfg->net.af) + net_af_str(cfg->net.af), cfg->bfcp.proto, cfg->bfcp.floorctrl diff --git a/src/core.h b/src/core.h index 30eb480154..ebe1f022a1 100644 --- a/src/core.h +++ b/src/core.h @@ -527,6 +527,7 @@ void rtprecv_set_socket(struct rtp_receiver *rx, struct rtp_sock *rtp); void rtprecv_set_ssrc(struct rtp_receiver *rx, uint32_t ssrc); uint64_t rtprecv_ts_last(struct rtp_receiver *rx); void rtprecv_set_ts_last(struct rtp_receiver *rx, uint64_t ts_last); +void rtprecv_set_estab(struct rtp_receiver *rx, bool estab); void rtprecv_flush(struct rtp_receiver *rx); void rtprecv_enable(struct rtp_receiver *rx, bool enable); int rtprecv_get_ssrc(struct rtp_receiver *rx, uint32_t *ssrc); diff --git a/src/rtprecv.c b/src/rtprecv.c index a3c4cfb902..3733b8607b 100644 --- a/src/rtprecv.c +++ b/src/rtprecv.c @@ -478,7 +478,7 @@ void rtprecv_handle_rtcp(const struct sa *src, struct rtcp_msg *msg, return; } - rx->ts_last = tmr_jiffies(); + //rx->ts_last = tmr_jiffies(); mtx_unlock(rx->mtx); pass_rtcp_work(rx, msg); @@ -578,6 +578,16 @@ void rtprecv_set_ts_last(struct rtp_receiver *rx, uint64_t ts_last) mtx_unlock(rx->mtx); } +void rtprecv_set_estab(struct rtp_receiver *rx, bool estab) +{ + if (!rx) + return; + + mtx_lock(rx->mtx); + rx->rtp_estab = estab; + mtx_unlock(rx->mtx); +} + void rtprecv_flush(struct rtp_receiver *rx) { diff --git a/src/stream.c b/src/stream.c index 72db75b98a..42dee8fb70 100644 --- a/src/stream.c +++ b/src/stream.c @@ -284,9 +284,9 @@ static void stream_close(struct stream *strm, int err) strm->terminated = true; stream_enable(strm, false); strm->errorh = NULL; - strm->rx.rtp_estab = false; - jbuf_flush(strm->rx.jbuf); + rtprecv_set_estab(strm->rx, false); + rtprecv_flush(strm->rx); strm->rx = mem_deref(strm->rx); if (errorh) @@ -1562,12 +1562,7 @@ const struct sa *stream_raddr(const struct stream *strm) uint64_t stream_rx_ts_last(const struct stream *strm) { - if (!strm) - return 0; - if (!strm->rx.ts_last) - return 0; - - return strm->rx.ts_last; + return rtprecv_ts_last(strm->rx); }