diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-03-24 20:44:27 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-03-24 20:44:27 +0000 |
commit | a82abf01b16983b97036a5e0e11e70d188970256 (patch) | |
tree | 91cbe4cc7412ac0fbf2338d47af42bfbca05152e /pjsip-apps/src/samples/simpleua.c | |
parent | 4317d89db92d5d7766e5409cc3a9c1142796d1ed (diff) |
Added more samples: WAV recorder, resample, etc., and also moved some common functions to util.h
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@361 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/samples/simpleua.c')
-rw-r--r-- | pjsip-apps/src/samples/simpleua.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/pjsip-apps/src/samples/simpleua.c b/pjsip-apps/src/samples/simpleua.c index bed26711..8079225d 100644 --- a/pjsip-apps/src/samples/simpleua.c +++ b/pjsip-apps/src/samples/simpleua.c @@ -61,6 +61,7 @@ /* For logging purpose. */ #define THIS_FILE "simpleua.c" +#include "util.h" /* * Static variables. @@ -124,20 +125,6 @@ static pjsip_module mod_simpleua = }; -/* - * Util to display the error message for the specified error code - */ -static int app_perror( const char *sender, const char *title, - pj_status_t status) -{ - char errmsg[PJ_ERR_MSG_SIZE]; - - pj_strerror(status, errmsg, sizeof(errmsg)); - - PJ_LOG(1,(sender, "%s: %s [code=%d]", title, errmsg, status)); - return 1; -} - /* * main() @@ -415,24 +402,8 @@ int main(int argc, char *argv[]) pjsip_endpt_handle_events(g_endpt, &timeout); } - /* On exit, dump memory usage: */ - { - pj_pool_t *p; - unsigned total_alloc = 0; - unsigned total_used = 0; - - /* Accumulate memory usage in active list. */ - p = cp.used_list.next; - while (p != (pj_pool_t*) &cp.used_list) { - total_alloc += pj_pool_get_capacity(p); - total_used += pj_pool_get_used_size(p); - p = p->next; - } - - printf("Total pool memory allocated=%d KB, used=%d KB\n", - total_alloc / 1000, - total_used / 1000); - } + /* On exit, dump current memory usage: */ + dump_pool_usage(THIS_FILE, &cp); return 0; } |