Ignore:
Timestamp:
Mar 24, 2006 8:44:27 PM (18 years ago)
Author:
bennylp
Message:

Added more samples: WAV recorder, resample, etc., and also moved some common functions to util.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/simpleua.c

    r350 r361  
    6262#define THIS_FILE   "simpleua.c" 
    6363 
     64#include "util.h" 
    6465 
    6566/* 
     
    125126 
    126127 
    127 /*  
    128  * Util to display the error message for the specified error code   
    129  */ 
    130 static int app_perror( const char *sender, const char *title,  
    131                        pj_status_t status) 
    132 { 
    133     char errmsg[PJ_ERR_MSG_SIZE]; 
    134  
    135     pj_strerror(status, errmsg, sizeof(errmsg)); 
    136  
    137     PJ_LOG(1,(sender, "%s: %s [code=%d]", title, errmsg, status)); 
    138     return 1; 
    139 } 
    140  
    141128 
    142129/* 
     
    416403    } 
    417404 
    418     /* On exit, dump memory usage: */ 
    419     { 
    420         pj_pool_t   *p; 
    421         unsigned     total_alloc = 0; 
    422         unsigned     total_used = 0; 
    423  
    424         /* Accumulate memory usage in active list. */ 
    425         p = cp.used_list.next; 
    426         while (p != (pj_pool_t*) &cp.used_list) { 
    427             total_alloc += pj_pool_get_capacity(p); 
    428             total_used += pj_pool_get_used_size(p); 
    429             p = p->next; 
    430         } 
    431  
    432         printf("Total pool memory allocated=%d KB, used=%d KB\n", 
    433                 total_alloc / 1000, 
    434                 total_used / 1000); 
    435     } 
     405    /* On exit, dump current memory usage: */ 
     406    dump_pool_usage(THIS_FILE, &cp); 
    436407 
    437408    return 0; 
Note: See TracChangeset for help on using the changeset viewer.