Ignore:
Timestamp:
Apr 10, 2011 11:26:41 PM (13 years ago)
Author:
bennylp
Message:

Re #1182:

  • Removed RTCP-XR from video stream.
  • Fixed few compile warnings on GCC for incompatible pointers.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c

    r3500 r3513  
    119119    unsigned                 frame_ts_len;  /**< Frame length in timestamp. */ 
    120120 
    121 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) 
    122     pj_uint32_t              rtcp_xr_last_tx;  /**< RTCP XR tx time  
    123                                                     in timestamp.           */ 
    124     pj_uint32_t              rtcp_xr_interval; /**< Interval, in timestamp. */ 
    125     pj_sockaddr              rtcp_xr_dest;     /**< Additional remote RTCP XR  
    126                                                     dest. If sin_family is  
    127                                                     zero, it will be ignored*/ 
    128     unsigned                 rtcp_xr_dest_len; /**< Length of RTCP XR dest 
    129                                                     address                 */ 
    130 #endif 
    131  
    132121#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0 
    133122    pj_bool_t                use_ka;           /**< Stream keep-alive with non- 
     
    403392        stream->rtcp_last_tx = timestamp; 
    404393    } 
    405  
    406 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) 
    407     if (stream->rtcp.xr_enabled) { 
    408  
    409         if (stream->rtcp_xr_last_tx == 0) { 
    410          
    411             stream->rtcp_xr_last_tx = timestamp; 
    412  
    413         } else if (timestamp - stream->rtcp_xr_last_tx >=  
    414                    stream->rtcp_xr_interval) 
    415         { 
    416             int i; 
    417             pjmedia_jb_state jb_state; 
    418             void *rtcp_pkt; 
    419             int len; 
    420  
    421             /* Update RTCP XR with current JB states */ 
    422             pjmedia_jbuf_get_state(stream->jb, &jb_state); 
    423              
    424             i = jb_state.avg_delay; 
    425             pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session,  
    426                                         PJMEDIA_RTCP_XR_INFO_JB_NOM, 
    427                                         i); 
    428  
    429             i = jb_state.max_delay; 
    430             pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session,  
    431                                         PJMEDIA_RTCP_XR_INFO_JB_MAX, 
    432                                         i); 
    433  
    434             /* Build RTCP XR packet */ 
    435             pjmedia_rtcp_build_rtcp_xr(&stream->rtcp.xr_session, 0,  
    436                                        &rtcp_pkt, &len); 
    437  
    438             /* Send the RTCP XR to remote address */ 
    439             pjmedia_transport_send_rtcp(stream->transport, rtcp_pkt, len); 
    440  
    441             /* Send the RTCP XR to third-party destination if specified */ 
    442             if (stream->rtcp_xr_dest_len) { 
    443                 pjmedia_transport_send_rtcp2(stream->transport,  
    444                                              &stream->rtcp_xr_dest, 
    445                                              stream->rtcp_xr_dest_len,  
    446                                              rtcp_pkt, len); 
    447             } 
    448  
    449             /* Update last tx RTCP XR */ 
    450             stream->rtcp_xr_last_tx = timestamp; 
    451         } 
    452     } 
    453 #endif 
    454394} 
    455395 
     
    773713        /* Update RTP timestamp */ 
    774714        pjmedia_rtp_encode_rtp(&channel->rtp, channel->pt, 1, 0, 
    775                                rtp_ts_len, &rtphdr, &rtphdrlen); 
     715                               rtp_ts_len,  (const void**)&rtphdr, &rtphdrlen); 
    776716        return status; 
    777717    } 
     
    797737            /* Update RTP timestamp */ 
    798738            pjmedia_rtp_encode_rtp(&channel->rtp, channel->pt, 1, 0, 
    799                                    rtp_ts_len, &rtphdr, &rtphdrlen); 
     739                                   rtp_ts_len,  (const void**)&rtphdr, 
     740                                   &rtphdrlen); 
    800741            return status; 
    801742        } 
     
    923864                 * the payload (no buffer and memcpy needed), just as we need. 
    924865                 */ 
    925                 pjmedia_jbuf_peek_frame(stream->jb, i, &p, 
     866                pjmedia_jbuf_peek_frame(stream->jb, i, (const void**)&p, 
    926867                                        &psize, &ptype, NULL, NULL, NULL); 
    927868 
     
    14241365    PJ_ASSERT_RETURN(stream != NULL, PJ_EINVAL); 
    14251366 
    1426 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) 
    1427     /* Send RTCP XR on stream destroy */ 
    1428     if (stream->rtcp.xr_enabled) { 
    1429         int i; 
    1430         pjmedia_jb_state jb_state; 
    1431         void *rtcp_pkt; 
    1432         int len; 
    1433  
    1434         /* Update RTCP XR with current JB states */ 
    1435         pjmedia_jbuf_get_state(stream->jb, &jb_state); 
    1436              
    1437         i = jb_state.avg_delay; 
    1438         pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session,  
    1439                                     PJMEDIA_RTCP_XR_INFO_JB_NOM, 
    1440                                     i); 
    1441  
    1442         i = jb_state.max_delay; 
    1443         pjmedia_rtcp_xr_update_info(&stream->rtcp.xr_session,  
    1444                                     PJMEDIA_RTCP_XR_INFO_JB_MAX, 
    1445                                     i); 
    1446  
    1447         /* Build RTCP XR packet */ 
    1448         pjmedia_rtcp_build_rtcp_xr(&stream->rtcp.xr_session, 0,  
    1449                                    &rtcp_pkt, &len); 
    1450  
    1451         /* Send the RTCP XR to remote address */ 
    1452         pjmedia_transport_send_rtcp(stream->transport, rtcp_pkt, len); 
    1453          
    1454         /* Send the RTCP XR to third-party destination if specified */ 
    1455         if (stream->rtcp_xr_dest_len) { 
    1456             pjmedia_transport_send_rtcp2(stream->transport,  
    1457                                          &stream->rtcp_xr_dest, 
    1458                                          stream->rtcp_xr_dest_len,  
    1459                                          rtcp_pkt, len); 
    1460         } 
    1461     } 
    1462 #endif 
    1463  
    14641367    /* Send RTCP BYE */ 
    14651368    if (stream->enc && stream->transport) { 
     
    15761479} 
    15771480 
    1578  
    1579 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) 
    1580 /* 
    1581  * Get stream extended statistics. 
    1582  */ 
    1583 PJ_DEF(pj_status_t) pjmedia_stream_get_stat_xr( 
    1584                                             const pjmedia_vid_stream *stream, 
    1585                                             pjmedia_rtcp_xr_stat *stat) 
    1586 { 
    1587     PJ_ASSERT_RETURN(stream && stat, PJ_EINVAL); 
    1588  
    1589     if (stream->rtcp.xr_enabled) { 
    1590         pj_memcpy(stat, &stream->rtcp.xr_session.stat, 
    1591                   sizeof(pjmedia_rtcp_xr_stat)); 
    1592         return PJ_SUCCESS; 
    1593     } 
    1594     return PJ_ENOTFOUND; 
    1595 } 
    1596 #endif 
    15971481 
    15981482/* 
     
    18441728 
    18451729    pj_bzero(si, sizeof(*si)); 
    1846  
    1847 #if PJMEDIA_HAS_RTCP_XR && PJMEDIA_STREAM_ENABLE_XR 
    1848     /* Set default RTCP XR enabled/disabled */ 
    1849     si->rtcp_xr_enabled = PJ_TRUE; 
    1850 #endif 
    18511730 
    18521731    /* Media type: */ 
Note: See TracChangeset for help on using the changeset viewer.