blob: 25444f2172c6a3437d7923904f4c4ceeef6dc158 [file] [log] [blame]
Benny Prijonoff64ccf2009-07-16 11:37:15 +00001/* $Id$ */
2/*
3 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
Benny Prijono7b40c6c2009-07-16 10:36:48 +000019#ifndef __SYSTEST_H__
20#define __SYSTEST_H__
21
22#include <pjlib.h>
23
24/*
25 * Overrideable parameters
26 */
Benny Prijonoadca6fd2010-05-10 09:05:19 +000027#define REC_DEV_ID systest_cap_dev_id
28#define PLAY_DEV_ID systest_play_dev_id
Benny Prijono258dc212009-07-17 11:37:42 +000029//#define REC_DEV_ID 5
30//#define PLAY_DEV_ID 5
31#define OVERRIDE_AUDDEV_REC_LAT 0
32#define OVERRIDE_AUDDEV_PLAY_LAT 0
Benny Prijono7b40c6c2009-07-16 10:36:48 +000033#define OVERRIDE_AUD_FRAME_PTIME 0
Benny Prijono258dc212009-07-17 11:37:42 +000034
35/* Don't change this */
Benny Prijono7b40c6c2009-07-16 10:36:48 +000036#define CHANNEL_COUNT 1
37
Benny Prijono258dc212009-07-17 11:37:42 +000038/* If you change CLOCK_RATE then the input WAV files need to be
39 * changed, so normally don't need to change this.
40 */
41#define TEST_CLOCK_RATE 8000
42
43/* You may change sound device's clock rate as long as resampling
44 * is enabled.
45 */
46#define DEV_CLOCK_RATE 8000
47
48
Benny Prijono7b40c6c2009-07-16 10:36:48 +000049#if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE
50 #define LOG_OUT_PATH "\\PJSYSTEST.LOG"
51 #define RESULT_OUT_PATH "\\PJSYSTEST_RESULT.TXT"
52 #define WAV_PLAYBACK_PATH "\\Program Files\\pjsystest\\input.8.wav"
53 #define WAV_REC_OUT_PATH "\\PJSYSTEST_TESTREC.WAV"
54 #define WAV_TOCK8_PATH "\\Program Files\\pjsystest\\tock8.WAV"
55 #define WAV_LATENCY_OUT_PATH "\\PJSYSTEST_LATREC.WAV"
Benny Prijonoc6f0e1a2009-11-08 03:35:41 +000056 #define ALT_PATH1 ""
Benny Prijono7b40c6c2009-07-16 10:36:48 +000057#else
58 #define LOG_OUT_PATH "PJSYSTEST.LOG"
Benny Prijono258dc212009-07-17 11:37:42 +000059 #define RESULT_OUT_PATH "PJSYSTEST_RESULT.TXT"
60 #define WAV_PLAYBACK_PATH "input.8.wav"
61 #define WAV_REC_OUT_PATH "PJSYSTEST_TESTREC.WAV"
62 #define WAV_TOCK8_PATH "tock8.wav"
63 #define WAV_LATENCY_OUT_PATH "PJSYSTEST_LATREC.WAV"
Benny Prijonoc6f0e1a2009-11-08 03:35:41 +000064 #define ALT_PATH1 "../../tests/pjsua/wavs/"
Benny Prijono7b40c6c2009-07-16 10:36:48 +000065#endif
66
67#ifdef __cplusplus
68extern "C" {
69#endif
70
Benny Prijonoff64ccf2009-07-16 11:37:15 +000071/* API, to be called by main() */
Benny Prijono7b40c6c2009-07-16 10:36:48 +000072int systest_init(void);
Benny Prijonoc712c282010-05-10 09:51:02 +000073int systest_set_dev(int cap_dev, int play_dev);
Benny Prijono7b40c6c2009-07-16 10:36:48 +000074int systest_run(void);
75void systest_save_result(const char *filename);
76void systest_deinit(void);
77
Benny Prijonoadca6fd2010-05-10 09:05:19 +000078/* Device ID to test */
79extern int systest_cap_dev_id;
80extern int systest_play_dev_id;
81
Benny Prijonoff64ccf2009-07-16 11:37:15 +000082/* Test item is used to record the test result */
Benny Prijono7b40c6c2009-07-16 10:36:48 +000083typedef struct test_item_t
84{
85 char title[80];
86 pj_bool_t skipped;
87 pj_bool_t success;
88 char reason[1024];
89} test_item_t;
90
91#define SYSTEST_MAX_TEST 32
92extern unsigned test_item_count;
93extern test_item_t test_items[SYSTEST_MAX_TEST];
Sauw Ming9b206052010-08-09 06:40:38 +000094#define PATH_LENGTH PJ_MAXPATH
Sauw Minga7487622010-03-30 11:42:51 +000095extern char doc_path[PATH_LENGTH];
96extern char res_path[PATH_LENGTH];
Benny Prijono7b40c6c2009-07-16 10:36:48 +000097
98test_item_t *systest_alloc_test_item(const char *title);
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif /* __SYSTEST_H__ */