- Added new audio device VAS for Symbian platform.
 - Updated symsndtest to use the latest audio device framework.



git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2821 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Nanang Izzuddin 2009-06-30 13:37:26 +00:00
parent 45fe2e81e2
commit d687a5028c
11 changed files with 2521 additions and 256 deletions

View File

@ -15,6 +15,7 @@ SOURCE audiodev.c
SOURCE errno.c
SOURCE symb_aps_dev.cpp
SOURCE symb_mda_dev.cpp
SOURCE symb_vas_dev.cpp
SYSTEMINCLUDE ..\pjmedia\include
SYSTEMINCLUDE ..\pjlib\include

View File

@ -51,7 +51,7 @@ STATICLIBRARY libresample.lib
#endif
#if SND_HAS_VAS
// LIBRARY
LIBRARY VoIPAudioIntfc.lib
#endif
#if SND_HAS_MDA

View File

@ -1,4 +1,4 @@
#define SND_USE_APS 1
#define SND_USE_APS 0
#define SND_USE_VAS 0
TARGET symsndtest.exe
@ -28,13 +28,14 @@ SYSTEMINCLUDE \epoc32\include\libc
LIBRARY charconv.lib euser.lib estlib.lib
LIBRARY esock.lib insock.lib
STATICLIBRARY pjlib.lib pjmedia.lib
STATICLIBRARY symbian_audio.lib
STATICLIBRARY pjmedia_audiodev.lib
STATICLIBRARY libresample.lib
#if SND_USE_APS
LIBRARY APSSession2.lib
CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD
#elif SND_USE_VAS
// LIBRARY
LIBRARY VoIPAudioIntfc.lib
CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD
#else
LIBRARY mediaclientaudiostream.lib

View File

@ -14,6 +14,6 @@
:"PJSIP"
; Target
"C:\Symbian\9.1\S60_3rd_MR\Epoc32\release\gcce\UDEB\symsndtest.exe"-"!:\sys\bin\symsndtest.exe"
"C:\Symbian\9.1\S60_3rd_MR\Epoc32\data\z\private\10003a3f\apps\symsndtest_reg.rSC"-"!:\private\10003a3f\import\apps\symsndtest_reg.rSC"
"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\symsndtest.exe"-"!:\sys\bin\symsndtest.exe"
"$(EPOCROOT)Epoc32\data\z\private\10003a3f\apps\symsndtest_reg.rSC"-"!:\private\10003a3f\import\apps\symsndtest_reg.rSC"

View File

@ -239,6 +239,34 @@
#endif
/*
* Additional configuration to activate VAS-Direct feature for
* Nokia S60 target
*
* Please see http://trac.pjsip.org/repos/wiki/Nokia_APS_VAS_Direct
*/
#ifdef PJ_CONFIG_NOKIA_VAS_DIRECT
/* MUST use switchboard rather than the conference bridge */
#define PJMEDIA_CONF_USE_SWITCH_BOARD 1
/* Enable APS sound device backend and disable MDA */
#define PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA 0
#define PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS 1
/* Enable passthrough codec framework */
#define PJMEDIA_HAS_PASSTHROUGH_CODECS 1
/* And selectively enable which codecs are supported by the handset */
#define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1
#define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1
#define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1
#define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1
#define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1
#endif
/*
* Configuration to activate "APS-Direct" media mode on Windows,
* useful for testing purposes only.

File diff suppressed because it is too large Load Diff

View File

@ -66,6 +66,14 @@ PJ_BEGIN_DECL
#endif
/**
* This setting controls whether Symbian VAS support should be included.
*/
#ifndef PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS
# define PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS 0
#endif
/**
* This setting controls whether Symbian audio (using built-in multimedia
* framework) support should be included.

View File

@ -74,6 +74,10 @@ pjmedia_aud_dev_factory* pjmedia_pa_factory(pj_pool_factory *pf);
pjmedia_aud_dev_factory* pjmedia_wmme_factory(pj_pool_factory *pf);
#endif
#if PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS
pjmedia_aud_dev_factory* pjmedia_symb_vas_factory(pj_pool_factory *pf);
#endif
#if PJMEDIA_AUDIO_DEV_HAS_SYMB_APS
pjmedia_aud_dev_factory* pjmedia_aps_factory(pj_pool_factory *pf);
#endif
@ -370,6 +374,9 @@ PJ_DEF(pj_status_t) pjmedia_aud_subsys_init(pj_pool_factory *pf)
#if PJMEDIA_AUDIO_DEV_HAS_WMME
aud_subsys.drv[aud_subsys.drv_cnt++].create = &pjmedia_wmme_factory;
#endif
#if PJMEDIA_AUDIO_DEV_HAS_SYMB_VAS
aud_subsys.drv[aud_subsys.drv_cnt++].create = &pjmedia_symb_vas_factory;
#endif
#if PJMEDIA_AUDIO_DEV_HAS_SYMB_APS
aud_subsys.drv[aud_subsys.drv_cnt++].create = &pjmedia_aps_factory;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,7 @@ STATICLIBRARY libresample.lib
#endif
#if SND_HAS_VAS
// LIBRARY
LIBRARY VoIPAudioIntfc.lib
#endif
#if SND_HAS_MDA

View File

@ -17,8 +17,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <pjmedia-audiodev/audiodev.h>
#include <pjmedia/delaybuf.h>
#include <pjmedia/sound.h>
#include <pj/assert.h>
#include <pj/errno.h>
#include <pj/os.h>
#include <pj/log.h>
@ -36,7 +37,7 @@
extern CConsoleBase* console;
static pj_caching_pool cp;
static pjmedia_snd_stream *strm;
static pjmedia_aud_stream *strm;
static unsigned rec_cnt, play_cnt;
static pj_time_val t_start;
@ -85,7 +86,7 @@ static pj_status_t app_init()
pj_caching_pool_init(&cp, NULL, 0);
/* Init sound subsystem */
status = pjmedia_snd_init(&cp.factory);
status = pjmedia_aud_subsys_init(&cp.factory);
if (status != PJ_SUCCESS) {
app_perror("pjmedia_snd_init()", status);
pj_caching_pool_destroy(&cp);
@ -93,15 +94,17 @@ static pj_status_t app_init()
return status;
}
count = pjmedia_snd_get_dev_count();
count = pjmedia_aud_dev_count();
PJ_LOG(3,(THIS_FILE, "Device count: %d", count));
for (i=0; i<count; ++i) {
const pjmedia_snd_dev_info *info;
pjmedia_aud_dev_info info;
pj_status_t status;
info = pjmedia_snd_get_dev_info(i);
status = pjmedia_aud_dev_get_info(i, &info);
pj_assert(status == PJ_SUCCESS);
PJ_LOG(3, (THIS_FILE, "%d: %s %d/%d %dHz",
i, info->name, info->input_count, info->output_count,
info->default_samples_per_sec));
i, info.name, info.input_count, info.output_count,
info.default_samples_per_sec));
}
/* Create pool */
@ -130,19 +133,15 @@ static pj_status_t app_init()
/* Sound capture callback */
static pj_status_t rec_cb(void *user_data,
pj_uint32_t timestamp,
void *input,
unsigned size)
pjmedia_frame *frame)
{
PJ_UNUSED_ARG(user_data);
PJ_UNUSED_ARG(timestamp);
PJ_UNUSED_ARG(size);
pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)input);
pjmedia_delay_buf_put(delaybuf, (pj_int16_t*)frame->buf);
if (size != SAMPLES_PER_FRAME*2) {
if (frame->size != SAMPLES_PER_FRAME*2) {
PJ_LOG(3, (THIS_FILE, "Size captured = %u",
size));
frame->size));
}
++rec_cnt;
@ -151,15 +150,13 @@ static pj_status_t rec_cb(void *user_data,
/* Play cb */
static pj_status_t play_cb(void *user_data,
pj_uint32_t timestamp,
void *output,
unsigned size)
pjmedia_frame *frame)
{
PJ_UNUSED_ARG(user_data);
PJ_UNUSED_ARG(timestamp);
PJ_UNUSED_ARG(size);
pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)output);
pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)frame->buf);
frame->size = SAMPLES_PER_FRAME*2;
frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
++play_cnt;
return PJ_SUCCESS;
@ -168,6 +165,7 @@ static pj_status_t play_cb(void *user_data,
/* Start sound */
static pj_status_t snd_start(unsigned flag)
{
pjmedia_aud_param param;
pj_status_t status;
if (strm != NULL) {
@ -175,19 +173,13 @@ static pj_status_t snd_start(unsigned flag)
return PJ_EINVALIDOP;
}
if (flag==PJMEDIA_DIR_CAPTURE_PLAYBACK)
status = pjmedia_snd_open(-1, -1, CLOCK_RATE, CHANNEL_COUNT,
SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
&rec_cb, &play_cb, NULL, &strm);
else if (flag==PJMEDIA_DIR_CAPTURE)
status = pjmedia_snd_open_rec(-1, CLOCK_RATE, CHANNEL_COUNT,
SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
&rec_cb, NULL, &strm);
else
status = pjmedia_snd_open_player(-1, CLOCK_RATE, CHANNEL_COUNT,
SAMPLES_PER_FRAME, BITS_PER_SAMPLE,
&play_cb, NULL, &strm);
pjmedia_aud_dev_default_param(0, &param);
param.channel_count = CHANNEL_COUNT;
param.clock_rate = CLOCK_RATE;
param.samples_per_frame = SAMPLES_PER_FRAME;
param.dir = (pjmedia_dir) flag;
status = pjmedia_aud_stream_create(&param, &rec_cb, &play_cb, NULL, &strm);
if (status != PJ_SUCCESS) {
app_perror("snd open", status);
return status;
@ -198,10 +190,10 @@ static pj_status_t snd_start(unsigned flag)
pjmedia_delay_buf_reset(delaybuf);
status = pjmedia_snd_stream_start(strm);
status = pjmedia_aud_stream_start(strm);
if (status != PJ_SUCCESS) {
app_perror("snd start", status);
pjmedia_snd_stream_close(strm);
pjmedia_aud_stream_destroy(strm);
strm = NULL;
return status;
}
@ -220,11 +212,11 @@ static pj_status_t snd_stop()
return PJ_EINVALIDOP;
}
status = pjmedia_snd_stream_stop(strm);
status = pjmedia_aud_stream_stop(strm);
if (status != PJ_SUCCESS) {
app_perror("snd failed to stop", status);
}
status = pjmedia_snd_stream_close(strm);
status = pjmedia_aud_stream_destroy(strm);
strm = NULL;
pj_gettimeofday(&now);
@ -243,7 +235,7 @@ static void app_fini()
if (strm)
snd_stop();
pjmedia_snd_deinit();
pjmedia_aud_subsys_shutdown();
pjmedia_delay_buf_destroy(delaybuf);
pj_pool_release(pool);
pj_caching_pool_destroy(&cp);