Changeset 1944
- Timestamp:
- May 2, 2008 2:50:07 PM (17 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/transport.h
r1873 r1944 305 305 const void *pkt, 306 306 pj_size_t size); 307 308 /** 309 * This function is called by the stream to send RTCP packet using the 310 * transport with destination address other than default specified in 311 * #pjmedia_transport_attach(). 312 * 313 * Application should call #pjmedia_transport_send_rtcp2() instead of 314 * calling this function directly. 315 */ 316 pj_status_t (*send_rtcp2)(pjmedia_transport *tp, 317 const pj_sockaddr_t *addr, 318 unsigned addr_len, 319 const void *pkt, 320 pj_size_t size); 307 321 308 322 /** … … 588 602 589 603 /** 604 * Send RTCP packet with the specified media transport. This is just a simple 605 * wrapper which calls <tt>send_rtcp2()</tt> member of the transport. The 606 * RTCP packet will be delivered to the destination address specified in 607 * param addr, if addr is NULL, RTCP packet will be delivered to destination 608 * address specified in #pjmedia_transport_attach() function. 609 * 610 * @param tp The media transport. 611 * @param addr The destination address. 612 * @param addr_len Length of destination address. 613 * @param pkt The packet to send. 614 * @param size Size of the packet. 615 * 616 * @return PJ_SUCCESS on success, or the appropriate error code. 617 */ 618 PJ_INLINE(pj_status_t) pjmedia_transport_send_rtcp2(pjmedia_transport *tp, 619 const pj_sockaddr_t *addr, 620 unsigned addr_len, 621 const void *pkt, 622 pj_size_t size) 623 { 624 return (*tp->op->send_rtcp2)(tp, addr, addr_len, pkt, size); 625 } 626 627 628 /** 590 629 * Generate local SDP parts that are related to the specified media transport. 591 630 * Remote SDP might be needed as reference when application is in deciding -
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1873 r1944 76 76 const void *pkt, 77 77 pj_size_t size); 78 static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, 79 const pj_sockaddr_t *addr, 80 unsigned addr_len, 81 const void *pkt, 82 pj_size_t size); 78 83 static pj_status_t transport_media_create(pjmedia_transport *tp, 79 84 pj_pool_t *pool, … … 111 116 &transport_send_rtp, 112 117 &transport_send_rtcp, 118 &transport_send_rtcp2, 113 119 &transport_media_create, 114 120 &transport_media_start, … … 771 777 pj_size_t size) 772 778 { 779 return transport_send_rtcp2(tp, NULL, 0, pkt, size); 780 } 781 782 static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, 783 const pj_sockaddr_t *addr, 784 unsigned addr_len, 785 const void *pkt, 786 pj_size_t size) 787 { 773 788 struct transport_ice *tp_ice = (struct transport_ice*)tp; 774 789 if (tp_ice->ice_st->comp_cnt > 1) { 775 return pj_ice_strans_sendto(tp_ice->ice_st, 2, 776 pkt, size, &tp_ice->remote_rtcp, 777 sizeof(pj_sockaddr_in)); 790 if (addr == NULL) { 791 addr = &tp_ice->remote_rtcp; 792 addr_len = pj_sockaddr_get_len(addr); 793 } 794 return pj_ice_strans_sendto(tp_ice->ice_st, 2, pkt, size, 795 addr, addr_len); 778 796 } else { 779 797 return PJ_SUCCESS; -
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r1929 r1944 146 146 const void *pkt, 147 147 pj_size_t size); 148 static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, 149 const pj_sockaddr_t *addr, 150 unsigned addr_len, 151 const void *pkt, 152 pj_size_t size); 148 153 static pj_status_t transport_media_create(pjmedia_transport *tp, 149 154 pj_pool_t *pool, … … 172 177 &transport_send_rtp, 173 178 &transport_send_rtcp, 179 &transport_send_rtcp2, 174 180 &transport_media_create, 175 181 &transport_media_start, … … 658 664 pj_size_t size) 659 665 { 666 return transport_send_rtcp2(tp, NULL, 0, pkt, size); 667 } 668 669 static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, 670 const pj_sockaddr_t *addr, 671 unsigned addr_len, 672 const void *pkt, 673 pj_size_t size) 674 { 660 675 pj_status_t status; 661 676 transport_srtp *srtp = (transport_srtp*) tp; … … 663 678 err_status_t err; 664 679 665 if (srtp->bypass_srtp) 666 return pjmedia_transport_send_rtcp(srtp->real_tp, pkt, size); 680 if (srtp->bypass_srtp) { 681 return pjmedia_transport_send_rtcp2(srtp->real_tp, addr, addr_len, 682 pkt, size); 683 } 667 684 668 685 if (!srtp->session_inited) … … 678 695 679 696 if (err == err_status_ok) { 680 status = pjmedia_transport_send_rtcp (srtp->real_tp, srtp->tx_buffer,681 len);697 status = pjmedia_transport_send_rtcp2(srtp->real_tp, addr, addr_len, 698 srtp->tx_buffer, len); 682 699 } else { 683 700 status = PJMEDIA_ERRNO_FROM_LIBSRTP(err); … … 688 705 return status; 689 706 } 707 690 708 691 709 static pj_status_t transport_simulate_lost(pjmedia_transport *tp, -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r1899 r1944 122 122 const void *pkt, 123 123 pj_size_t size); 124 static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, 125 const pj_sockaddr_t *addr, 126 unsigned addr_len, 127 const void *pkt, 128 pj_size_t size); 124 129 static pj_status_t transport_media_create(pjmedia_transport *tp, 125 130 pj_pool_t *pool, … … 147 152 &transport_send_rtp, 148 153 &transport_send_rtcp, 154 &transport_send_rtcp2, 149 155 &transport_media_create, 150 156 &transport_media_start, … … 749 755 pj_size_t size) 750 756 { 757 return transport_send_rtcp2(tp, NULL, 0, pkt, size); 758 } 759 760 761 /* Called by application to send RTCP packet */ 762 static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, 763 const pj_sockaddr_t *addr, 764 unsigned addr_len, 765 const void *pkt, 766 pj_size_t size) 767 { 751 768 struct transport_udp *udp = (struct transport_udp*)tp; 752 769 pj_ssize_t sent; … … 755 772 PJ_ASSERT_RETURN(udp->attached, PJ_EINVALIDOP); 756 773 774 if (addr == NULL) { 775 addr = &udp->rem_rtcp_addr; 776 addr_len = udp->addr_len; 777 } 778 757 779 sent = size; 758 780 status = pj_ioqueue_sendto( udp->rtcp_key, &udp->rtcp_write_op, 759 pkt, &sent, 0, 760 &udp->rem_rtcp_addr, udp->addr_len); 781 pkt, &sent, 0, addr, addr_len); 761 782 762 783 if (status==PJ_SUCCESS || status==PJ_EPENDING)
Note: See TracChangeset
for help on using the changeset viewer.