• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pj_caching_pool_destroy函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: cleanup

static void cleanup()
{
    if (app.srtp) pjmedia_transport_close(app.srtp);
    if (app.wav) {
        pj_ssize_t pos = pjmedia_wav_writer_port_get_pos(app.wav);
        if (pos >= 0) {
            unsigned msec;
            msec = (unsigned)pos / 2 * 1000 / PJMEDIA_PIA_SRATE(&app.wav->info);
            printf("Written: %dm:%02ds.%03d\n",
                    msec / 1000 / 60,
                    (msec / 1000) % 60,
                    msec % 1000);
        }
	pjmedia_port_destroy(app.wav);
    }
    if (app.pcap) pj_pcap_close(app.pcap);
    if (app.codec) {
	pjmedia_codec_mgr *cmgr;
	pjmedia_codec_close(app.codec);
	cmgr = pjmedia_endpt_get_codec_mgr(app.mept);
	pjmedia_codec_mgr_dealloc_codec(cmgr, app.codec);
    }
    if (app.aud_strm) {
	pjmedia_aud_stream_stop(app.aud_strm);
	pjmedia_aud_stream_destroy(app.aud_strm);
    }
    if (app.mept) pjmedia_endpt_destroy(app.mept);
    if (app.pool) pj_pool_release(app.pool);
    pj_caching_pool_destroy(&app.cp);
    pj_shutdown();
}
开发者ID:iamroger,项目名称:voip,代码行数:31,代码来源:pcaputil.c


示例2: test_destroy

/*****************************************************************************
 * The test session
 */
static void test_destroy(void)
{
    if (g_app.tx)
	stream_destroy(g_app.tx);
    if (g_app.tx_wav)
	pjmedia_port_destroy(g_app.tx_wav);
    if (g_app.rx)
	stream_destroy(g_app.rx);
    if (g_app.rx_wav)
	pjmedia_port_destroy(g_app.rx_wav);
    if (g_app.loop)
	pjmedia_transport_close(g_app.loop);
    if (g_app.endpt)
	pjmedia_endpt_destroy( g_app.endpt );
    if (g_app.log_fd) {
	pj_log_set_log_func(&pj_log_write);
	pj_log_set_decor(pj_log_get_decor() | PJ_LOG_HAS_NEWLINE);
	pj_file_close(g_app.log_fd);
	g_app.log_fd = NULL;
    }
    if (g_app.pool)
	pj_pool_release(g_app.pool);
    pj_caching_pool_destroy( &g_app.cp );
    pj_shutdown();
}
开发者ID:0x0B501E7E,项目名称:pjproject,代码行数:28,代码来源:jbsim.c


示例3: err_exit

/* Utility: display error message and exit application (usually
 * because of fatal error.
 */
static void err_exit(const char *title, pj_status_t status)
{
    if (status != PJ_SUCCESS) {
	icedemo_perror(title, status);
    }
    PJ_LOG(3,(THIS_FILE, "Shutting down.."));

    if (icedemo.icest)
	pj_ice_strans_destroy(icedemo.icest);
    
    pj_thread_sleep(500);

    icedemo.thread_quit_flag = PJ_TRUE;
    if (icedemo.thread) {
	pj_thread_join(icedemo.thread);
	pj_thread_destroy(icedemo.thread);
    }

    if (icedemo.ice_cfg.stun_cfg.ioqueue)
	pj_ioqueue_destroy(icedemo.ice_cfg.stun_cfg.ioqueue);

    if (icedemo.ice_cfg.stun_cfg.timer_heap)
	pj_timer_heap_destroy(icedemo.ice_cfg.stun_cfg.timer_heap);

    pj_caching_pool_destroy(&icedemo.cp);

    pj_shutdown();

    if (icedemo.log_fhnd) {
	fclose(icedemo.log_fhnd);
	icedemo.log_fhnd = NULL;
    }

    exit(status != PJ_SUCCESS);
}
开发者ID:conght,项目名称:BLM-Lib,代码行数:38,代码来源:icedemo.c


示例4: publish_sess_

SIPPresence::SIPPresence(SIPAccount *acc)
    : publish_sess_()
    , status_data_()
    , enabled_(false)
    , publish_supported_(false)
    , subscribe_supported_(false)
    , status_(false)
    , note_(" ")
    , acc_(acc)
    , sub_server_list_()  //IP2IP context
    , sub_client_list_()
    , mutex_()
    , mutex_nesting_level_()
    , mutex_owner_()
    , cp_()
    , pool_()
{
    /* init pool */
    pj_caching_pool_init(&cp_, &pj_pool_factory_default_policy, 0);
    pool_ = pj_pool_create(&cp_.factory, "pres", 1000, 1000, NULL);
    if (!pool_)
        throw std::runtime_error("Could not allocate pool for presence");

    /* Create mutex */
    if (pj_mutex_create_recursive(pool_, "pres", &mutex_) != PJ_SUCCESS) {
        pj_pool_release(pool_);
        pj_caching_pool_destroy(&cp_);
        throw std::runtime_error("Unable to create mutex");
    }

    /* init default status */
    updateStatus(false, " ");
}
开发者ID:ThereIsNoYeti,项目名称:sflphone,代码行数:33,代码来源:sippresence.cpp


示例5: term_pjsip

void term_pjsip()
{
  pjsip_endpt_destroy(stack_data.endpt);
  pj_pool_release(stack_data.pool);
  pj_caching_pool_destroy(&stack_data.cp);
  pj_shutdown();
}
开发者ID:gangbanlau,项目名称:sprout,代码行数:7,代码来源:stack.cpp


示例6: test_main

int test_main(void)
{
    int rc = 0;
    pj_caching_pool caching_pool;

    pj_init();
    pj_caching_pool_init(&caching_pool, &pj_pool_factory_default_policy, 0);

    pj_log_set_decor(PJ_LOG_HAS_NEWLINE);
    pj_log_set_level(3);

    mem = &caching_pool.factory;

    DO_TEST(sdp_neg_test());
    //DO_TEST(sdp_test (&caching_pool.factory));
    //DO_TEST(rtp_test(&caching_pool.factory));
    //DO_TEST(session_test (&caching_pool.factory));
    DO_TEST(jbuf_main());
    DO_TEST(mips_test());
    DO_TEST(codec_test_vectors());

    PJ_LOG(3,(THIS_FILE," "));

on_return:
    if (rc != 0) {
	PJ_LOG(3,(THIS_FILE,"Test completed with error(s)!"));
    } else {
	PJ_LOG(3,(THIS_FILE,"Looks like everything is okay!"));
    }

    pj_caching_pool_destroy(&caching_pool);

    return rc;
}
开发者ID:Jopie64,项目名称:pjsip,代码行数:34,代码来源:test.c


示例7: main

/*
 * main()
 */
int main(int argc, char *argv[])
{
    pj_caching_pool cp;
    pj_status_t status;

    if (argc < 2 || argc > 3) {
	puts("Usage: httpdemo URL [output-filename]");
	return 1;
    }

    pj_log_set_level(5);

    pj_init();
    pj_caching_pool_init(&cp, NULL, 0);
    mem = &cp.factory;
    pjlib_util_init();

    if (argc > 2)
	f = fopen(argv[2], "wb");
    else
	f = stdout;

    status = getURL(argv[1]);
    if (status != PJ_SUCCESS) {
        PJ_PERROR(1, (THIS_FILE, status, "Error"));
    }

    if (f != stdout)
	fclose(f);

    pj_caching_pool_destroy(&cp);
    pj_shutdown();
    return 0;
}
开发者ID:avble,项目名称:natClientEx,代码行数:37,代码来源:httpdemo.c


示例8: destroy_app

/*
 * Destroy SIP
 */
static void destroy_app()
{
    unsigned i;

    app.thread_quit = 1;
    for (i=0; i<app.thread_count; ++i) {
	if (app.thread[i]) {
	    pj_thread_join(app.thread[i]);
	    pj_thread_destroy(app.thread[i]);
	    app.thread[i] = NULL;
	}
    }

    if (app.sip_endpt) {
	pjsip_endpt_destroy(app.sip_endpt);
	app.sip_endpt = NULL;
    }

    if (app.pool) {
	pj_pool_release(app.pool);
	app.pool = NULL;
	PJ_LOG(3,(THIS_FILE, "Peak memory size: %uMB",
			     app.cp.peak_used_size / 1000000));
	pj_caching_pool_destroy(&app.cp);
    }

    /* Shutdown PJLIB */
    pj_shutdown();
}
开发者ID:ClearwaterCore,项目名称:pjsip-upstream,代码行数:32,代码来源:pjsip-perf.c


示例9: destroy_stack

/* Destroy stack */
static void destroy_stack(void)
{
    pjsip_endpt_destroy(global.endpt);
    pj_pool_release(global.pool);
    pj_caching_pool_destroy(&global.cp);

    pj_shutdown();
}
开发者ID:tasosbull,项目名称:yewtic,代码行数:9,代码来源:stateful_proxy.c


示例10: deinit

static pj_status_t deinit()
{
    pjmedia_codec_mgr *cm;
    cm = pj_med_mgr_get_codec_mgr (mm);
    codec->op->close(codec);
    pjmedia_codec_mgr_dealloc_codec (cm, codec);
    pj_med_mgr_destroy (mm);
    pj_caching_pool_destroy(&caching_pool);
    return 0;
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:10,代码来源:audio_tool.c


示例11: app_fini

/* Shutdown application */
static void app_fini()
{
    if (strm)
    	snd_stop();

    pjmedia_aud_subsys_shutdown();
    pjmedia_delay_buf_destroy(delaybuf);
    pj_pool_release(pool);
    pj_caching_pool_destroy(&cp);
    pj_shutdown();
}
开发者ID:Antares84,项目名称:asuswrt-merlin,代码行数:12,代码来源:app_main.cpp


示例12: LOGE

JNIEXPORT jint JNICALL Java_org_sipdroid_pjlib_codec_close
    (JNIEnv *env, jclass cls) {

    LOGE("Closing PJLIB...");
    pj_caching_pool_destroy(&caching_pool);
    pjmedia_port_destroy(port);
    pj_pool_release(pool);
    pj_shutdown();

    return (jint)0;
}
开发者ID:philiad,项目名称:aethervoice,代码行数:11,代码来源:pjlib_linker_jni.cpp


示例13: main

int main(int argc, char *argv[])
{
    pj_caching_pool cp;
    pj_time_val t0, t1;
    pj_status_t status;

    if (argc != 4) {
	puts(desc);
	return 1;
    }

    CHECK( pj_init() );
    
    pj_caching_pool_init(&cp, NULL, 0);

    CHECK( pjmedia_endpt_create(&cp.factory, NULL, 1, &mept) );

    /* Register all codecs */
#if PJMEDIA_HAS_G711_CODEC
    CHECK( pjmedia_codec_g711_init(mept) );
#endif
#if PJMEDIA_HAS_GSM_CODEC
    CHECK( pjmedia_codec_gsm_init(mept) );
#endif
#if PJMEDIA_HAS_ILBC_CODEC
    CHECK( pjmedia_codec_ilbc_init(mept, 30) );
#endif
#if PJMEDIA_HAS_SPEEX_CODEC
    CHECK( pjmedia_codec_speex_init(mept, 0, 5, 5) );
#endif
#if PJMEDIA_HAS_G722_CODEC
    CHECK( pjmedia_codec_g722_init(mept) );
#endif

    pj_gettimeofday(&t0);
    status = enc_dec_test(argv[1], argv[2], argv[3]);
    pj_gettimeofday(&t1);
    PJ_TIME_VAL_SUB(t1, t0);

    pjmedia_endpt_destroy(mept);
    pj_caching_pool_destroy(&cp);
    pj_shutdown();

    if (status == PJ_SUCCESS) {
	puts("");
	puts("Success");
	printf("Duration: %ds.%03d\n", file_msec_duration/1000, 
				       file_msec_duration%1000);
	printf("Time: %lds.%03ld\n", t1.sec, t1.msec);
    }

    return 0;
}
开发者ID:deveck,项目名称:Deveck.TAM,代码行数:53,代码来源:encdec.c


示例14: pjmedia_aud_stream_stop

void latency_checker::internal_clean()
{
	if(m_aud_stream)
	{
		pjmedia_aud_stream_stop(m_aud_stream);
		pjmedia_aud_stream_destroy(m_aud_stream);
		m_aud_stream = NULL;
	}
	if(m_pool)
		pjmedia_aud_subsys_shutdown();
	pj_logging_shutdown();
	pj_logging_destroy();
	if(m_lock)
	{
		delete m_lock;
		m_lock = NULL;
	}
	if(m_pool)
	{
		pj_pool_release(m_pool);
		m_pool = NULL;
	}
	if(m_caching_pool)
		pj_caching_pool_destroy(m_caching_pool);
	m_pool_factory = NULL;
	m_caching_pool = NULL;
	pj_shutdown();
	if(m_idle_freq1_det)
	{
		delete m_idle_freq1_det;
		m_idle_freq1_det = NULL;
	}
	if(m_idle_freq2_det)
	{
		delete m_idle_freq2_det;
		m_idle_freq2_det = NULL;
	}
	if(m_active_freq1_det)
	{
		delete m_active_freq1_det;
		m_active_freq1_det = NULL;
	}
	if(m_active_freq2_det)
	{
		delete m_active_freq2_det;
		m_active_freq2_det = NULL;
	}
	if(m_gain)
	{
		delete m_gain;
		m_gain = NULL;
	}
}
开发者ID:ddv2005,项目名称:intercom,代码行数:53,代码来源:latency.cpp


示例15: main

int main()
{
    pj_turn_srv *srv;
    pj_turn_listener *listener;
    pj_status_t status;

    status = pj_init();
    if (status != PJ_SUCCESS)
	return err("pj_init() error", status);

    pjlib_util_init();
    pjnath_init();

    pj_caching_pool_init(&g_cp, NULL, 0);

    pj_turn_auth_init(REALM);

    status = pj_turn_srv_create(&g_cp.factory, &srv);
    if (status != PJ_SUCCESS)
	return err("Error creating server", status);

    status = pj_turn_listener_create_udp(srv, pj_AF_INET(), NULL, 
					 TURN_PORT, 1, 0, &listener);
    if (status != PJ_SUCCESS)
	return err("Error creating UDP listener", status);

#if PJ_HAS_TCP
    status = pj_turn_listener_create_tcp(srv, pj_AF_INET(), NULL, 
					 TURN_PORT, 1, 0, &listener);
    if (status != PJ_SUCCESS)
	return err("Error creating listener", status);
#endif

    status = pj_turn_srv_add_listener(srv, listener);
    if (status != PJ_SUCCESS)
	return err("Error adding listener", status);

    puts("Server is running");

    pj_log_set_level(LOG_LEVEL);

    console_main(srv);

    pj_turn_srv_destroy(srv);
    pj_caching_pool_destroy(&g_cp);
    pj_shutdown();

    return 0;
}
开发者ID:LuLei2013,项目名称:pjproject,代码行数:49,代码来源:main.c


示例16: ERROR

SIPPresence::~SIPPresence()
{
    /* Flush the lists */
    // FIXME: Can't destroy/unsubscribe buddies properly.
    // Is the transport usable when the account is being destroyed?
    //for (const auto & c : sub_client_list_)
    //    delete(c);
    sub_client_list_.clear();
    sub_server_list_.clear();

    if (mutex_ and pj_mutex_destroy(mutex_) != PJ_SUCCESS)
        ERROR("Error destroying mutex");

    pj_pool_release(pool_);
    pj_caching_pool_destroy(&cp_);
}
开发者ID:ThereIsNoYeti,项目名称:sflphone,代码行数:16,代码来源:sippresence.cpp


示例17: main

int main()
{
  pj_caching_pool cp;
  pj_status_t status;
  // Must init PJLIB before anything else
  status = pj_init();
  if (status != PJ_SUCCESS) {
    my_perror("Error initializing PJLIB", status);
    return 1;
  }
  // Create the pool factory, in this case, a caching pool,
  // using default pool policy.
  pj_caching_pool_init(&cp, NULL, 1024*1024 );

  pj_pool_t *pool = pj_pool_create(&cp.factory, "pool1", 4000, 4000, NULL);

  pj_str_t test1_str = test1();
  PRINT_PSTR_DETAILS(&test1_str);

  pj_str_t test2_str = test2();
  PRINT_PSTR_DETAILS(&test2_str);

  pj_str_t test3_str = test3();
  PRINT_PSTR_DETAILS(&test3_str);

  PRINT_PSTR_DETAILS(test4());

  PRINT_PSTR_DETAILS(test5());

  PRINT_PSTR_DETAILS(test6(pool));

  pj_str_t test7_str = test7();
  PRINT_PSTR_DETAILS(&test7_str);

  pj_str_t test8_str = test8(pool);
  PRINT_PSTR_DETAILS(&test8_str);

  pj_pool_release(pool);

  // Done with demos, destroy caching pool before exiting app.
  pj_caching_pool_destroy(&cp);
  return 0;
}
开发者ID:chaitanyagupta,项目名称:pjsip-walkthrough,代码行数:43,代码来源:pj_str.c


示例18: destroy_stack

static void destroy_stack(void)
{
    enum { WAIT_CLEAR = 5000, WAIT_INTERVAL = 500 };
    unsigned i;

    PJ_LOG(3,(THIS_FILE, "Shutting down.."));

    /* Wait until all clear */
    hangup_all();
    for (i=0; i<WAIT_CLEAR/WAIT_INTERVAL; ++i) {
	unsigned j;

	for (j=0; j<MAX_CALLS; ++j) {
	    call_t *call = &app.call[j];
	    if (call->inv && call->inv->state <= PJSIP_INV_STATE_CONFIRMED)
		break;
	}

	if (j==MAX_CALLS)
	    return;

	pj_thread_sleep(WAIT_INTERVAL);
    }

    app.quit = PJ_TRUE;
    if (app.worker_thread) {
	pj_thread_join(app.worker_thread);
	app.worker_thread = NULL;
    }

    //if (app.med_endpt)
	//pjmedia_endpt_destroy(app.med_endpt);

    if (app.sip_endpt)
	pjsip_endpt_destroy(app.sip_endpt);

    if (app.pool)
	pj_pool_release(app.pool);

    dump_pool_usage(THIS_FILE, &app.cp);
    pj_caching_pool_destroy(&app.cp);
}
开发者ID:xhook,项目名称:asterisk-v11,代码行数:42,代码来源:sipecho.c


示例19: client_shutdown

static int client_shutdown()
{
    unsigned i;

    if (g.thread) {
	g.quit = 1;
	pj_thread_join(g.thread);
	pj_thread_destroy(g.thread);
	g.thread = NULL;
    }
    if (g.relay) {
	pj_turn_sock_destroy(g.relay);
	g.relay = NULL;
    }
    for (i=0; i<PJ_ARRAY_SIZE(g.peer); ++i) {
	if (g.peer[i].stun_sock) {
	    pj_stun_sock_destroy(g.peer[i].stun_sock);
	    g.peer[i].stun_sock = NULL;
	}
    }
    if (g.stun_config.timer_heap) {
	pj_timer_heap_destroy(g.stun_config.timer_heap);
	g.stun_config.timer_heap = NULL;
    }
    if (g.stun_config.ioqueue) {
	pj_ioqueue_destroy(g.stun_config.ioqueue);
	g.stun_config.ioqueue = NULL;
    }
    if (g.pool) {
	pj_pool_release(g.pool);
	g.pool = NULL;
    }
    pj_pool_factory_dump(&g.cp.factory, PJ_TRUE);
    pj_caching_pool_destroy(&g.cp);

    return PJ_SUCCESS;
}
开发者ID:carlosdelfino,项目名称:WorkshopTelefoniaAutomacao,代码行数:37,代码来源:client_main.c


示例20: main

int main() {
    pj_caching_pool cp;
    pj_pool_t *pool;
    int i;
    pj_thread_t *thread1;
    
    pj_log_set_level(3);
    CHECK(__FILE__, pj_init());
    pj_srand(123765);
    pj_caching_pool_init(&cp, NULL, 1024);

    pool = pj_pool_create(&cp.factory, "objpool", 128, 128, NULL);

    pj_thread_create(pool, "thread1", &do_test, pool, PJ_THREAD_DEFAULT_STACK_SIZE, 0, &thread1);
    pj_thread_sleep(500);
    do_test(pool);

    pj_thread_join(thread1);

    pj_pool_release(pool);
    pj_caching_pool_destroy(&cp);
    pj_shutdown();
    return 0;
}
开发者ID:mocidis,项目名称:object-pool,代码行数:24,代码来源:main.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pj_caching_pool_init函数代码示例发布时间:2022-05-30
下一篇:
C++ pj_bzero函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap