Changeset 435 for pjproject/trunk/pjmedia/include/pjmedia/jbuf.h
- Timestamp:
- May 11, 2006 2:22:01 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/jbuf.h
r408 r435 46 46 enum pjmedia_jb_frame_type 47 47 { 48 PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing. */ 49 PJMEDIA_JB_NORMAL_FRAME = 1, /**< Normal frame is being returned. */ 50 PJMEDIA_JB_ZERO_FRAME = 2, /**< Zero frame is being returned. */ 48 PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing */ 49 PJMEDIA_JB_NORMAL_FRAME = 1, /**< Normal frame is being returned */ 50 PJMEDIA_JB_ZERO_PREFETCH_FRAME = 2, /**< Zero frame is being returned 51 because JB is bufferring. */ 52 PJMEDIA_JB_ZERO_EMPTY_FRAME = 3 /**< Zero frame is being returned 53 because JB is empty. */ 51 54 }; 55 56 57 /** 58 * This structure describes jitter buffer current status. 59 */ 60 struct pjmedia_jb_state 61 { 62 unsigned frame_size; /**< Individual frame size, in bytes. */ 63 unsigned prefetch; /**< Current prefetch value, in frames */ 64 unsigned min_prefetch; /**< Minimum allowed prefetch, in frms. */ 65 unsigned max_prefetch; /**< Maximum allowed prefetch, in frms. */ 66 unsigned size; /**< Current buffer size, in frames. */ 67 }; 68 69 70 /** 71 * @see pjmedia_jb_state 72 */ 73 typedef struct pjmedia_jb_state pjmedia_jb_state; 52 74 53 75 … … 60 82 61 83 /** 62 * Create the jitter buffer. This function may allocate large chunk of 63 * memory to keep the frames in the buffer. 84 * Create an adaptive jitter buffer according to the specification. If 85 * application wants to have a fixed jitter buffer, it may call 86 * #pjmedia_jbuf_set_fixed() after the jitter buffer is created. 87 * 88 * This function may allocate large chunk of memory to keep the frames in 89 * the buffer. 64 90 * 65 91 * @param pool The pool to allocate memory. … … 67 93 * purpose. 68 94 * @param frame_size The size of each frame that will be kept in the 69 * jitter buffer. The value here normaly corresponds 70 * to the RTP payload size according to the codec 71 * being used. 72 * @param init_delay Initial jitter buffer delay, in number of frames. 73 * @param max_count Maximum jitter buffer delay, in number of frames. 95 * jitter buffer, in bytes. This should correspond 96 * to the minimum frame size supported by the codec. 97 * For example, a 10ms frame (80 bytes) would be 98 * recommended for G.711 codec. 99 * @param max_count Maximum number of frames that can be kept in the 100 * jitter buffer. This effectively means the maximum 101 * delay that may be introduced by this jitter 102 * buffer. 74 103 * @param p_jb Pointer to receive jitter buffer instance. 75 104 * … … 78 107 PJ_DECL(pj_status_t) pjmedia_jbuf_create(pj_pool_t *pool, 79 108 const pj_str_t *name, 80 int frame_size, 81 int init_delay, 82 int max_count, 109 unsigned frame_size, 110 unsigned max_count, 83 111 pjmedia_jbuf **p_jb); 112 113 /** 114 * Set the jitter buffer to fixed delay mode. The default behavior 115 * is to adapt the delay with actual packet delay. 116 * 117 * @param jb The jitter buffer 118 * @param prefetch The fixed delay value, in number of frames. 119 * 120 * @return PJ_SUCCESS on success. 121 */ 122 PJ_DECL(pj_status_t) pjmedia_jbuf_set_fixed( pjmedia_jbuf *jb, 123 unsigned prefetch); 124 125 126 /** 127 * Set the jitter buffer to adaptive mode. 128 * 129 * @param jb The jitter buffer. 130 * @param prefetch The prefetch value to be applied to the jitter 131 * buffer. 132 * @param min_prefetch The minimum delay that must be applied to each 133 * incoming packets, in number of frames. The 134 * default value is zero. 135 * @param max_prefetch The maximum allowable value for prefetch delay, 136 * in number of frames. The default value is equal 137 * to the size of the jitter buffer. 138 * 139 * @return PJ_SUCCESS on success. 140 */ 141 PJ_DECL(pj_status_t) pjmedia_jbuf_set_adaptive( pjmedia_jbuf *jb, 142 unsigned prefetch, 143 unsigned min_prefetch, 144 unsigned max_prefetch); 145 84 146 85 147 /** … … 156 218 char *p_frm_type); 157 219 158 /** 159 * Retrieve the current value of jitter buffer minimum delay, in number 160 * of frames. 161 * 162 * @param jb The jitter buffer. 163 * 164 * @return Number of frames, indicating the minimum delay that 165 * will be applied by the jitter buffer between frame 166 * arrival and frame retrieval. 167 */ 168 PJ_DECL(unsigned) pjmedia_jbuf_get_min_delay_size(pjmedia_jbuf *jb); 169 170 171 /** 172 * Retrieve the current delay value, in number of frames. 173 * 174 * @param jb The jitter buffer. 175 * 176 * @return Number of frames, indicating the delay between frame 177 * arrival and frame retrieval. 178 */ 179 PJ_DECL(unsigned) pjmedia_jbuf_get_delay(pjmedia_jbuf *jb); 220 221 /** 222 * Get jitter buffer state. 223 * 224 * @param jb The jitter buffer. 225 * @param state Buffer to receive jitter buffer state. 226 * 227 * @return PJ_SUCCESS on success. 228 */ 229 PJ_DECL(pj_status_t) pjmedia_jbuf_get_state( pjmedia_jbuf *jb, 230 pjmedia_jb_state *state ); 180 231 181 232
Note: See TracChangeset
for help on using the changeset viewer.