本文整理汇总了C++中pj_list_erase函数的典型用法代码示例。如果您正苦于以下问题:C++ pj_list_erase函数的具体用法?C++ pj_list_erase怎么用?C++ pj_list_erase使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pj_list_erase函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: destroy_tdata
static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force)
{
TRACE_((THIS_FILE, "tdata %p destroy request, force=%d, tsx=%p", tdata,
force, tdata->client_tsx));
if (tdata->res_timer.id != PJ_FALSE) {
pj_timer_heap_cancel_if_active(tdata->sess->cfg->timer_heap,
&tdata->res_timer, PJ_FALSE);
pj_list_erase(tdata);
}
if (force) {
pj_list_erase(tdata);
if (tdata->client_tsx) {
pj_stun_client_tsx_stop(tdata->client_tsx);
pj_stun_client_tsx_set_data(tdata->client_tsx, NULL);
}
pj_pool_release(tdata->pool);
} else {
if (tdata->client_tsx) {
/* "Probably" this is to absorb retransmission */
pj_time_val delay = {0, 300};
pj_stun_client_tsx_schedule_destroy(tdata->client_tsx, &delay);
} else {
pj_pool_release(tdata->pool);
}
}
}
开发者ID:Archipov,项目名称:android-client,代码行数:30,代码来源:stun_session.c
示例2: PJ_DEF
PJ_DEF(pj_status_t) pj_grp_lock_add_ref_dbg(pj_grp_lock_t *glock,
const char *file,
int line)
{
grp_lock_ref *ref;
pj_status_t status;
pj_enter_critical_section();
if (!pj_list_empty(&glock->ref_free_list)) {
ref = glock->ref_free_list.next;
pj_list_erase(ref);
} else {
ref = PJ_POOL_ALLOC_T(glock->pool, grp_lock_ref);
}
ref->file = file;
ref->line = line;
pj_list_push_back(&glock->ref_list, ref);
pj_leave_critical_section();
status = grp_lock_add_ref(glock);
if (status != PJ_SUCCESS) {
pj_enter_critical_section();
pj_list_erase(ref);
pj_list_push_back(&glock->ref_free_list, ref);
pj_leave_critical_section();
}
return status;
}
开发者ID:yagiza,项目名称:qtice,代码行数:32,代码来源:lock.cpp
示例3: PJ_DEF
/*
* pj_ioqueue_post_completion()
*/
PJ_DEF(pj_status_t) pj_ioqueue_post_completion( pj_ioqueue_key_t *key,
pj_ioqueue_op_key_t *op_key,
pj_ssize_t bytes_status )
{
struct generic_operation *op_rec;
/*
* Find the operation key in all pending operation list to
* really make sure that it's still there; then call the callback.
*/
pj_mutex_lock(key->mutex);
/* Find the operation in the pending read list. */
op_rec = (struct generic_operation*)key->read_list.next;
while (op_rec != (void*)&key->read_list) {
if (op_rec == (void*)op_key) {
pj_list_erase(op_rec);
op_rec->op = PJ_IOQUEUE_OP_NONE;
pj_mutex_unlock(key->mutex);
(*key->cb.on_read_complete)(key, op_key, bytes_status);
return PJ_SUCCESS;
}
op_rec = op_rec->next;
}
/* Find the operation in the pending write list. */
op_rec = (struct generic_operation*)key->write_list.next;
while (op_rec != (void*)&key->write_list) {
if (op_rec == (void*)op_key) {
pj_list_erase(op_rec);
op_rec->op = PJ_IOQUEUE_OP_NONE;
pj_mutex_unlock(key->mutex);
(*key->cb.on_write_complete)(key, op_key, bytes_status);
return PJ_SUCCESS;
}
op_rec = op_rec->next;
}
/* Find the operation in the pending accept list. */
op_rec = (struct generic_operation*)key->accept_list.next;
while (op_rec != (void*)&key->accept_list) {
if (op_rec == (void*)op_key) {
pj_list_erase(op_rec);
op_rec->op = PJ_IOQUEUE_OP_NONE;
pj_mutex_unlock(key->mutex);
(*key->cb.on_accept_complete)(key, op_key,
PJ_INVALID_SOCKET,
bytes_status);
return PJ_SUCCESS;
}
op_rec = op_rec->next;
}
pj_mutex_unlock(key->mutex);
return PJ_EINVALIDOP;
}
开发者ID:Jopie64,项目名称:pjsip,代码行数:63,代码来源:ioqueue_common_abs.c
示例4: PJ_DEF
PJ_DEF(void) pj_caching_pool_destroy( pj_caching_pool *cp )
{
int i;
pj_pool_t *pool;
PJ_CHECK_STACK();
/* Delete all pool in free list */
for (i=0; i < PJ_CACHING_POOL_ARRAY_SIZE; ++i) {
pj_pool_t *pool = (pj_pool_t*) cp->free_list[i].next;
pj_pool_t *next;
for (; pool != (void*)&cp->free_list[i]; pool = next) {
next = pool->next;
pj_list_erase(pool);
pj_pool_destroy_int(pool);
}
}
/* Delete all pools in used list */
pool = (pj_pool_t*) cp->used_list.next;
while (pool != (pj_pool_t*) &cp->used_list) {
pj_pool_t *next = pool->next;
pj_list_erase(pool);
PJ_LOG(4,(pool->obj_name,
"Pool is not released by application, releasing now"));
pj_pool_destroy_int(pool);
pool = next;
}
if (cp->lock) {
pj_lock_destroy(cp->lock);
pj_lock_create_null_mutex(NULL, "cachingpool", &cp->lock);
}
}
开发者ID:Jopie64,项目名称:pjsip,代码行数:34,代码来源:pool_caching.c
示例5: pjsip_param_find
/// Mangelwurzel can be configured to generate originating or terminating
/// requests, and out of the blue requests. This requires manipulation of the
/// S-CSCF Route header, which will be the top Route header. Mangelwurzel
/// adds the orig parameter for originating requests, removes it for
/// terminating requests and removes the ODI token from the URI for out of
/// the blue requests.
void MangelwurzelTsx::edit_scscf_route_hdr(pjsip_msg* req, pj_pool_t* pool)
{
pjsip_route_hdr* route_hdr =
(pjsip_route_hdr*)pjsip_msg_find_hdr(req, PJSIP_H_ROUTE, NULL);
if (route_hdr != NULL)
{
pjsip_sip_uri* scscf_uri = (pjsip_sip_uri*)route_hdr->name_addr.uri;
pjsip_param* orig_param = pjsip_param_find(&scscf_uri->other_param,
&STR_ORIG);
if ((_config.orig) && (orig_param == NULL))
{
TRC_DEBUG("Add orig param to S-CSCF Route header");
orig_param = PJ_POOL_ALLOC_T(pool, pjsip_param);
pj_strdup(pool, &orig_param->name, &STR_ORIG);
orig_param->value.slen = 0;
pj_list_insert_after(&scscf_uri->other_param, orig_param);
}
else if ((!_config.orig) && (orig_param != NULL))
{
TRC_DEBUG("Remove orig param from S-CSCF Route header");
pj_list_erase(orig_param);
}
// Ensure there is no ODI token by clearing the user part of the URI.
if (_config.ootb)
{
TRC_DEBUG("Remove ODI token from S-CSCF Route header");
scscf_uri->user.ptr = NULL;
scscf_uri->user.slen = 0;
}
}
}
开发者ID:ClearwaterCore,项目名称:sprout,代码行数:41,代码来源:mangelwurzel.cpp
示例6: pres_evsub_on_srv_state
/* Callback called when *server* subscription state has changed. */
static void pres_evsub_on_srv_state( pjsip_evsub *sub, pjsip_event *event)
{
pjsua_srv_pres *uapres;
PJ_UNUSED_ARG(event);
PJSUA_LOCK();
uapres = (pjsua_srv_pres*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
if (uapres) {
pjsip_evsub_state state;
PJ_LOG(4,(THIS_FILE, "Server subscription to %s is %s",
uapres->remote, pjsip_evsub_get_state_name(sub)));
state = pjsip_evsub_get_state(sub);
if (pjsua_var.ua_cfg.cb.on_srv_subscribe_state) {
pj_str_t from;
from = uapres->dlg->remote.info_str;
(*pjsua_var.ua_cfg.cb.on_srv_subscribe_state)(uapres->acc_id,
uapres, &from,
state, event);
}
if (state == PJSIP_EVSUB_STATE_TERMINATED) {
pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id, NULL);
pj_list_erase(uapres);
}
}
PJSUA_UNLOCK();
}
开发者ID:svn2github,项目名称:pjproject,代码行数:35,代码来源:pjsua_pres.c
示例7: reset_pool
/*
* Reset the pool to the state when it was created.
* All blocks will be deallocated except the first block. All memory areas
* are marked as free.
*/
static void reset_pool(pj_pool_t *pool)
{
pj_pool_block *block;
PJ_CHECK_STACK();
block = pool->block_list.prev;
if (block == &pool->block_list)
return;
/* Skip the first block because it is occupying the same memory
as the pool itself.
*/
block = block->prev;
while (block != &pool->block_list) {
pj_pool_block *prev = block->prev;
pj_list_erase(block);
(*pool->factory->policy.block_free)(pool->factory, block,
block->end - (unsigned char*)block);
block = prev;
}
block = pool->block_list.next;
/* Set the start pointer, aligning it as needed */
block->cur = ALIGN_PTR(block->buf, PJ_POOL_ALIGNMENT);
pool->capacity = block->end - (unsigned char*)pool;
}
开发者ID:LuLei2013,项目名称:pjproject,代码行数:35,代码来源:pool.c
示例8: PJ_DEF
/*
* Unregister a codec factory.
*/
PJ_DEF(pj_status_t) pjmedia_codec_mgr_unregister_factory(
pjmedia_codec_mgr *mgr,
pjmedia_codec_factory *factory)
{
unsigned i;
PJ_ASSERT_RETURN(mgr && factory, PJ_EINVAL);
/* Factory must be registered. */
PJ_ASSERT_RETURN(pj_list_find_node(&mgr->factory_list, factory)==factory,
PJ_ENOTFOUND);
/* Erase factory from the factory list */
pj_list_erase(factory);
/* Remove all supported codecs from the codec manager that were created
* by the specified factory.
*/
for (i=0; i<mgr->codec_cnt; ) {
if (mgr->codec_desc[i].factory == factory) {
pj_array_erase(mgr->codec_desc, sizeof(mgr->codec_desc[0]),
mgr->codec_cnt, i);
--mgr->codec_cnt;
} else {
++i;
}
}
return PJ_SUCCESS;
}
开发者ID:max3903,项目名称:SFLphone,代码行数:37,代码来源:codec.c
示例9: tls_flush_pending_tx
/* Flush all delayed transmision once the socket is connected. */
static void tls_flush_pending_tx(struct tls_transport *tls)
{
pj_lock_acquire(tls->base.lock);
while (!pj_list_empty(&tls->delayed_list)) {
struct delayed_tdata *pending_tx;
pjsip_tx_data *tdata;
pj_ioqueue_op_key_t *op_key;
pj_ssize_t size;
pj_status_t status;
pending_tx = tls->delayed_list.next;
pj_list_erase(pending_tx);
tdata = pending_tx->tdata_op_key->tdata;
op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key;
/* send! */
size = tdata->buf.cur - tdata->buf.start;
status = pj_ssl_sock_send(tls->ssock, op_key, tdata->buf.start,
&size, 0);
if (status != PJ_EPENDING) {
on_data_sent(tls->ssock, op_key, size);
}
}
pj_lock_release(tls->base.lock);
}
开发者ID:conght,项目名称:BLM-Lib,代码行数:28,代码来源:sip_transport_tls.c
示例10: tcp_destroy
/* Destroy TCP transport */
static pj_status_t tcp_destroy(pjsip_transport *transport,
pj_status_t reason)
{
struct tcp_transport *tcp = (struct tcp_transport*)transport;
if (tcp->close_reason == 0)
tcp->close_reason = reason;
if (tcp->is_registered) {
tcp->is_registered = PJ_FALSE;
pjsip_transport_destroy(transport);
/* pjsip_transport_destroy will recursively call this function
* again.
*/
return PJ_SUCCESS;
}
/* Mark transport as closing */
tcp->is_closing = PJ_TRUE;
/* Stop keep-alive timer. */
if (tcp->ka_timer.id) {
pjsip_endpt_cancel_timer(tcp->base.endpt, &tcp->ka_timer);
tcp->ka_timer.id = PJ_FALSE;
}
/* Cancel all delayed transmits */
while (!pj_list_empty(&tcp->delayed_list)) {
struct delayed_tdata *pending_tx;
pj_ioqueue_op_key_t *op_key;
pending_tx = tcp->delayed_list.next;
pj_list_erase(pending_tx);
op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key;
on_data_sent(tcp->asock, op_key, -reason);
}
if (tcp->asock) {
pj_activesock_close(tcp->asock);
tcp->asock = NULL;
tcp->sock = PJ_INVALID_SOCKET;
} else if (tcp->sock != PJ_INVALID_SOCKET) {
pj_sock_close(tcp->sock);
tcp->sock = PJ_INVALID_SOCKET;
}
if (tcp->grp_lock) {
pj_grp_lock_t *grp_lock = tcp->grp_lock;
tcp->grp_lock = NULL;
pj_grp_lock_dec_ref(grp_lock);
/* Transport may have been deleted at this point */
} else {
tcp_on_destroy(tcp);
}
return PJ_SUCCESS;
}
开发者ID:CloudStyleStudio,项目名称:csip,代码行数:61,代码来源:sip_transport_tcp.c
示例11: scan_closing_keys
/* Scan the closing list, and put pending closing keys to free list.
* Must do this with ioqueue mutex held.
*/
static void scan_closing_keys(pj_ioqueue_t *ioqueue)
{
if (!pj_list_empty(&ioqueue->closing_list)) {
pj_time_val now;
pj_ioqueue_key_t *key;
pj_gettickcount(&now);
/* Move closing keys to free list when they've finished the closing
* idle time.
*/
key = ioqueue->closing_list.next;
while (key != &ioqueue->closing_list) {
pj_ioqueue_key_t *next = key->next;
pj_assert(key->closing != 0);
if (PJ_TIME_VAL_GTE(now, key->free_time)) {
pj_list_erase(key);
pj_list_push_back(&ioqueue->free_list, key);
}
key = next;
}
}
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:28,代码来源:ioqueue_winnt.c
示例12: tsx_erase
static pj_status_t tsx_erase(pj_stun_session *sess,
pj_stun_tx_data *tdata)
{
PJ_UNUSED_ARG(sess);
pj_list_erase(tdata);
return PJ_SUCCESS;
}
开发者ID:AmongOthers,项目名称:PJSIP-iOS,代码行数:7,代码来源:stun_session.c
示例13: main
int main()
{
struct my_node nodes[10];
struct my_node list;
struct my_node *it;
int i;
// Initialize the list as empty.
pj_list_init(&list);
// Insert nodes.
for (i=0; i<10; ++i) {
nodes[i].value = i;
pj_list_insert_before(&list, &nodes[i]);
}
// Iterate list nodes.
it = list.next;
while (it != &list) {
PJ_LOG(3,("list", "value = %d", it->value));
it = it->next;
}
// Erase all nodes.
for (i=0; i<10; ++i) {
pj_list_erase(&nodes[i]);
}
// List must be empty by now.
pj_assert( pj_list_empty(&list) );
return 0;
};
开发者ID:Jopie64,项目名称:pjsip,代码行数:33,代码来源:list.c
示例14: destroy_tdata
static void destroy_tdata(pj_stun_tx_data *tdata, pj_bool_t force)
{
if (tdata->res_timer.id != PJ_FALSE) {
pj_timer_heap_cancel(tdata->sess->cfg->timer_heap,
&tdata->res_timer);
tdata->res_timer.id = PJ_FALSE;
pj_list_erase(tdata);
}
if (force) {
if (tdata->client_tsx) {
tsx_erase(tdata->sess, tdata);
pj_stun_client_tsx_destroy(tdata->client_tsx);
}
pj_pool_release(tdata->pool);
} else {
if (tdata->client_tsx) {
pj_time_val delay = {2, 0};
pj_stun_client_tsx_schedule_destroy(tdata->client_tsx, &delay);
} else {
pj_pool_release(tdata->pool);
}
}
}
开发者ID:AmongOthers,项目名称:PJSIP-iOS,代码行数:26,代码来源:stun_session.c
示例15: PJ_DEF
/*
* Let the Echo Canceller knows that a frame has been captured from
* the microphone.
*/
PJ_DEF(pj_status_t) pjmedia_echo_capture( pjmedia_echo_state *echo,
pj_int16_t *rec_frm,
unsigned options )
{
struct frame *oldest_frm;
pj_status_t status, rc;
if (!echo->lat_ready) {
/* Prefetching to fill in the desired latency */
PJ_LOG(5,(echo->obj_name, "Prefetching.."));
return PJ_SUCCESS;
}
/* Retrieve oldest frame from the latency buffer */
oldest_frm = echo->lat_buf.next;
pj_list_erase(oldest_frm);
/* Cancel echo using this reference frame */
status = pjmedia_echo_cancel(echo, rec_frm, oldest_frm->buf,
options, NULL);
/* Move one frame from delay buffer to the latency buffer. */
rc = pjmedia_delay_buf_get(echo->delay_buf, oldest_frm->buf);
if (rc != PJ_SUCCESS) {
/* Ooops.. no frame! */
PJ_LOG(5,(echo->obj_name,
"No frame from delay buffer. This will upset EC later"));
pjmedia_zero_samples(oldest_frm->buf, echo->samples_per_frame);
}
pj_list_push_back(&echo->lat_buf, oldest_frm);
return status;
}
开发者ID:ChrisKwon,项目名称:spore,代码行数:37,代码来源:echo_common.c
示例16: RealseFrame
static void RealseFrame(Jitter_Buffer *jitter_buffer, Frame_Buffer *frame) {
if(frame->frame_status == FRAME_STATUS_DECODING)
return;
frame_buffer_reset(frame);
pj_list_erase(frame);
list_alloc_insert(frame, &jitter_buffer->frame_alloc);
jitter_buffer->number_of_frames--;
}
开发者ID:icefreedom,项目名称:jitter_buffer,代码行数:8,代码来源:jitter_buffer.c
示例17: while
/// Remove all existing copies of a header. The header to delete must
/// not be one that has an abbreviation.
void PJUtils::remove_hdr(pjsip_msg* msg,
const pj_str_t* name)
{
while (pjsip_hdr* hdr = (pjsip_hdr*)pjsip_msg_find_hdr_by_name(msg, name, NULL))
{
pj_list_erase(hdr);
}
}
开发者ID:oldurecu,项目名称:sprout,代码行数:10,代码来源:pjutils.cpp
示例18: PJ_DEF
/*
* pj_ioqueue_unregister()
*
* Unregister handle from ioqueue.
*/
PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key)
{
pj_ioqueue_t *ioqueue;
PJ_ASSERT_RETURN(key, PJ_EINVAL);
ioqueue = key->ioqueue;
/* Lock the key to make sure no callback is simultaneously modifying
* the key. We need to lock the key before ioqueue here to prevent
* deadlock.
*/
pj_mutex_lock(key->mutex);
/* Also lock ioqueue */
pj_lock_acquire(ioqueue->lock);
pj_assert(ioqueue->count > 0);
--ioqueue->count;
#if !PJ_IOQUEUE_HAS_SAFE_UNREG
/* Ticket #520, key will be erased more than once */
pj_list_erase(key);
#endif
PJ_FD_CLR(key->fd, &ioqueue->rfdset);
PJ_FD_CLR(key->fd, &ioqueue->wfdset);
#if PJ_HAS_TCP
PJ_FD_CLR(key->fd, &ioqueue->xfdset);
#endif
/* Close socket. */
pj_sock_close(key->fd);
/* Clear callback */
key->cb.on_accept_complete = NULL;
key->cb.on_connect_complete = NULL;
key->cb.on_read_complete = NULL;
key->cb.on_write_complete = NULL;
/* Must release ioqueue lock first before decrementing counter, to
* prevent deadlock.
*/
pj_lock_release(ioqueue->lock);
#if PJ_IOQUEUE_HAS_SAFE_UNREG
/* Mark key is closing. */
key->closing = 1;
/* Decrement counter. */
decrement_counter(key);
/* Done. */
pj_mutex_unlock(key->mutex);
#else
pj_mutex_destroy(key->mutex);
#endif
return PJ_SUCCESS;
}
开发者ID:kaaustubh,项目名称:pjsip,代码行数:63,代码来源:ioqueue_select.c
示例19: Reset
static void Reset(Jitter_Buffer *jitter_buffer) {
//free frame list
Frame_Buffer * frame = jitter_buffer->frameList.next;
Frame_Buffer * next_frame;
while(frame != &jitter_buffer->frameList) {
next_frame = frame->next;
pj_list_erase(frame);
list_alloc_insert(frame, &jitter_buffer->frame_alloc);
frame = next_frame;
}
frame = jitter_buffer->decodingFrameList.next;
while(frame != &jitter_buffer->decodingFrameList) {
next_frame = frame->next;
if(frame->frame_status != FRAME_STATUS_DECODING) {
//not decoding ,release it
pj_list_erase(frame);
list_alloc_insert(frame, &jitter_buffer->frame_alloc);
}
frame = next_frame;
}
jitter_buffer->number_of_frames = 0;
//reset decode state
decode_state_reset(&jitter_buffer->decode_state);
//reset jitter estimator
jitter_estimator_reset(&jitter_buffer->jitter_estimator);
//reset inter_frame_delay
inter_frame_delay_reset(&jitter_buffer->inter_frame_delay);
//reset rtt
if(jitter_buffer->high_rtt_threshold_ms == -1)
jitter_buffer->rttMs = DEFAULT_RTT_MS;
else
jitter_buffer->rttMs = 0;
jitter_buffer->nack_seq_num = 0;
jitter_buffer->waiting_for_key_frame = PJ_TRUE;
//reset event
event_reset(jitter_buffer->frame_event);
event_reset(jitter_buffer->packet_event);
jitter_buffer->first_packet = PJ_FALSE;
//waiting for completed frame
jitter_buffer->waiting_for_completed_frame.timestamp = 0;
jitter_buffer->waiting_for_completed_frame.frame_size = 0;
jitter_buffer->waiting_for_completed_frame.latest_packet_timestamp = -1;
}
开发者ID:icefreedom,项目名称:jitter_buffer,代码行数:44,代码来源:jitter_buffer.c
示例20: DeletePackets
//delete [start, end)
static void DeletePackets(Session_Info *session_info , JTPacket *start, JTPacket *end) {
JTPacket *packet = start, *del_packet;
while(packet != end) {
del_packet = packet;
packet = packet->next;
pj_list_erase(del_packet);
list_alloc_insert(del_packet, session_info->packet_alloc);
session_info->packets_count -= 1;
}
}
开发者ID:icefreedom,项目名称:jitter_buffer,代码行数:11,代码来源:session_info.c
注:本文中的pj_list_erase函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论