Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
RTP/RTCP Unit Tests. More...
#include "asterisk.h"
#include "asterisk/module.h"
#include "asterisk/test.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/data_buffer.h"
#include "asterisk/format_cache.h"
#include <assert.h>
#include <sched.h>
Go to the source code of this file.
Enumerations | |
enum | test_type { TEST_TYPE_NONE = 0 , TEST_TYPE_NACK , TEST_TYPE_REMB , TEST_TYPE_STD_RTCP } |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | ast_sched_context_destroy_wrapper (struct ast_sched_context *sched) |
AST_TEST_DEFINE (fir_nominal) | |
AST_TEST_DEFINE (lost_packet_stats_nominal) | |
AST_TEST_DEFINE (mes) | |
AST_TEST_DEFINE (nack_no_packet_loss) | |
AST_TEST_DEFINE (nack_nominal) | |
AST_TEST_DEFINE (nack_overflow) | |
AST_TEST_DEFINE (remb_nominal) | |
AST_TEST_DEFINE (sr_rr_nominal) | |
static int | load_module (void) |
static void | SLEEP_SPINNER (int ms) |
static int | test_init_rtp_instances (struct ast_rtp_instance **instance1, struct ast_rtp_instance **instance2, struct ast_sched_context *test_sched, enum test_type type) |
static void | test_read_frames (struct ast_rtp_instance *instance, int num) |
static void | test_write_and_read_frames (struct ast_rtp_instance *instance1, struct ast_rtp_instance *instance2, int seqno, int num) |
static void | test_write_and_read_interleaved_frames (struct ast_rtp_instance *instance1, struct ast_rtp_instance *instance2, int howlong, int rtcp_interval) |
static void | test_write_frames (struct ast_rtp_instance *instance, int seqno, int num) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "RTP/RTCP test module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, .support_level = AST_MODULE_SUPPORT_CORE, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
RTP/RTCP Unit Tests.
Definition in file test_res_rtp.c.
enum test_type |
Enumerator | |
---|---|
TEST_TYPE_NONE | |
TEST_TYPE_NACK | |
TEST_TYPE_REMB | |
TEST_TYPE_STD_RTCP |
Definition at line 42 of file test_res_rtp.c.
|
static |
Definition at line 719 of file test_res_rtp.c.
|
static |
Definition at line 719 of file test_res_rtp.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 719 of file test_res_rtp.c.
|
static |
Definition at line 49 of file test_res_rtp.c.
References ast_sched_context_destroy().
Referenced by AST_TEST_DEFINE().
AST_TEST_DEFINE | ( | fir_nominal | ) |
Definition at line 597 of file test_res_rtp.c.
References AST_CONTROL_VIDUPDATE, AST_FRAME_CONTROL, ast_frfree, ast_log, ast_rtp_instance_destroy(), ast_rtp_instance_read(), ast_rtp_instance_write(), ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_frame::frametype, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), TEST_TYPE_NONE, and test_write_and_read_frames().
AST_TEST_DEFINE | ( | lost_packet_stats_nominal | ) |
Definition at line 395 of file test_res_rtp.c.
References ast_log, ast_rtp_instance_destroy(), ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_ALL, ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), ast_rtp_instance_stats::local_maxrxploss, ast_rtp_instance_stats::local_minrxploss, LOG_ERROR, NULL, RAII_VAR, ast_rtp_instance_stats::rxploss, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), TEST_TYPE_NONE, test_write_and_read_frames(), and test_write_frames().
AST_TEST_DEFINE | ( | mes | ) |
Definition at line 659 of file test_res_rtp.c.
References ast_log, ast_rtp_instance_destroy(), ast_sched_context_create(), ast_sched_context_destroy_wrapper(), ast_sched_start_thread(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), TEST_TYPE_NONE, and test_write_and_read_interleaved_frames().
AST_TEST_DEFINE | ( | nack_no_packet_loss | ) |
Definition at line 262 of file test_res_rtp.c.
References ast_log, ast_rtp_instance_destroy(), ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), TEST_TYPE_NACK, and test_write_and_read_frames().
AST_TEST_DEFINE | ( | nack_nominal | ) |
Definition at line 300 of file test_res_rtp.c.
References ast_log, ast_rtp_instance_destroy(), ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), test_read_frames(), TEST_TYPE_NACK, and test_write_and_read_frames().
AST_TEST_DEFINE | ( | nack_overflow | ) |
Definition at line 349 of file test_res_rtp.c.
References ast_log, ast_rtp_instance_destroy(), ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), TEST_TYPE_NACK, and test_write_and_read_frames().
AST_TEST_DEFINE | ( | remb_nominal | ) |
Definition at line 475 of file test_res_rtp.c.
References AST_FRAME_RTCP, ast_frfree, ast_log, ast_rtp_instance_destroy(), ast_rtp_instance_read(), ast_rtp_instance_write(), AST_RTP_RTCP_FMT_REMB, AST_RTP_RTCP_PSFB, ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, ast_rtp_rtcp_feedback_remb::br_exp, ast_rtp_rtcp_feedback_remb::br_mantissa, ast_rtp_rtcp_feedback::fmt, ast_frame::frametype, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, ast_rtp_rtcp_feedback::remb, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), and TEST_TYPE_REMB.
AST_TEST_DEFINE | ( | sr_rr_nominal | ) |
Definition at line 539 of file test_res_rtp.c.
References AST_FRAME_RTCP, ast_frfree, ast_log, ast_rtp_instance_destroy(), ast_rtp_instance_read(), AST_RTP_RTCP_RR, AST_RTP_RTCP_SR, ast_sched_context_create(), ast_sched_context_destroy_wrapper(), AST_TEST_FAIL, AST_TEST_NOT_RUN, AST_TEST_PASS, sip_to_pjsip::info(), LOG_ERROR, NULL, RAII_VAR, TEST_EXECUTE, TEST_INIT, test_init_rtp_instances(), TEST_TYPE_NONE, test_write_and_read_frames(), and test_write_frames().
|
static |
Definition at line 706 of file test_res_rtp.c.
References AST_MODULE_LOAD_SUCCESS, and AST_TEST_REGISTER.
|
static |
Definition at line 155 of file test_res_rtp.c.
References a, ast_remaining_ms(), and ast_tvnow().
Referenced by test_write_and_read_interleaved_frames().
|
static |
Definition at line 56 of file test_res_rtp.c.
References ast_rtp_instance_activate(), ast_rtp_instance_get_local_address(), ast_rtp_instance_new(), AST_RTP_INSTANCE_RTCP_MUX, AST_RTP_INSTANCE_RTCP_STANDARD, ast_rtp_instance_set_channel_id(), ast_rtp_instance_set_prop(), ast_rtp_instance_set_remote_address, AST_RTP_PROPERTY_REMB, AST_RTP_PROPERTY_RETRANS_RECV, AST_RTP_PROPERTY_RETRANS_SEND, AST_RTP_PROPERTY_RTCP, ast_sockaddr_parse(), TEST_TYPE_NACK, TEST_TYPE_REMB, TEST_TYPE_STD_RTCP, and type.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 128 of file test_res_rtp.c.
References ast_frfree, and ast_rtp_instance_read().
Referenced by AST_TEST_DEFINE(), and test_write_and_read_frames().
|
static |
Definition at line 141 of file test_res_rtp.c.
References ast_frame::seqno, test_read_frames(), and test_write_frames().
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 171 of file test_res_rtp.c.
References ast_clear_flag, ast_format_ulaw, AST_FRAME_VOICE, AST_FRFLAG_HAS_SEQUENCE_NUMBER, AST_FRFLAG_HAS_TIMING_INFO, ast_frfree, ast_rtp_instance_read(), ast_rtp_instance_write(), ast_set_flag, ast_tvdiff_ms(), ast_tvnow(), ast_frame::data, ast_frame::delivery, ast_frame::frametype, ast_frame::len, ast_frame::seqno, SLEEP_SPINNER(), and ast_frame::ts.
Referenced by AST_TEST_DEFINE().
|
static |
Definition at line 109 of file test_res_rtp.c.
References ast_format_ulaw, AST_FRAME_VOICE, AST_FRFLAG_HAS_SEQUENCE_NUMBER, ast_rtp_instance_write(), ast_set_flag, ast_frame::data, ast_frame::frametype, and ast_frame::seqno.
Referenced by AST_TEST_DEFINE(), and test_write_and_read_frames().
|
static |
Definition at line 693 of file test_res_rtp.c.
References AST_TEST_UNREGISTER.
|
static |
Definition at line 719 of file test_res_rtp.c.
|
static |
Definition at line 719 of file test_res_rtp.c.