Changeset 5982 for pjproject/trunk/pjmedia/src/pjmedia/stream.c
- Timestamp:
- May 9, 2019 7:24:57 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r5968 r5982 39 39 #define THIS_FILE "stream.c" 40 40 #define ERRLEVEL 1 41 #define LOGERR_(expr) stream_perror expr41 #define LOGERR_(expr) PJ_PERROR(4,expr); 42 42 #define TRC_(expr) PJ_LOG(5,expr) 43 43 … … 269 269 static pj_int16_t zero_frame[2 * 30 * 16000 / 1000]; 270 270 271 /*272 * Print error.273 */274 static void stream_perror(const char *sender, const char *title,275 pj_status_t status)276 {277 char errmsg[PJ_ERR_MSG_SIZE];278 279 pj_strerror(status, errmsg, sizeof(errmsg));280 PJ_LOG(4,(sender, "%s: %s [err:%d]", title, errmsg, status));281 }282 271 283 272 static void on_rx_rtcp( void *data, … … 749 738 &frame_out); 750 739 if (status != 0) { 751 LOGERR_((port->info.name.ptr, "codec decode() error",752 status));740 LOGERR_((port->info.name.ptr, status, 741 "codec decode() error")); 753 742 754 743 if (use_dec_buf) { … … 862 851 0, frame); 863 852 if (status != PJ_SUCCESS) { 864 LOGERR_((port->info.name.ptr, "codec decode() error",865 status));853 LOGERR_((port->info.name.ptr, status, 854 "codec decode() error")); 866 855 pjmedia_frame_ext_append_subframe(f, NULL, 0, 867 856 (pj_uint16_t)samples_per_frame); … … 1397 1386 &frame_out); 1398 1387 if (status != PJ_SUCCESS) { 1399 LOGERR_((stream->port.info.name.ptr, 1400 "Codec encode() error" , status));1388 LOGERR_((stream->port.info.name.ptr, status, 1389 "Codec encode() error")); 1401 1390 return status; 1402 1391 } … … 1421 1410 &frame_out); 1422 1411 if (status != PJ_SUCCESS) { 1423 LOGERR_((stream->port.info.name.ptr, 1424 "Codec encode() error" , status));1412 LOGERR_((stream->port.info.name.ptr, status, 1413 "Codec encode() error")); 1425 1414 return status; 1426 1415 } … … 1445 1434 1446 1435 if (status != PJ_SUCCESS) { 1447 LOGERR_((stream->port.info.name.ptr, 1448 "RTP encode_rtp() error" , status));1436 LOGERR_((stream->port.info.name.ptr, status, 1437 "RTP encode_rtp() error")); 1449 1438 return status; 1450 1439 } … … 1776 1765 &hdr, &payload, &payloadlen); 1777 1766 if (status != PJ_SUCCESS) { 1778 LOGERR_((stream->port.info.name.ptr, "RTP decode error", status));1767 LOGERR_((stream->port.info.name.ptr, status, "RTP decode error")); 1779 1768 stream->rtcp.stat.rx.discard++; 1780 1769 return; … … 1931 1920 payloadlen, &ts, &count, frames); 1932 1921 if (status != PJ_SUCCESS) { 1933 LOGERR_((stream->port.info.name.ptr, 1934 "Codec parse() error", 1935 status)); 1922 LOGERR_((stream->port.info.name.ptr, status, 1923 "Codec parse() error")); 1936 1924 count = 0; 1937 1925 } else if (stream->detect_ptime_change && … … 2059 2047 2060 2048 if (status != 0) { 2061 LOGERR_((stream->port.info.name.ptr, "Jitter buffer put() error",2062 status));2049 LOGERR_((stream->port.info.name.ptr, status, 2050 "Jitter buffer put() error")); 2063 2051 pkt_discarded = PJ_TRUE; 2064 2052 goto on_return; … … 2122 2110 if (bytes_read < 0) { 2123 2111 if (bytes_read != -PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK)) { 2124 LOGERR_((stream->port.info.name.ptr, "RTCP recv() error",2125 (pj_status_t)-bytes_read));2112 LOGERR_((stream->port.info.name.ptr, (pj_status_t)-bytes_read, 2113 "RTCP recv() error")); 2126 2114 } 2127 2115 return; … … 2779 2767 TRACE_JB_PATH_PREFIX "%s.csv", 2780 2768 stream->port.info.name.ptr); 2781 status = pj_file_open(pool, trace_name, PJ_O_WRONLY, &stream->trace_jb_fd); 2769 status = pj_file_open(pool, trace_name, PJ_O_WRONLY, 2770 &stream->trace_jb_fd); 2782 2771 if (status != PJ_SUCCESS) { 2783 2772 stream->trace_jb_fd = TRACE_JB_INVALID_FD; 2784 PJ_ LOG(3,(THIS_FILE, "Failed creating RTP trace file '%s'",2785 2773 PJ_PERROR(3,(THIS_FILE, status, 2774 "Failed creating RTP trace file '%s'", trace_name)); 2786 2775 } else { 2787 2776 stream->trace_jb_buf = (char*)pj_pool_alloc(pool, PJ_LOG_MAX_SIZE);
Note: See TracChangeset
for help on using the changeset viewer.