本文整理汇总了C++中pj_caching_pool_destroy函数的典型用法代码示例。如果您正苦于以下问题:C++ pj_caching_pool_destroy函数的具体用法?C++ pj_caching_pool_destroy怎么用?C++ pj_caching_pool_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pj_caching_pool_destroy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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();
}
示例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);
}
示例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, " ");
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}