Changeset 3814 for pjproject/branches/1.x/pjmedia/include/pjmedia/jbuf.h
- Timestamp:
- Oct 13, 2011 9:02:41 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjmedia/include/pjmedia/jbuf.h
r3553 r3814 49 49 * Types of frame returned by the jitter buffer. 50 50 */ 51 enum pjmedia_jb_frame_type51 typedef enum pjmedia_jb_frame_type 52 52 { 53 53 PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing */ … … 57 57 PJMEDIA_JB_ZERO_EMPTY_FRAME = 3 /**< Zero frame is being returned 58 58 because JB is empty. */ 59 }; 60 61 62 /** 63 * @see pjmedia_jb_frame_type. 64 */ 65 typedef enum pjmedia_jb_frame_type pjmedia_jb_frame_type; 59 } pjmedia_jb_frame_type; 60 61 62 /** 63 * Enumeration of jitter buffer discard algorithm. The jitter buffer 64 * continuously calculates the jitter level to get the optimum latency at 65 * any time and in order to adjust the latency, the jitter buffer may need 66 * to discard some frames. 67 */ 68 typedef enum pjmedia_jb_discard_algo 69 { 70 /** 71 * Jitter buffer should not discard any frame, except when the jitter 72 * buffer is full and a new frame arrives, one frame will be discarded 73 * to make space for the new frame. 74 */ 75 PJMEDIA_JB_DISCARD_NONE = 0, 76 77 /** 78 * Only discard one frame in at least 200ms when the latency is considered 79 * much higher than it should be. When the jitter buffer is full and a new 80 * frame arrives, one frame will be discarded to make space for the new 81 * frame. 82 */ 83 PJMEDIA_JB_DISCARD_STATIC, 84 85 /** 86 * The discard rate is dynamically calculated based on actual parameters 87 * such as jitter level and latency. When the jitter buffer is full and 88 * a new frame arrives, one frame will be discarded to make space for the 89 * new frame. 90 */ 91 PJMEDIA_JB_DISCARD_PROGRESSIVE 92 93 } pjmedia_jb_discard_algo; 66 94 67 95 … … 69 97 * This structure describes jitter buffer state. 70 98 */ 71 struct pjmedia_jb_state99 typedef struct pjmedia_jb_state 72 100 { 73 101 /* Setting */ … … 90 118 unsigned discard; /**< Number of discarded frames. */ 91 119 unsigned empty; /**< Number of empty on GET events. */ 92 }; 93 94 95 /** 96 * @see pjmedia_jb_state 97 */ 98 typedef struct pjmedia_jb_state pjmedia_jb_state; 120 } pjmedia_jb_state; 99 121 100 122 … … 114 136 * Create an adaptive jitter buffer according to the specification. If 115 137 * application wants to have a fixed jitter buffer, it may call 116 * #pjmedia_jbuf_set_fixed() after the jitter buffer is created. 138 * #pjmedia_jbuf_set_fixed() after the jitter buffer is created. Also 139 * if application wants to alter the discard algorithm, which the default 140 * PJMEDIA_JB_DISCARD_PROGRESSIVE, it may call #pjmedia_jbuf_set_discard(). 117 141 * 118 142 * This function may allocate large chunk of memory to keep the frames in … … 178 202 unsigned min_prefetch, 179 203 unsigned max_prefetch); 204 205 206 /** 207 * Set the jitter buffer discard algorithm. The default discard algorithm, 208 * set in jitter buffer creation, is PJMEDIA_JB_DISCARD_PROGRESSIVE. 209 * 210 * @param jb The jitter buffer. 211 * @param algo The discard algorithm to be used. 212 * 213 * @return PJ_SUCCESS on success. 214 */ 215 PJ_DECL(pj_status_t) pjmedia_jbuf_set_discard(pjmedia_jbuf *jb, 216 pjmedia_jb_discard_algo algo); 180 217 181 218
Note: See TracChangeset
for help on using the changeset viewer.