Ignore:
Timestamp:
Apr 12, 2012 1:41:50 PM (12 years ago)
Author:
nanang
Message:

Re #1476: Initial version of send rate control in video stream, added simple blocking method (block application thread to make send delay when delay is needed).

File:
1 edited

Legend:

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

    r4012 r4043  
    7272 * #pjmedia_vid stream_info from local and remote SDP session descriptors. 
    7373 */ 
     74 
     75 
     76/** 
     77 * Enumeration of video stream sending rate control. 
     78 */ 
     79typedef enum pjmedia_vid_stream_rc_method 
     80{ 
     81    /** 
     82     * No sending rate control. All outgoing RTP packets will be transmitted 
     83     * immediately right after encoding process is done. 
     84     */ 
     85    PJMEDIA_VID_STREAM_RC_NONE              = 0, 
     86 
     87    /** 
     88     * Simple blocking. Each outgoing RTP packet transmission may be delayed 
     89     * to avoid peak bandwidth that is much higher than specified. The thread 
     90     * invoking the video stream put_frame(), e.g: video capture device thread, 
     91     * will be blocked whenever transmission delay takes place. 
     92     */ 
     93    PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING   = 1 
     94 
     95} pjmedia_vid_stream_rc_method; 
     96 
     97 
     98/** 
     99 * Structure of configuration settings for video stream sending rate control. 
     100 */ 
     101typedef struct pjmedia_vid_stream_rc_config 
     102{ 
     103    /** 
     104     * Rate control method. 
     105     * 
     106     * Default: PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING. 
     107     */ 
     108    pjmedia_vid_stream_rc_method    method; 
     109 
     110    /** 
     111     * Upstream/outgoing bandwidth. If this is set to zero, the video stream 
     112     * will use codec maximum bitrate setting. 
     113     * 
     114     * Default: 0 (follow codec maximum bitrate). 
     115     */ 
     116    unsigned                        bandwidth; 
     117 
     118} pjmedia_vid_stream_rc_config; 
    74119 
    75120 
     
    118163                                    /**< Disable automatic sending of RTCP 
    119164                                         SDES and BYE.                      */ 
     165 
     166    pjmedia_vid_stream_rc_config rc_cfg; 
     167                                    /**< Stream send rate control settings. */ 
    120168} pjmedia_vid_stream_info; 
    121169 
     
    144192                                 const pjmedia_sdp_session *remote, 
    145193                                 unsigned stream_idx); 
     194 
     195 
     196/** 
     197 * Initialize the video stream rate control with default settings. 
     198 * 
     199 * @param cfg           Video stream rate control structure to be initialized. 
     200 */ 
     201PJ_DECL(void) 
     202pjmedia_vid_stream_rc_config_default(pjmedia_vid_stream_rc_config *cfg); 
    146203 
    147204 
Note: See TracChangeset for help on using the changeset viewer.