Ignore:
Timestamp:
Apr 6, 2006 7:29:03 PM (18 years ago)
Author:
bennylp
Message:

Integrate (stream) quality monitoring into RTCP framework, and update all RTCP clients accordingly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/rtcp.h

    r385 r390  
    147147 
    148148/** 
     149 * Unidirectional RTP stream statistics. 
     150 */ 
     151struct pjmedia_rtcp_stream_stat 
     152{ 
     153    pj_time_val     update;     /**< Time of last update.                   */ 
     154    unsigned        update_cnt; /**< Number of updates (to calculate avg)   */ 
     155    pj_uint32_t     pkt;        /**< Total number of packets                */ 
     156    pj_uint32_t     bytes;      /**< Total number of payload/bytes          */ 
     157    unsigned        discard;    /**< Number of discarded packets.           */ 
     158    unsigned        loss;       /**< Number of packets lost                 */ 
     159    unsigned        reorder;    /**< Number of out of order packets         */ 
     160    unsigned        dup;        /**< Number of duplicates packets           */ 
     161 
     162    struct { 
     163        unsigned    min;        /**< Minimum loss period (in usec)          */ 
     164        unsigned    avg;        /**< Average loss period (in usec)          */ 
     165        unsigned    max;        /**< Maximum loss period (in usec)          */ 
     166        unsigned    last;       /**< Last loss period (in usec)             */ 
     167    } loss_period;              /**< Lost period history.                   */ 
     168 
     169    struct { 
     170        unsigned    burst:1;    /**< Burst/sequential packet lost detected  */ 
     171        unsigned    random:1;   /**< Random packet lost detected.           */ 
     172    } loss_type;                /**< Types of loss detected.                */ 
     173 
     174    struct { 
     175        unsigned    min;        /**< Minimum jitter (in usec)               */ 
     176        unsigned    avg;        /**< Average jitter (in usec)               */ 
     177        unsigned    max;        /**< Maximum jitter (in usec)               */ 
     178        unsigned    last;       /**< Last jitter (in usec)                  */ 
     179    } jitter;                   /**< Jitter history.                        */ 
     180}; 
     181 
     182 
     183/** 
     184 * @see pjmedia_rtcp_stream_stat 
     185 */ 
     186typedef struct pjmedia_rtcp_stream_stat pjmedia_rtcp_stream_stat; 
     187 
     188 
     189 
     190/** 
     191 * Bidirectional RTP stream statistics. 
     192 */ 
     193struct pjmedia_rtcp_stat 
     194{ 
     195    pjmedia_rtcp_stream_stat    tx; /**< Encoder stream statistics.         */ 
     196    pjmedia_rtcp_stream_stat    rx; /**< Decoder stream statistics.         */ 
     197     
     198    struct { 
     199        unsigned    min;            /**< Minimum round-trip delay (in usec) */ 
     200        unsigned    avg;            /**< Average round-trip delay (in usec) */ 
     201        unsigned    max;            /**< Maximum round-trip delay (in usec) */ 
     202        unsigned    last;           /**< Last round-trip delay (in usec)    */ 
     203    } rtt;                          /**< Round trip delay history.          */ 
     204 
     205    unsigned        rtt_update_cnt; /**< Nb of times rtt is updated.        */ 
     206}; 
     207 
     208 
     209/** 
     210 * @see pjmedia_rtcp_stat 
     211 */ 
     212typedef struct pjmedia_rtcp_stat pjmedia_rtcp_stat; 
     213 
     214 
     215/** 
    149216 * RTCP session is used to monitor the RTP session of one endpoint. There 
    150217 * should only be one RTCP session for a bidirectional RTP streams. 
     
    157224 
    158225    unsigned                clock_rate; /**< Clock rate of the stream       */ 
     226    unsigned                pkt_size;   /**< Avg pkt size, in samples.      */ 
    159227    pj_uint32_t             received;   /**< # pkt received                 */ 
    160228    pj_uint32_t             exp_prior;  /**< # pkt expected at last interval*/ 
     
    167235    pj_timestamp            rx_lsr_time;/**< Time when last SR is received  */ 
    168236    pj_uint32_t             peer_ssrc;  /**< Peer SSRC                      */ 
    169     unsigned                rtt_us;     /**< End-to-end delay, in usec.     */ 
     237     
     238    pjmedia_rtcp_stat       stat;       /**< Bidirectional stream stat.     */ 
    170239}; 
    171240 
     
    179248 * Initialize RTCP session. 
    180249 * 
    181  * @param session   The session 
    182  * @param ssrc      The SSRC used in to identify the session. 
     250 * @param session           The session 
     251 * @param clock_rate        Codec clock rate in samples per second. 
     252 * @param samples_per_frame Average number of samples per frame. 
     253 * @param ssrc              The SSRC used in to identify the session. 
    183254 */ 
    184255PJ_DECL(void) pjmedia_rtcp_init( pjmedia_rtcp_session *session,  
    185256                                 unsigned clock_rate, 
     257                                 unsigned samples_per_frame, 
    186258                                 pj_uint32_t ssrc ); 
    187259 
     
    202274 * @param seq       The RTP packet sequence number, in host byte order. 
    203275 * @param ts        The RTP packet timestamp, in host byte order. 
     276 * @param payload   Size of the payload. 
    204277 */ 
    205278PJ_DECL(void) pjmedia_rtcp_rx_rtp( pjmedia_rtcp_session *session,  
    206                                    pj_uint16_t seq,  
    207                                    pj_uint32_t ts ); 
     279                                   unsigned seq,  
     280                                   unsigned ts, 
     281                                   unsigned payload); 
    208282 
    209283 
     
    217291 */ 
    218292PJ_DECL(void) pjmedia_rtcp_tx_rtp( pjmedia_rtcp_session *session,  
    219                                    pj_uint16_t ptsize ); 
     293                                   unsigned ptsize ); 
    220294 
    221295 
Note: See TracChangeset for help on using the changeset viewer.