Ignore:
Timestamp:
May 9, 2019 7:24:57 AM (5 years ago)
Author:
nanang
Message:

Re #1298: Updated PJMEDIA* to use PJ_ERROR consistently.

File:
1 edited

Legend:

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

    r5968 r5982  
    4141#define THIS_FILE                       "vid_stream.c" 
    4242#define ERRLEVEL                        1 
    43 #define LOGERR_(expr)                   stream_perror expr 
     43#define LOGERR_(expr)                   PJ_PERROR(4,expr) 
    4444#define TRC_(expr)                      PJ_LOG(5,expr) 
    4545#define SIGNATURE                       PJMEDIA_SIG_PORT_VID_STREAM 
     
    196196static pj_status_t decode_frame(pjmedia_vid_stream *stream, 
    197197                                pjmedia_frame *frame); 
    198  
    199 /* 
    200  * Print error. 
    201  */ 
    202 static void stream_perror(const char *sender, const char *title, 
    203                           pj_status_t status) 
    204 { 
    205     char errmsg[PJ_ERR_MSG_SIZE]; 
    206  
    207     pj_strerror(status, errmsg, sizeof(errmsg)); 
    208     PJ_LOG(4,(sender, "%s: %s [err:%d]", title, errmsg, status)); 
    209 } 
    210198 
    211199 
     
    645633                                    &hdr, &payload, &payloadlen); 
    646634    if (status != PJ_SUCCESS) { 
    647         LOGERR_((channel->port.info.name.ptr, "RTP decode error", status)); 
     635        LOGERR_((channel->port.info.name.ptr, status, "RTP decode error")); 
    648636        stream->rtcp.stat.rx.discard++; 
    649637        return; 
     
    826814 
    827815    if (status != 0) { 
    828         LOGERR_((channel->port.info.name.ptr, "Jitter buffer put() error",  
    829                 status)); 
     816        LOGERR_((channel->port.info.name.ptr, status, 
     817                 "Jitter buffer put() error")); 
    830818        pkt_discarded = PJ_TRUE; 
    831819        goto on_return; 
     
    867855    if (bytes_read < 0) { 
    868856        if (bytes_read != -PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK)) { 
    869             LOGERR_((stream->cname.ptr, "RTCP recv() error", 
    870                     (pj_status_t)-bytes_read)); 
     857            LOGERR_((stream->cname.ptr, (pj_status_t)-bytes_read, 
     858                     "RTCP recv() error")); 
    871859        } 
    872860        return; 
     
    968956                                            &has_more_data); 
    969957    if (status != PJ_SUCCESS) { 
    970         LOGERR_((channel->port.info.name.ptr, 
    971                 "Codec encode_begin() error", status)); 
     958        LOGERR_((channel->port.info.name.ptr, status, 
     959                "Codec encode_begin() error")); 
    972960 
    973961        /* Update RTP timestamp */ 
     
    997985                                        &rtphdrlen); 
    998986        if (status != PJ_SUCCESS) { 
    999             LOGERR_((channel->port.info.name.ptr, 
    1000                     "RTP encode_rtp() error", status)); 
     987            LOGERR_((channel->port.info.name.ptr, status, 
     988                    "RTP encode_rtp() error")); 
    1001989            return status; 
    1002990        } 
     
    10171005                enum { COUNT_TO_REPORT = 20 }; 
    10181006                if (stream->send_err_cnt++ == 0) { 
    1019                     LOGERR_((channel->port.info.name.ptr, 
    1020                              "Transport send_rtp() error", 
    1021                              status)); 
     1007                    LOGERR_((channel->port.info.name.ptr, status, 
     1008                             "Transport send_rtp() error")); 
    10221009                } 
    10231010                if (stream->send_err_cnt > COUNT_TO_REPORT) 
     
    10461033                                               &has_more_data); 
    10471034        if (status != PJ_SUCCESS) { 
    1048             LOGERR_((channel->port.info.name.ptr, 
    1049                      "Codec encode_more() error", status)); 
     1035            LOGERR_((channel->port.info.name.ptr, status, 
     1036                     "Codec encode_more() error")); 
    10501037            /* Ignore this error (?) */ 
    10511038            break; 
     
    12351222                                          (unsigned)frame->size, frame); 
    12361223        if (status != PJ_SUCCESS) { 
    1237             LOGERR_((channel->port.info.name.ptr, "codec decode() error", 
    1238                      status)); 
     1224            LOGERR_((channel->port.info.name.ptr, status, 
     1225                     "codec decode() error")); 
    12391226            frame->type = PJMEDIA_FRAME_TYPE_NONE; 
    12401227            frame->size = 0; 
     
    18441831        if (status != PJ_SUCCESS) { 
    18451832            stream->trace_jb_fd = TRACE_JB_INVALID_FD; 
    1846             PJ_LOG(3,(THIS_FILE, "Failed creating RTP trace file '%s'",  
    1847                       trace_name)); 
     1833            PJ_PERROR(3,(THIS_FILE, status, 
     1834                         "Failed creating RTP trace file '%s'",  
     1835                         trace_name)); 
    18481836        } else { 
    18491837            stream->trace_jb_buf = (char*)pj_pool_alloc(pool, PJ_LOG_MAX_SIZE); 
Note: See TracChangeset for help on using the changeset viewer.