当前位置: 首页>>代码示例>>C++>>正文


C++ DEBUG_WARNING函数代码示例

本文整理汇总了C++中DEBUG_WARNING函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUG_WARNING函数的具体用法?C++ DEBUG_WARNING怎么用?C++ DEBUG_WARNING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DEBUG_WARNING函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: poll_method_set

/**
 * Set async I/O polling method. This function can also be called while the
 * program is running.
 *
 * @param method New polling method
 *
 * @return 0 if success, otherwise errorcode
 */
int poll_method_set(enum poll_method method)
{
	struct re *re;
	int err;

	switch (method) {

#ifdef HAVE_POLL
	case METHOD_POLL:
		break;
#endif
#ifdef HAVE_SELECT
	case METHOD_SELECT:
		break;
#endif
#ifdef HAVE_EPOLL
	case METHOD_EPOLL:
		if (!epoll_check())
			return EINVAL;
		break;
#endif
#ifdef HAVE_ACTSCHED
	case METHOD_ACTSCHED:
		break;
#endif
	default:
		DEBUG_WARNING("poll method not supported: '%s'\n",
			      poll_method_name(method));
		return EINVAL;
	}

	re = re_get();
	re->method = method;
	re->update = true;

	DEBUG_INFO("Setting async I/O polling method to `%s'\n",
		   poll_method_name(re->method));

	err = fd_setsize(DEFAULT_MAXFDS);
	if (err)
		return err;

	err = poll_init(re);
	if (err)
		return err;

	return rebuild_fds(re);
}
开发者ID:Issic47,项目名称:libre,代码行数:56,代码来源:main.c

示例2: audio_encoder_set

int audio_encoder_set(struct audio *a, const struct aucodec *ac,
			  int pt_tx, const char *params, struct user_extra_data_t *user_data)
{
	struct autx *tx;
	int err = 0;
	bool reset;

	if (!a || !ac)
		return EINVAL;

	tx = &a->tx;

	reset = !aucodec_equal(ac, tx->ac);

	if (ac != tx->ac) {
		re_printf("Set audio encoder: %s %uHz %dch\n", ac->name, get_srate(ac), ac->ch);

		/* Audio source must be stopped first */
		if (reset) {
			tx->ausrc = mem_deref(tx->ausrc);
		}

		tx->is_g722 = (0 == str_casecmp(ac->name, "G722"));
		tx->enc = mem_deref(tx->enc);
		tx->ac = ac;
	}

	if (ac->encupdh) {
		struct auenc_param prm;

		prm.ptime = tx->ptime;

		err = ac->encupdh(&tx->enc, ac, &prm, params);
		if (err) {
			DEBUG_WARNING("alloc encoder: %m\n", err);
			return err;
		}
	}

	stream_set_srate(a->strm, get_srate(ac), get_srate(ac));
	stream_update_encoder(a->strm, pt_tx);

	if (!tx->ausrc) {
		err |= audio_start(a, user_data);
	}

	return err;
}
开发者ID:soramimi,项目名称:qSIP,代码行数:48,代码来源:audio.c

示例3: stream_send_fir

void stream_send_fir(struct stream *s, bool pli)
{
	int err;

	if (!s)
		return;

	if (pli)
		err = rtcp_send_pli(s->rtp, s->ssrc_rx);
	else
		err = rtcp_send_fir(s->rtp, rtp_sess_ssrc(s->rtp));

	if (err) {
		DEBUG_WARNING("Send FIR: %m\n", err);
	}
}
开发者ID:busylee999,项目名称:BareSip-Android,代码行数:16,代码来源:stream.c

示例4: jbuf_get

/**
 * Get one frame from the jitter buffer
 *
 * @param jb   Jitter buffer
 * @param hdr  Returned RTP Header
 * @param mem  Pointer to memory object storage - referenced on success
 *
 * @return 0 if success, otherwise errorcode
 */
int jbuf_get(struct jbuf *jb, struct rtp_header *hdr, void **mem)
{
	struct frame *f;

	if (!jb || !hdr || !mem)
		return EINVAL;

	STAT_INC(n_get);

	if (jb->n <= jb->min || !jb->framel.head) {
		DEBUG_INFO("not enough buffer frames - wait.. (n=%u min=%u)\n",
			   jb->n, jb->min);
		STAT_INC(n_underflow);
		return ENOENT;
	}

	/* When we get one frame F[i], check that the next frame F[i+1]
	   is present and have a seq no. of seq[i] + 1 !
	   if not, we should consider that packet lost */

	f = jb->framel.head->data;

#if JBUF_STAT
	/* Check timestamp of previously played frame */
	if (jb->seq_get) {
		const int16_t seq_diff = f->hdr.seq - jb->seq_get;
		if (seq_less(f->hdr.seq, jb->seq_get)) {
			DEBUG_WARNING("get: seq=%u too late\n", f->hdr.seq);
		}
		else if (seq_diff > 1) {
			STAT_ADD(n_lost, 1);
			DEBUG_INFO("get: n_lost: diff=%d,seq=%u,seq_get=%u\n",
				   seq_diff, f->hdr.seq, jb->seq_get);
		}
	}

	/* Update sequence number for 'get' */
	jb->seq_get = f->hdr.seq;
#endif

	*hdr = f->hdr;
	*mem = mem_ref(f->mem);

	frame_deref(jb, f);

	return 0;
}
开发者ID:soramimi,项目名称:qSIP,代码行数:56,代码来源:jbuf.c

示例5: mod_srtp_init

static int mod_srtp_init(void)
{
	err_status_t err;

	err = srtp_init();
	if (err_status_ok != err) {
		DEBUG_WARNING("srtp_init() failed (%H)\n",
			      errstatus_print, err);
		return ENOSYS;
	}

	menc_register(&menc_srtp_opt);
	menc_register(&menc_srtp_mand);
	menc_register(&menc_srtp_mandf);

	return 0;
}
开发者ID:Studio-Link,项目名称:baresip_old,代码行数:17,代码来源:srtp.c

示例6: localDataSource

jboolean JNICALL ScriptMethodsServerUINamespace::clearSuiDataSourceContainer(JNIEnv * env, jobject self, jint pageId, jstring dataSourceContainer)
{
	JavaStringParam localDataSource(dataSourceContainer);

	ServerUIPage * const p = ServerUIManager::getPage(pageId);
	if(!p)
	{
		DEBUG_WARNING(true, ("SUI: Could not find page %d, cannot clear datasource", pageId));
		return JNI_FALSE;
	}

	std::string ds;
	JavaLibrary::convert(localDataSource, ds);

	p->clearDataSourceContainer(ds);
	return JNI_TRUE;
}
开发者ID:Mesagoppinmypants,项目名称:NGELinux,代码行数:17,代码来源:ScriptMethodsServerUI.cpp

示例7: audio_decoder_set

int audio_decoder_set(struct audio *a, const struct aucodec *ac,
		      int pt_rx, const char *params)
{
	struct aurx *rx;
	bool reset = false;
	int err = 0;

	if (!a || !ac)
		return EINVAL;

	rx = &a->rx;

	reset = !aucodec_equal(ac, rx->ac);

	if (ac != rx->ac) {

		(void)re_fprintf(stderr, "Set audio decoder: %s %uHz %dch\n",
				 ac->name, get_srate(ac), ac->ch);

		rx->pt = pt_rx;
		rx->ac = ac;
		rx->dec = mem_deref(rx->dec);
	}

	if (ac->decupdh) {
		err = ac->decupdh(&rx->dec, ac, params);
		if (err) {
			DEBUG_WARNING("alloc decoder: %m\n", err);
			return err;
		}
	}

	stream_set_srate(a->strm, get_srate(ac), get_srate(ac));

	if (reset) {

		rx->auplay = mem_deref(rx->auplay);

		/* Reset audio filter chain */
		list_flush(&a->filtl);

		err |= audio_start(a);
	}

	return err;
}
开发者ID:mralexgray,项目名称:baresip,代码行数:46,代码来源:audio.c

示例8: mbuf_read_mem

/**
 * Read a block of memory from a memory buffer
 *
 * @param mb   Memory buffer
 * @param buf  Buffer to read data to
 * @param size Size of buffer
 *
 * @return 0 if success, otherwise errorcode
 */
int mbuf_read_mem(struct mbuf *mb, uint8_t *buf, size_t size)
{
	if (!mb || !buf)
		return EINVAL;

	if (size > mbuf_get_left(mb)) {
		DEBUG_WARNING("tried to read beyond mbuf end (%u > %u)\n",
			      size, mbuf_get_left(mb));
		return EOVERFLOW;
	}

	memcpy(buf, mb->buf + mb->pos, size);

	mb->pos += size;

	return 0;
}
开发者ID:anchowee,项目名称:traversal_server,代码行数:26,代码来源:mbuf.c

示例9: inet_ntop

const char* inet_ntop(int af, const void *src, char *dst, size_t size)
{
	switch (af) {

	case AF_INET:
		return inet_ntop4(src, dst, size);

#ifdef HAVE_INET6
	case AF_INET6:
		return inet_ntop6(src, dst, size);
#endif

	default:
		DEBUG_WARNING("inet_ntop: unknown address family %d\n", af);
		return NULL;
	}
}
开发者ID:allanlei,项目名称:lib-re,代码行数:17,代码来源:ntop.c

示例10: fd_handler

/**
 * Call the application event handler
 *
 * @param re     Poll state
 * @param fd     File descriptor
 * @param flags  Event flags
 */
static void fd_handler(struct re *re, int fd, int flags)
{
	const uint64_t tick = tmr_jiffies();
	uint32_t diff;

	DEBUG_INFO("event on fd=%d (flags=0x%02x)...\n", fd, flags);

	re->fhs[fd].fh(flags, re->fhs[fd].arg);

	diff = (uint32_t)(tmr_jiffies() - tick);

	if (diff > MAX_BLOCKING) {
		DEBUG_WARNING("long async blocking: %u>%u ms (h=%p arg=%p)\n",
			      diff, MAX_BLOCKING,
			      re->fhs[fd].fh, re->fhs[fd].arg);
	}
}
开发者ID:Issic47,项目名称:libre,代码行数:24,代码来源:main.c

示例11: decode_param

static void decode_param(const struct pl *name, const struct pl *val,
			 void *arg)
{
	struct aucodec_st *st = arg;
	int err;

	if (0 == pl_strcasecmp(name, "bitrate")) {
		st->bitrate = pl_u32(val) * 1000;
	}
	else if (0 == pl_strcasecmp(name, "frame-size")) {
		st->frame_size = pl_u32(val);

		if (st->frame_size & 0x1) {
			DEBUG_WARNING("frame-size is NOT even: %u\n",
				      st->frame_size);
		}
	}
	else if (0 == pl_strcasecmp(name, "low-overhead")) {
		struct pl fs, bpfv;
		uint32_t i;

		st->low_overhead = true;

		err = re_regex(val->p, val->l, "[0-9]+/[0-9,]+", &fs, &bpfv);
		if (err)
			return;

		st->frame_size = pl_u32(&fs);

		for (i=0; i<ARRAY_SIZE(st->bpfv) && bpfv.l > 0; i++) {
			struct pl bpf, co;

			co.l = 0;
			if (re_regex(bpfv.p, bpfv.l, "[0-9]+[,]*", &bpf, &co))
				break;

			pl_advance(&bpfv, bpf.l + co.l);

			st->bpfv[i] = pl_u32(&bpf);
		}
		st->bpfn = i;
	}
	else {
		DEBUG_NOTICE("unknown param: %r = %r\n", name, val);
	}
}
开发者ID:FihlaTV,项目名称:BareSip-Android,代码行数:46,代码来源:celt.c

示例12: rtcp_sess_rx_rtp

void rtcp_sess_rx_rtp(struct rtcp_sess *sess, uint16_t seq, uint32_t ts,
		      uint32_t ssrc, size_t payload_size,
		      const struct sa *peer)
{
	struct rtp_member *mbr;

	if (!sess)
		return;

	mbr = get_member(sess, ssrc);
	if (!mbr) {
		DEBUG_NOTICE("could not add member: 0x%08x\n", ssrc);
		return;
	}

	if (!mbr->s) {
		mbr->s = mem_zalloc(sizeof(*mbr->s), NULL);
		if (!mbr->s) {
			DEBUG_NOTICE("could not add sender: 0x%08x\n", ssrc);
			return;
		}

		/* first packet - init sequence number */
		source_init_seq(mbr->s, seq);
		mbr->s->max_seq = seq - 1;
		/* probation not used */
		sa_cpy(&mbr->s->rtp_peer, peer);
		++sess->senderc;
	}

	if (!source_update_seq(mbr->s, seq)) {
		DEBUG_WARNING("rtp_update_seq() returned 0\n");
	}

	if (sess->srate_rx) {

		uint32_t ts_arrive;

		/* Convert from wall-clock time to timestamp units */
		ts_arrive = (uint32_t)(tmr_jiffies()) * sess->srate_rx / 1000;

		source_calc_jitter(mbr->s, ts, ts_arrive);
	}

	mbr->s->rtp_rx_bytes += payload_size;
}
开发者ID:anchowee,项目名称:traversal_server,代码行数:46,代码来源:sess.c

示例13: play_alloc

static int play_alloc(struct auplay_st **stp, struct auplay *ap,
		      struct auplay_prm *prm, const char *device,
		      auplay_write_h *wh, void *arg)
{
	struct auplay_st *st;
	int err;
	int i;

	(void)device;

	if (play_dev_count < 1) {
		DEBUG_WARNING("no winwave play devices\n");
		return ENODEV;
	}

	st = mem_zalloc(sizeof(*st), auplay_destructor);
	if (!st)
		return ENOMEM;

	st->ap  = mem_ref(ap);
	st->wh  = wh;
	st->arg = arg;
	if (prm) {
		prm->fmt = AUFMT_S16LE;
		st->prm = *prm;
	}

	err = write_stream_open(st);
	if (err)
		goto out;

	/* The write runs at 100ms intervals
	 * prepare enough buffers to suite its needs
	 */
	for (i = 0; i < 5; i++)
		dsp_write(st);

 out:
	if (err)
		mem_deref(st);
	else
		*stp = st;

	return err;
}
开发者ID:FihlaTV,项目名称:BareSip-Android,代码行数:45,代码来源:winwave.c

示例14: DEBUG_INFO

void CTcpSock::RunL()
{
	DEBUG_INFO("CTcpSock RunL (%p) iStatus=%d ts=%p\n", this,
		   iStatus.Int(), ts);

	/* This happens after calling cancel functions in socket */
	if (iStatus == KErrCancel || iStatus == KErrAbort) {
		iStatus = KErrNone;
		return;
	}
	else if (iStatus != KErrNone) {
		DEBUG_WARNING("RunL received iStatus %d\n", iStatus.Int());
	}

	/* Incoming CONNECT */
	DEBUG_INFO("CTcpSock RunL (%p) Incoming CONNECT\n", this);
	ts->tcp_conn_handler();
}
开发者ID:anchowee,项目名称:traversal_server,代码行数:18,代码来源:tcp.cpp

示例15: tcp_conn_handler

static void tcp_conn_handler(const struct sa *peer, void *arg)
{
	struct ice_lcand *lcand = arg;
	int err;

#if 0
	trice_printf(lcand->icem,
		    "[local=%H] incoming TCP-connect from %J\n",
		    trice_cand_print, lcand, peer);
#endif

	err = trice_conn_alloc(&lcand->icem->connl, lcand->icem,
			     lcand->attr.compid, false,
			     &lcand->attr.addr, peer, lcand->ts, lcand->layer,
			     tcpconn_frame_handler, lcand);
	if (err) {
		DEBUG_WARNING("ice_conn_alloc error (%m)\n", err);
	}
}
开发者ID:alfredh,项目名称:rew,代码行数:19,代码来源:lcand.c


注:本文中的DEBUG_WARNING函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。