Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bfcp #2

Open
wants to merge 39 commits into
base: test_merge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c4d68cf
[Added] x11grab source
Jul 2, 2022
5471296
[Changed] RTCP FIR from rfc5104
nicotyze Dec 5, 2022
80f9435
[Added] support of EVEN-PORT + RESERVATION-TOKEN based negociation fo…
nicotyze Dec 7, 2022
0f73868
[Added] multi-threading support in avcodec/decode
nicotyze Dec 9, 2022
7f53f65
Merge pull request #1 from Renater/v2.5.0_x11grab
nicotyze Dec 9, 2022
4ebd23a
[Changed] multi-threading support in avcodec/decode
nicotyze Dec 12, 2022
53825cf
[Added] x11grab cmake
nicotyze Dec 13, 2022
39b9552
[Added] public address configuration parameter
nicotyze Dec 18, 2022
6813343
[Added] RTP stats in Audio/Video debug
nicotyze Dec 30, 2022
23b5dd9
[Removed] multi-threading support in avcodec/decode
nicotyze Jan 4, 2023
6a6c07f
[Added] SIP media control
nicotyze Jan 5, 2023
ba0765c
[Fixed] SIP media control
nicotyze Jan 6, 2023
ae091c1
[Removed] RTCP FIR from rfc5104
nicotyze Jan 6, 2023
b681613
[Fixed] SIP media control
nicotyze Jan 9, 2023
07fbedb
[Added] content parameter for video display
nicotyze Mar 10, 2023
5896599
[Added] display geometry parameters
nicotyze Mar 10, 2023
a2b3125
[Added] basic BFCP implementation
nicotyze Mar 10, 2023
7f41c0c
[Added] basic BFCP implementation
nicotyze Mar 15, 2023
8e9fb5c
[Added] UA_EVENT_CALL_BFCP
nicotyze Mar 20, 2023
1eb9d65
[Added] bfcp_floorctrl configuration parameter
nicotyze Mar 21, 2023
754f1bb
[Added] BFCP call flow experiments
nicotyze Apr 3, 2023
4a94b9b
[Fixed] BFCP call flow experiments
nicotyze Apr 3, 2023
9e83717
[Fixed] BFCP call flow experiments
nicotyze Apr 3, 2023
e568ef0
[Added] video fmtp append
nicotyze Apr 6, 2023
a7ef276
[Fixed] slides video stream management
nicotyze Apr 27, 2023
a91b6b4
[Removed] UA_EVENT_CALL_BFCP
nicotyze Apr 27, 2023
228e4bc
[Added] UA_EVENT_CALL_VIDEO_DISP
nicotyze Apr 27, 2023
e6093d2
[Fixed] UA_EVENT_CALL_VIDEO_DISP
nicotyze May 11, 2023
10c7031
[Added] video slides configuration
nicotyze May 26, 2023
c540262
[Added] media_stream parameter to picture_fast_update requests
nicotyze May 31, 2023
a5c9d71
[Fixed] 'video_bis' to 'slides' renaming
nicotyze May 31, 2023
1e54789
[Added] specific 'check slides stream' logic
nicotyze Jun 1, 2023
068c013
[Added] feedback waiting for Picture Fast Update
nicotyze Jun 27, 2023
a7116f5
[Fixed] logic of Picture Fast Update requests
nicotyze Jun 27, 2023
5a35c35
[Fixed] slides video stream management
nicotyze Jun 28, 2023
b33c2f1
[Fixed] RTP timeout for video slides stream
nicotyze Jun 29, 2023
a9037c3
[Added] BFCP primitives handling
nicotyze Sep 13, 2023
2a0bbe5
[Fixed] BFCP primitives handling
nicotyze Dec 4, 2023
362590f
[Added] preferred SRTP ciphering algorithm as configuration parameter
nicotyze Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ set(SRCS
src/auplay.c
src/ausrc.c
src/baresip.c
src/bfcp.c
src/bundle.c
src/call.c
src/cmd.c
Expand Down
1 change: 1 addition & 0 deletions cmake/modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ if(WEBRTC_AECM_FOUND)
endif()
if(X11_XShm_FOUND)
list(APPEND MODULES x11)
list(APPEND MODULES x11grab)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND MODULES evdev)
Expand Down
16 changes: 16 additions & 0 deletions include/baresip.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ int call_modify(struct call *call);
int call_hold(struct call *call, bool hold);
int call_set_video_dir(struct call *call, enum sdp_dir dir);
int call_send_digit(struct call *call, char key);
int call_send_pfu(struct call *call, const char* content,
const char* label);
bool call_has_audio(const struct call *call);
bool call_has_video(const struct call *call);
bool call_early_video_available(const struct call *call);
Expand All @@ -230,6 +232,7 @@ const char *call_alerturi(const struct call *call);
const char *call_diverteruri(const struct call *call);
struct audio *call_audio(const struct call *call);
struct video *call_video(const struct call *call);
struct video *call_slides(const struct call *call);
struct list *call_streaml(const struct call *call);
struct ua *call_get_ua(const struct call *call);
bool call_is_onhold(const struct call *call);
Expand Down Expand Up @@ -323,6 +326,7 @@ struct config_sip {
enum sip_transp transp; /**< Default outgoing SIP transport protocol */
bool verify_server; /**< Enable SIP TLS verify server */
uint8_t tos; /**< Type-of-Service for SIP */
bool media_control; /**< Media Control over SIP */
};

/** Call config */
Expand Down Expand Up @@ -397,6 +401,11 @@ struct config_net {
bool use_getaddrinfo; /**< Use getaddrinfo for A/AAAA records */
};

/** BFCP **/
struct config_bfcp {
char proto[16]; /**< BFCP Transport */
char floorctrl[16]; /**< BFCP floor control role */
};

/** Core configuration */
struct config {
Expand All @@ -408,9 +417,12 @@ struct config {
struct config_audio audio;

struct config_video video;
struct config_video slides;

struct config_avt avt;

struct config_net net;
struct config_bfcp bfcp;
};

int config_parse_conf(struct config *cfg, const struct conf *conf);
Expand Down Expand Up @@ -803,6 +815,7 @@ enum ua_event {
UA_EVENT_CALL_DTMF_END,
UA_EVENT_CALL_RTPESTAB,
UA_EVENT_CALL_RTCP,
UA_EVENT_CALL_VIDEO_DISP,
UA_EVENT_CALL_MENC,
UA_EVENT_VU_TX,
UA_EVENT_VU_RX,
Expand Down Expand Up @@ -1075,6 +1088,7 @@ struct vidisp_st;
/** Video Display parameters */
struct vidisp_prm {
bool fullscreen; /**< Enable fullscreen display */
char content[64];
};

typedef void (vidisp_resize_h)(const struct vidsz *size, void *arg);
Expand Down Expand Up @@ -1368,6 +1382,7 @@ void video_set_devicename(struct video *v, const char *src, const char *disp);
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);

double video_calc_seconds(uint64_t rtp_ts);
Expand Down Expand Up @@ -1429,6 +1444,7 @@ const char *stream_peer(const struct stream *strm);
int stream_bundle_init(struct stream *strm, bool offerer);
int stream_debug(struct re_printf *pf, const struct stream *s);
void stream_enable_rtp_timeout(struct stream *strm, uint32_t timeout_ms);
void print_rtp_stats(const struct stream *s);


/*
Expand Down
2 changes: 1 addition & 1 deletion mk/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ ifneq ($(USE_WINWAVE),)
MODULES += winwave
endif
ifneq ($(USE_X11),)
MODULES += x11
MODULES += x11 x11grab
endif
ifneq ($(USE_GZRTP),)
MODULES += gzrtp
Expand Down
8 changes: 6 additions & 2 deletions modules/avcodec/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ int avcodec_h264_fmtp_enc(struct mbuf *mb, const struct sdp_format *fmt,
uint8_t profile_idc = 0x42; /* baseline profile */
uint8_t profile_iop = 0xe0;
uint8_t h264_level_idc = 0x1f;
char append[64] = "";
(void)offer;

if (!mb || !fmt || !vc)
return 0;

conf_get_str(conf_cur(), "avcodec_profile_level_id",
profile_level_id, sizeof(profile_level_id));
conf_get_str(conf_cur(), "video_fmtp_append",
append, sizeof(append));

if (str_isset(profile_level_id)) {
struct pl prof;
Expand All @@ -67,10 +70,11 @@ int avcodec_h264_fmtp_enc(struct mbuf *mb, const struct sdp_format *fmt,
out:
return mbuf_printf(mb, "a=fmtp:%s"
" %s"
";profile-level-id=%02x%02x%02x"
";profile-level-id=%02x%02x%02x%s"
"\r\n",
fmt->id, vc->variant,
profile_idc, profile_iop, h264_level_idc);
profile_idc, profile_iop, h264_level_idc,
append);
}


Expand Down
2 changes: 1 addition & 1 deletion modules/ice/ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int cand_gather_relayed(struct mnat_media *m, struct comp *comp,
err = turnc_alloc(&turnc, stun_conf(icem_stun(m->icem)),
IPPROTO_UDP, comp->sock, layer, &m->sess->srv,
username, password,
60, turnc_handler, comp);
60, NULL, turnc_handler, comp);
if (err)
return err;

Expand Down
15 changes: 8 additions & 7 deletions modules/menu/static_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ static int switch_video_source(struct re_printf *pf, void *arg)
{
const struct cmd_arg *carg = arg;
struct pl pl_driver, pl_device;
struct config_video *vidcfg;
struct config_video *vidcfg, *slidescfg;
struct config *cfg;
struct video *v;
const struct vidsrc *vs;
Expand Down Expand Up @@ -1344,10 +1344,8 @@ static int switch_video_source(struct re_printf *pf, void *arg)
return EINVAL;
}

vidcfg = &cfg->video;

str_ncpy(vidcfg->src_mod, driver, sizeof(vidcfg->src_mod));
str_ncpy(vidcfg->src_dev, device, sizeof(vidcfg->src_dev));
vidcfg= &cfg->video;
slidescfg = &cfg->slides;

for (leu = list_head(uag_list()); leu; leu = leu->next) {
struct ua *ua = leu->data;
Expand All @@ -1356,8 +1354,11 @@ static int switch_video_source(struct re_printf *pf, void *arg)
struct call *call = le->data;

v = call_video(call);

err = video_set_source(v, driver, device);
err = video_set_source(v, vidcfg->src_mod,
vidcfg->src_dev);
v = call_slides(call);
err |= video_set_source(v, slidescfg->src_mod,
slidescfg->src_dev);
if (err) {
(void)re_hprintf(pf,
"failed to set video-source"
Expand Down
6 changes: 5 additions & 1 deletion modules/srtp/srtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static const char aes_cm_128_hmac_sha1_80[] = "AES_CM_128_HMAC_SHA1_80";
static const char aes_128_gcm[] = "AEAD_AES_128_GCM";
static const char aes_256_gcm[] = "AEAD_AES_256_GCM";

static const char *preferred_suite = aes_cm_128_hmac_sha1_80;
static const char *default_suite = aes_cm_128_hmac_sha1_80;


static void destructor(void *arg)
Expand Down Expand Up @@ -377,6 +377,7 @@ static int media_alloc(struct menc_media **stp, struct menc_sess *sess,
int layer = 10; /* above zero */
int err = 0;
bool mux = (rtpsock == rtcpsock);
char preferred_suite[64] = "";
(void)sess;
(void)rtp;
(void)raddr_rtp;
Expand Down Expand Up @@ -422,6 +423,9 @@ static int media_alloc(struct menc_media **stp, struct menc_sess *sess,
goto out;

/* set our preferred crypto-suite */
str_ncpy(preferred_suite, default_suite, sizeof(default_suite));
conf_get_str(conf_cur(), "preferred_crypto_suite",
preferred_suite, sizeof(preferred_suite));
err |= str_dup(&st->crypto_suite, preferred_suite);
if (err)
goto out;
Expand Down
24 changes: 18 additions & 6 deletions modules/turn/turn.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct mnat_media {
struct tls_conn *tlsc;
struct mbuf *mb;
unsigned ix;
uint64_t token;
} compv[COMPC];
};

Expand Down Expand Up @@ -196,16 +197,27 @@ static void turn_handler(int err, uint16_t scode, const char *reason,
void *arg)
{
struct comp *comp = arg;
uint64_t token;
struct mnat_media *m = comp->m;
(void)mapped_addr;
(void)msg;

if (!err && !scode) {

const struct comp *other = &m->compv[comp->ix ^ 1];
struct comp *other = &m->compv[comp->ix ^ 1];

if (comp->ix == 0)
sdp_media_set_laddr(m->sdpm, relay_addr);
struct stun_attr *token_attr = stun_msg_attr(msg, STUN_ATTR_RSV_TOKEN);
if (token_attr)
token = token_attr->v.uint64;

if (comp->ix == 0) {
sdp_media_set_laddr(m->sdpm, relay_addr);
err = turnc_alloc(&other->turnc, NULL,
IPPROTO_UDP, other->sock, LAYER,
&m->sess->srv, m->sess->user, m->sess->pass,
TURN_DEFAULT_LIFETIME, &token,
turn_handler, other);
}
else
sdp_media_set_laddr_rtcp(m->sdpm, relay_addr);

Expand Down Expand Up @@ -238,7 +250,7 @@ static void tcp_estab_handler(void *arg)
err = turnc_alloc(&comp->turnc, NULL, IPPROTO_TCP, comp->tc, 0,
&m->sess->srv,
m->sess->user, m->sess->pass,
TURN_DEFAULT_LIFETIME, turn_handler, comp);
TURN_DEFAULT_LIFETIME, NULL, turn_handler, comp);
if (err) {
m->sess->estabh(err, 0, NULL, m->sess->arg);
}
Expand All @@ -259,7 +271,7 @@ static int media_start(struct mnat_sess *sess, struct mnat_media *m)
unsigned i;
int err = 0;

for (i=0; i<COMPC; i++) {
for (i=0; i<1; i++) {

struct comp *comp = &m->compv[i];

Expand All @@ -272,7 +284,7 @@ static int media_start(struct mnat_sess *sess, struct mnat_media *m)
err |= turnc_alloc(&comp->turnc, NULL,
IPPROTO_UDP, comp->sock, LAYER,
&sess->srv, sess->user, sess->pass,
TURN_DEFAULT_LIFETIME,
TURN_DEFAULT_LIFETIME, NULL,
turn_handler, comp);
break;

Expand Down
Loading
Loading