Review Board 1.7.16


Abstract Jitter Buffer API Unit Tests

Review Request #2035 - Created July 12, 2012 and submitted

Matt Jordan
trunk
Reviewers
asterisk-dev
mmichelson
Asterisk
This patch pulls over the unit test from the now defunct DTMF jitter buffer patch.  It includes the following:

* Tweaks to the abstract_jb API to remove the unnecessary resync_threshold parameter from the create function (resync_threshold is already in the struct passed into the create function)
* Ensure the fixed jitter buffer is empty before destroying it, to avoid an ASSERT
* Don't "resync" the adaptive jitter buffer.  The mechanism that was being used actually causes the jitter buffer to think its being overflowed by going around the jitterbuf API and attempting to 'resynch' it improperly.  If a resync is needed, the jitter buffer will do it properly by itself.  Note that this is only an optimization needed for trunk, as the worst that happens is the loss of three voice packets before the adaptive jitter buffer will resync anyway (but it does cause the unit tests to fail, as the first packet in gets treated as an overflow).

This pulls over the unit tests for the abstract_jb, removing the DTMF portions.

 
/trunk/funcs/func_jitterbuffer.c
Revision 370013 New Change
[20] 179 lines
[+20] [+] static int jb_framedata_init(struct jb_framedata *framedata, const char *data, const char *value)
180
			ast_log(LOG_WARNING, "Invalid jitterbuffer parameters %s\n", value);
180
			ast_log(LOG_WARNING, "Invalid jitterbuffer parameters %s\n", value);
181
		}
181
		}
182
	}
182
	}
183

    
   
183

   
184
	/* now that all the user parsing is done and nothing will change, create the jb obj */
184
	/* now that all the user parsing is done and nothing will change, create the jb obj */
185
	framedata->jb_obj = framedata->jb_impl->create(&framedata->jb_conf, framedata->jb_conf.resync_threshold);
185
	framedata->jb_obj = framedata->jb_impl->create(&framedata->jb_conf);
186
	return 0;
186
	return 0;
187
}
187
}
188

    
   
188

   
189
static void datastore_destroy_cb(void *data) {
189
static void datastore_destroy_cb(void *data) {
190
	ast_free(data);
190
	ast_free(data);
[+20] [20] 200 lines
/trunk/include/asterisk/abstract_jb.h
Revision 370013 New Change
 
/trunk/main/abstract_jb.c
Revision 370013 New Change
 
/trunk/tests/test_abstract_jb.c
New File
 
  1. /trunk/funcs/func_jitterbuffer.c: Loading...
  2. /trunk/include/asterisk/abstract_jb.h: Loading...
  3. /trunk/main/abstract_jb.c: Loading...
  4. /trunk/tests/test_abstract_jb.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.