Changeset 213


Ignore:
Timestamp:
Feb 22, 2006 12:25:51 AM (18 years ago)
Author:
bennylp
Message:

Better error reporting in pjmedia stream

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r210 r213  
    3535#define THIS_FILE                       "stream.c" 
    3636#define ERRLEVEL                        1 
    37 #define TRACE_(expr)                    PJ_LOG(3,expr) 
     37#define TRACE_(expr)                    stream_perror expr 
    3838 
    3939#define PJMEDIA_MAX_FRAME_DURATION_MS   200 
     
    9797 
    9898 
     99/* 
     100 * Print error. 
     101 */ 
     102static void stream_perror(const char *sender, const char *title, 
     103                          pj_status_t status) 
     104{ 
     105    char errmsg[PJ_ERR_MSG_SIZE]; 
     106 
     107    pj_strerror(status, errmsg, sizeof(errmsg)); 
     108    PJ_LOG(3,(sender, "%s: %s [err:%d]", title, errmsg, status)); 
     109} 
     110 
    99111 
    100112/* 
     
    145157                                        channel->pcm_buf_size, &frame_out); 
    146158    if (status != 0) { 
    147         TRACE_((THIS_FILE, "decode() has return error status %d", status)); 
     159        TRACE_((THIS_FILE, "codec decode() error", status)); 
    148160 
    149161        frame->type = PJMEDIA_FRAME_TYPE_NONE; 
     
    153165    /* Put in sound buffer. */ 
    154166    if (frame_out.size > frame->size) { 
    155         TRACE_((THIS_FILE, "Sound playout buffer truncated %d bytes",  
    156                 frame_out.size - frame->size)); 
     167        PJ_LOG(4,(THIS_FILE, "Sound playout buffer truncated %d bytes",  
     168                  frame_out.size - frame->size)); 
    157169        frame_out.size = frame->size; 
    158170    } 
     
    197209                                        &frame_out); 
    198210    if (status != 0) { 
    199         TRACE_((THIS_FILE, "Codec encode() has returned error status %d",  
    200                 status)); 
     211        TRACE_((THIS_FILE, "Codec encode() error", status)); 
    201212        return status; 
    202213    } 
     
    209220                                (const void**)&rtphdr, &rtphdrlen); 
    210221    if (status != 0) { 
    211         TRACE_((THIS_FILE, "RTP encode_rtp() has returned error status %d",  
    212                            status)); 
     222        TRACE_((THIS_FILE, "RTP encode_rtp() error", status)); 
    213223        return status; 
    214224    } 
     
    217227        /* We don't support RTP with extended header yet. */ 
    218228        PJ_TODO(SUPPORT_SENDING_RTP_WITH_EXTENDED_HEADER); 
    219         TRACE_((THIS_FILE, "Unsupported extended RTP header for transmission")); 
     229        //TRACE_((THIS_FILE, "Unsupported extended RTP header for transmission")); 
    220230        return 0; 
    221231    } 
     
    267277        status = pj_sock_select(FD_SETSIZE, &fds, NULL, NULL, &timeout); 
    268278        if (status < 0) { 
    269             char errmsg[PJ_ERR_MSG_SIZE]; 
    270             pj_strerror(pj_get_netos_error(), errmsg, sizeof(errmsg)); 
    271             TRACE_((THIS_FILE, "Jitter buffer select() error: %s", 
    272                     errmsg)); 
     279            TRACE_((THIS_FILE, "Jitter buffer select() error",  
     280                    pj_get_netos_error())); 
    273281            pj_thread_sleep(500); 
    274282            continue; 
     
    299307                                   &hdr, &payload, &payloadlen); 
    300308        if (status != PJ_SUCCESS) { 
    301             TRACE_((THIS_FILE, "RTP decode_rtp() has returned error status %d", 
    302                     status)); 
     309            TRACE_((THIS_FILE, "RTP decode error", status)); 
    303310            continue; 
    304311        } 
     
    309316            status != PJMEDIA_RTP_ESESSRESTART)  
    310317        { 
    311             TRACE_((THIS_FILE,  
    312                     "RTP session_update() has returned error status %d",  
    313                     status)); 
     318            TRACE_((THIS_FILE, "RTP session_update error", status)); 
    314319            continue; 
    315320        } 
     
    326331 
    327332        if (status != 0) { 
    328             TRACE_((THIS_FILE,  
    329                     "Jitter buffer put() has returned error status %d",  
    330                     status)); 
     333            TRACE_((THIS_FILE, "Jitter buffer put() error", status)); 
    331334            continue; 
    332335        } 
  • pjproject/trunk/pjsip/build/pjsip.dsw

    r197 r213  
    5353 
    5454Project: "pjmedia_codec"=..\..\pjmedia\build\pjmedia_codec.dsp - Package Owner=<4> 
    55  
    56 Package=<5> 
    57 {{{ 
    58 }}} 
    59  
    60 Package=<4> 
    61 {{{ 
    62 }}} 
    63  
    64 ############################################################################### 
    65  
    66 Project: "pjsip++"=".\pjsip++.dsp" - Package Owner=<4> 
    6755 
    6856Package=<5> 
Note: See TracChangeset for help on using the changeset viewer.