Changeset 5982
- Timestamp:
- May 9, 2019 7:24:57 AM (5 years ago)
- Location:
- pjproject/trunk/pjmedia/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c
r5705 r5982 686 686 status = PixelFormat_to_pjmedia_format_id(*p, &fmt_id); 687 687 if (status != PJ_SUCCESS) { 688 PJ_ LOG(6, (THIS_FILE, "Unrecognized ffmpeg pixel "689 "format %d", *p));688 PJ_PERROR(6, (THIS_FILE, status, 689 "Unrecognized ffmpeg pixel format %d", *p)); 690 690 continue; 691 691 } -
pjproject/trunk/pjmedia/src/pjmedia-codec/h264_packetizer.c
r5603 r5982 172 172 { 173 173 //pj_assert(!"MTU too small for H.264 single NAL packetization mode"); 174 PJ_LOG(2,( "h264_packetizer.c",174 PJ_LOG(2,(THIS_FILE, 175 175 "MTU too small for H.264 (required=%u, MTU=%u)", 176 176 nal_end - nal_start, pktz->cfg.mtu)); -
pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c
r5392 r5982 372 372 case PJMEDIA_EVENT_WND_RESIZED: 373 373 status = resize_disp(strm, &pevent.data.wnd_resized.new_size); 374 if (status != PJ_SUCCESS) 375 PJ_LOG(3, (THIS_FILE, "Failed resizing the display.")); 374 if (status != PJ_SUCCESS) { 375 PJ_PERROR(3, (THIS_FILE, status, 376 "Failed resizing the display.")); 377 } 376 378 break; 377 379 case PJMEDIA_EVENT_WND_CLOSING: … … 1182 1184 1183 1185 status = sdl_create_window(strm, PJ_TRUE, sdl_info->sdl_format, hwnd); 1184 PJ_ LOG(4, (THIS_FILE, "Re-initializing SDL with native window"1185 " %d: %s", hwnd->info.window,1186 (status == PJ_SUCCESS? "success": "failed")));1186 PJ_PERROR(4, (THIS_FILE, status, 1187 "Re-initializing SDL with native window %d", 1188 hwnd->info.window)); 1187 1189 return status; 1188 1190 } … … 1301 1303 &jq->sem); 1302 1304 if (status != PJ_SUCCESS) { 1303 PJ_LOG(3, (THIS_FILE, "Failed growing SDL job queue size.")); 1305 PJ_PERROR(3, (THIS_FILE, status, 1306 "Failed growing SDL job queue size.")); 1304 1307 return 0; 1305 1308 } … … 1312 1315 &jq->job_sem[i]); 1313 1316 if (status != PJ_SUCCESS) { 1314 PJ_ LOG(3, (THIS_FILE, "Failed growing SDL job "1315 "queue size."));1317 PJ_PERROR(3, (THIS_FILE, status, 1318 "Failed growing SDL job queue size.")); 1316 1319 return 0; 1317 1320 } -
pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c
r3841 r5982 358 358 /* Give all what delay buffer has, then pad with zeroes */ 359 359 if (b->wsola) 360 PJ_LOG(4,(b->obj_name,"Error generating frame, status=%d", 361 status)); 360 PJ_PERROR(4,(b->obj_name, status, "Error generating frame")); 362 361 363 362 pjmedia_circ_buf_read(b->circ_buf, frame, buf_len); -
pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
r5186 r5982 402 402 if (rc != PJ_SUCCESS) { 403 403 /* Ooops.. no frame! */ 404 PJ_ LOG(5,(echo->obj_name,405 "No frame from delay buffer . This will upset EC later"));404 PJ_PERROR(5,(echo->obj_name, rc, 405 "No frame from delay buffer (this will upset EC later)")); 406 406 pjmedia_zero_samples(oldest_frm->buf, echo->samples_per_frame); 407 407 } -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r5820 r5982 1434 1434 PJ_CATCH_ANY { 1435 1435 1436 char errmsg[PJ_ERR_MSG_SIZE]; 1437 pj_strerror(ctx.last_error, errmsg, sizeof(errmsg)); 1438 1439 PJ_LOG(4, (THIS_FILE, "Error parsing SDP in line %d col %d: %s", 1440 scanner.line, pj_scan_get_col(&scanner), 1441 errmsg)); 1436 PJ_PERROR(4, (THIS_FILE, ctx.last_error, 1437 "Error parsing SDP in line %d col %d", 1438 scanner.line, pj_scan_get_col(&scanner))); 1442 1439 1443 1440 session = NULL; -
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); -
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r5853 r5982 395 395 { 396 396 if (err != PJ_SUCCESS) { 397 char errmsg[PJ_ERR_MSG_SIZE]; 398 pj_strerror(err, errmsg, sizeof(errmsg)); 399 PJ_LOG(4,(tp_ice->base.name, 400 "Stopping ICE, reason=%s:%s", reason, errmsg)); 397 PJ_PERROR(4,(tp_ice->base.name, err, 398 "Stopping ICE, reason=%s", reason)); 401 399 } else { 402 400 PJ_LOG(4,(tp_ice->base.name, … … 1061 1059 &rem_m->attr[i]->value, &cand); 1062 1060 if (status != PJ_SUCCESS) { 1063 PJ_ LOG(4,(tp_ice->base.name,1064 1065 1066 1067 1061 PJ_PERROR(4,(tp_ice->base.name, status, 1062 "Error in parsing SDP candidate attribute '%.*s', " 1063 "candidate is ignored", 1064 (int)rem_m->attr[i]->value.slen, 1065 rem_m->attr[i]->value.ptr)); 1068 1066 continue; 1069 1067 } … … 1491 1489 &cand[cand_cnt]); 1492 1490 if (status != PJ_SUCCESS) { 1493 PJ_ LOG(4,(tp_ice->base.name,1494 1495 1496 1491 PJ_PERROR(4,(tp_ice->base.name, status, 1492 "Error in parsing SDP candidate attribute '%.*s', " 1493 "candidate is ignored", 1494 (int)attr->value.slen, attr->value.ptr)); 1497 1495 continue; 1498 1496 } … … 1671 1669 &pwd_attr->value); 1672 1670 if (status != PJ_SUCCESS) { 1673 PJ_LOG(1,(tp_ice->base.name, 1674 "ICE re-initialization failed (status=%d)!", 1675 status)); 1671 PJ_PERROR(1,(tp_ice->base.name, status, 1672 "ICE re-initialization failed!")); 1676 1673 return status; 1677 1674 } … … 1711 1708 status = start_ice(tp_ice, tmp_pool, rem_sdp, media_index); 1712 1709 if (status != PJ_SUCCESS) { 1713 PJ_LOG(1,(tp_ice->base.name, 1714 "ICE restart failed (status=%d)!", 1715 status)); 1710 PJ_PERROR(1,(tp_ice->base.name, status, "ICE restart failed!")); 1716 1711 return status; 1717 1712 } -
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r5860 r5982 515 515 #endif 516 516 517 if (pjmedia_endpt_atexit(endpt, pjmedia_srtp_deinit_lib) != PJ_SUCCESS)518 {517 status = pjmedia_endpt_atexit(endpt, pjmedia_srtp_deinit_lib); 518 if (status != PJ_SUCCESS) { 519 519 /* There will be memory leak when it fails to schedule libsrtp 520 520 * deinitialization, however the memory leak could be harmless, … … 522 522 * when the application terminates. 523 523 */ 524 PJ_LOG(4, (THIS_FILE, "Failed to register libsrtp deinit.")); 524 PJ_PERROR(4, (THIS_FILE, status, 525 "Failed to register libsrtp deinit.")); 526 527 /* Ignore this error */ 528 status = PJ_SUCCESS; 525 529 } 526 530 … … 1758 1762 status = pjmedia_transport_media_stop(srtp->member_tp); 1759 1763 if (status != PJ_SUCCESS) 1760 PJ_ LOG(4, (srtp->pool->obj_name,1761 "SRTP failed stop underlying media transport."));1764 PJ_PERROR(4, (srtp->pool->obj_name, status, 1765 "SRTP failed stop underlying media transport.")); 1762 1766 1763 1767 /* Finally, stop SRTP */ -
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c
r5929 r5982 129 129 crypto_suites[cs_idx].cipher_key_len); 130 130 if (err != 1) { 131 PJ_LOG(5,(THIS_FILE, "Failed generating random key")); 131 PJ_LOG(4,(THIS_FILE, "Failed generating random key " 132 "(native err=%d)", err)); 132 133 return PJMEDIA_ERRNO_FROM_LIBSRTP(1); 133 134 } … … 160 161 161 162 /* Key transmitted via SDP should be base64 encoded. */ 162 status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, (int)crypto->key.slen, 163 status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, 164 (int)crypto->key.slen, 163 165 b64_key, &b64_key_len); 164 166 if (status != PJ_SUCCESS) { 165 PJ_LOG(5,(THIS_FILE, "Failed encoding plain key to base64")); 167 PJ_PERROR(4,(THIS_FILE, status, 168 "Failed encoding plain key to base64")); 166 169 return status; 167 170 } … … 259 262 &itmp); 260 263 if (status != PJ_SUCCESS) { 261 PJ_LOG(4,(THIS_FILE, "Failed decoding crypto key from base64")); 264 PJ_PERROR(4,(THIS_FILE, status, 265 "Failed decoding crypto key from base64")); 262 266 return status; 263 267 } -
pjproject/trunk/pjmedia/src/pjmedia/vid_port.c
r5948 r5982 1001 1001 { 1002 1002 status = pjmedia_vid_dev_stream_set_cap(vp->strm, 1003 1004 1003 PJMEDIA_VID_DEV_CAP_FORMAT, 1004 &vp->conv.conv_param.dst); 1005 1005 if (status != PJ_SUCCESS) { 1006 PJ_ LOG(3, (THIS_FILE, "failure in changing the format of the "1007 "video device"));1006 PJ_PERROR(3,(THIS_FILE, status, 1007 "failure in changing the format of the video device")); 1008 1008 PJ_LOG(3, (THIS_FILE, "reverting to its original format: %s", 1009 1009 status != PJMEDIA_EVID_ERR ? "success" : -
pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
r5968 r5982 41 41 #define THIS_FILE "vid_stream.c" 42 42 #define ERRLEVEL 1 43 #define LOGERR_(expr) stream_perror expr43 #define LOGERR_(expr) PJ_PERROR(4,expr) 44 44 #define TRC_(expr) PJ_LOG(5,expr) 45 45 #define SIGNATURE PJMEDIA_SIG_PORT_VID_STREAM … … 196 196 static pj_status_t decode_frame(pjmedia_vid_stream *stream, 197 197 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 }210 198 211 199 … … 645 633 &hdr, &payload, &payloadlen); 646 634 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")); 648 636 stream->rtcp.stat.rx.discard++; 649 637 return; … … 826 814 827 815 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")); 830 818 pkt_discarded = PJ_TRUE; 831 819 goto on_return; … … 867 855 if (bytes_read < 0) { 868 856 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")); 871 859 } 872 860 return; … … 968 956 &has_more_data); 969 957 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")); 972 960 973 961 /* Update RTP timestamp */ … … 997 985 &rtphdrlen); 998 986 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")); 1001 989 return status; 1002 990 } … … 1017 1005 enum { COUNT_TO_REPORT = 20 }; 1018 1006 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")); 1022 1009 } 1023 1010 if (stream->send_err_cnt > COUNT_TO_REPORT) … … 1046 1033 &has_more_data); 1047 1034 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")); 1050 1037 /* Ignore this error (?) */ 1051 1038 break; … … 1235 1222 (unsigned)frame->size, frame); 1236 1223 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")); 1239 1226 frame->type = PJMEDIA_FRAME_TYPE_NONE; 1240 1227 frame->size = 0; … … 1844 1831 if (status != PJ_SUCCESS) { 1845 1832 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)); 1848 1836 } else { 1849 1837 stream->trace_jb_buf = (char*)pj_pool_alloc(pool, PJ_LOG_MAX_SIZE); -
pjproject/trunk/pjmedia/src/pjmedia/vid_tee.c
r3773 r5982 318 318 frame, &frame_); 319 319 if (status != PJ_SUCCESS) { 320 PJ_ LOG(3, (THIS_FILE,321 322 323 324 320 PJ_PERROR(3, (THIS_FILE, status, 321 "Failed to convert frame for destination" 322 " port %d (%.*s)", i, 323 tee->dst_ports[i].dst->info.name.slen, 324 tee->dst_ports[i].dst->info.name.ptr)); 325 325 continue; 326 326 } -
pjproject/trunk/pjmedia/src/pjmedia/wsola.c
r4537 r5982 528 528 status = pjmedia_circ_buf_create(pool, wsola->buf_size, &wsola->buf); 529 529 if (status != PJ_SUCCESS) { 530 PJ_ LOG(3, (THIS_FILE, "Failed to create circular buf"));530 PJ_PERROR(3, (THIS_FILE, status, "Failed to create circular buf")); 531 531 return status; 532 532 }
Note: See TracChangeset
for help on using the changeset viewer.