Esempio n. 1
0
void stream_hold(struct stream *s, bool hold)
{
	if (!s)
		return;

	sdp_media_set_ldir(s->sdp, hold ? SDP_SENDONLY : SDP_SENDRECV);
}
Esempio n. 2
0
static int oa_addmedia(struct oa *oa, bool local,
		       const char *mname, uint16_t port, const char *transp,
		       enum sdp_dir dir, uint32_t ncodec, ...)
{
	struct sdp_media *m;
	va_list ap;
	int err;

	err = oa_init(oa);
	if (err)
		return err;

	err = sdp_media_add(&m, local ? oa->alice : oa->bob,
			    mname, port, transp);
	if (err)
		return err;

	sdp_media_set_ldir(m, dir);

	va_start(ap, ncodec);

	while (ncodec--) {
		const char *id = va_arg(ap, char *);
		const char *cname = va_arg(ap, char *);
		int srate = va_arg(ap, int);

		err = sdp_format_add(NULL, m, false, id, cname, srate, 1,
				     NULL, NULL, NULL, false, NULL);
		if (err)
			break;
	}

	va_end(ap);

	return err;
}