Fix bogue issue 95

This commit is contained in:
bossiel 2011-12-06 23:03:49 +00:00
parent 2fa21d2280
commit bb40d86943
37 changed files with 313 additions and 27 deletions

View File

@ -280,3 +280,13 @@ bool MediaSessionMgr::defaultsSetMediaType(twrap_media_type_t media_type)
{
return (tmedia_defaults_set_media_type(_get_media_type(media_type)) == 0);
}
bool MediaSessionMgr::defaultsSetVolume(int32_t volume)
{
return (tmedia_defaults_set_volume(volume) == 0);
}
int32_t MediaSessionMgr::defaultsGetVolume()
{
return tmedia_defaults_get_volume();
}

View File

@ -83,6 +83,8 @@ public:
static bool defaultsSetAudioGain(int32_t producer_gain, int32_t consumer_gain);
static bool defaultsSetRtpPortRange(uint16_t range_start, uint16_t range_stop);
static bool defaultsSetMediaType(twrap_media_type_t media_type);
static bool defaultsSetVolume(int32_t volume);
static int32_t defaultsGetVolume();
private:
tmedia_session_mgr_t* m_pWrappedMgr;

View File

@ -206,6 +206,16 @@ public class MediaSessionMgr : IDisposable {
return ret;
}
public static bool defaultsSetVolume(int volume) {
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetVolume(volume);
return ret;
}
public static int defaultsGetVolume() {
int ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsGetVolume();
return ret;
}
}
}

View File

@ -359,6 +359,12 @@ class tinyWRAPPINVOKE {
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetMediaType")]
public static extern bool MediaSessionMgr_defaultsSetMediaType(int jarg1);
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetVolume")]
public static extern bool MediaSessionMgr_defaultsSetVolume(int jarg1);
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsGetVolume")]
public static extern int MediaSessionMgr_defaultsGetVolume();
[DllImport("tinyWRAP", EntryPoint="CSharp_delete_MediaContent")]
public static extern void delete_MediaContent(HandleRef jarg1);

View File

@ -1857,6 +1857,28 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetMediaType(
}
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetVolume(int jarg1) {
unsigned int jresult ;
int32_t arg1 ;
bool result;
arg1 = (int32_t)jarg1;
result = (bool)MediaSessionMgr::defaultsSetVolume(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsGetVolume() {
int jresult ;
int32_t result;
result = (int32_t)MediaSessionMgr::defaultsGetVolume();
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_delete_MediaContent(void * jarg1) {
MediaContent *arg1 = (MediaContent *) 0 ;

View File

@ -167,4 +167,12 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetMediaType(media_type.swigValue());
}
public static boolean defaultsSetVolume(int volume) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetVolume(volume);
}
public static int defaultsGetVolume() {
return tinyWRAPJNI.MediaSessionMgr_defaultsGetVolume();
}
}

View File

@ -167,4 +167,12 @@ public class MediaSessionMgr {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetMediaType(media_type.swigValue());
}
public static boolean defaultsSetVolume(int volume) {
return tinyWRAPJNI.MediaSessionMgr_defaultsSetVolume(volume);
}
public static int defaultsGetVolume() {
return tinyWRAPJNI.MediaSessionMgr_defaultsGetVolume();
}
}

View File

@ -68,6 +68,8 @@ class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsSetAudioGain(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetRtpPortRange(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetMediaType(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetVolume(int jarg1);
public final static native int MediaSessionMgr_defaultsGetVolume();
public final static native void delete_MediaContent(long jarg1);
public final static native String MediaContent_getType(long jarg1, MediaContent jarg1_);
public final static native long MediaContent_getDataLength(long jarg1, MediaContent jarg1_);

View File

@ -2831,6 +2831,32 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetVolume(JNIEnv *jenv, jclass jcls, jint jarg1) {
jboolean jresult = 0 ;
int32_t arg1 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = (int32_t)jarg1;
result = (bool)MediaSessionMgr::defaultsSetVolume(arg1);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsGetVolume(JNIEnv *jenv, jclass jcls) {
jint jresult = 0 ;
int32_t result;
(void)jenv;
(void)jcls;
result = (int32_t)MediaSessionMgr::defaultsGetVolume();
jresult = (jint)result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1MediaContent(JNIEnv *jenv, jclass jcls, jlong jarg1) {
MediaContent *arg1 = (MediaContent *) 0 ;

View File

@ -68,6 +68,8 @@ class tinyWRAPJNI {
public final static native boolean MediaSessionMgr_defaultsSetAudioGain(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetRtpPortRange(int jarg1, int jarg2);
public final static native boolean MediaSessionMgr_defaultsSetMediaType(int jarg1);
public final static native boolean MediaSessionMgr_defaultsSetVolume(int jarg1);
public final static native int MediaSessionMgr_defaultsGetVolume();
public final static native void delete_MediaContent(long jarg1);
public final static native String MediaContent_getType(long jarg1, MediaContent jarg1_);
public final static native long MediaContent_getDataLength(long jarg1, MediaContent jarg1_);

View File

@ -2831,6 +2831,32 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
}
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetVolume(JNIEnv *jenv, jclass jcls, jint jarg1) {
jboolean jresult = 0 ;
int32_t arg1 ;
bool result;
(void)jenv;
(void)jcls;
arg1 = (int32_t)jarg1;
result = (bool)MediaSessionMgr::defaultsSetVolume(arg1);
jresult = (jboolean)result;
return jresult;
}
SWIGEXPORT jint JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsGetVolume(JNIEnv *jenv, jclass jcls) {
jint jresult = 0 ;
int32_t result;
(void)jenv;
(void)jcls;
result = (int32_t)MediaSessionMgr::defaultsGetVolume();
jresult = (jint)result;
return jresult;
}
SWIGEXPORT void JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_delete_1MediaContent(JNIEnv *jenv, jclass jcls, jlong jarg1) {
MediaContent *arg1 = (MediaContent *) 0 ;

View File

@ -225,6 +225,8 @@ sub DESTROY {
*defaultsSetAudioGain = *tinyWRAPc::MediaSessionMgr_defaultsSetAudioGain;
*defaultsSetRtpPortRange = *tinyWRAPc::MediaSessionMgr_defaultsSetRtpPortRange;
*defaultsSetMediaType = *tinyWRAPc::MediaSessionMgr_defaultsSetMediaType;
*defaultsSetVolume = *tinyWRAPc::MediaSessionMgr_defaultsSetVolume;
*defaultsGetVolume = *tinyWRAPc::MediaSessionMgr_defaultsGetVolume;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);

View File

@ -4091,6 +4091,52 @@ XS(_wrap_MediaSessionMgr_defaultsSetMediaType) {
}
XS(_wrap_MediaSessionMgr_defaultsSetVolume) {
{
int32_t arg1 ;
int val1 ;
int ecode1 = 0 ;
int argvi = 0;
bool result;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: MediaSessionMgr_defaultsSetVolume(volume);");
}
ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetVolume" "', argument " "1"" of type '" "int32_t""'");
}
arg1 = static_cast< int32_t >(val1);
result = (bool)MediaSessionMgr::defaultsSetVolume(arg1);
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_MediaSessionMgr_defaultsGetVolume) {
{
int argvi = 0;
int32_t result;
dXSARGS;
if ((items < 0) || (items > 0)) {
SWIG_croak("Usage: MediaSessionMgr_defaultsGetVolume();");
}
result = (int32_t)MediaSessionMgr::defaultsGetVolume();
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_delete_MediaContent) {
{
MediaContent *arg1 = (MediaContent *) 0 ;
@ -22732,6 +22778,8 @@ static swig_command_info swig_commands[] = {
{"tinyWRAPc::MediaSessionMgr_defaultsSetAudioGain", _wrap_MediaSessionMgr_defaultsSetAudioGain},
{"tinyWRAPc::MediaSessionMgr_defaultsSetRtpPortRange", _wrap_MediaSessionMgr_defaultsSetRtpPortRange},
{"tinyWRAPc::MediaSessionMgr_defaultsSetMediaType", _wrap_MediaSessionMgr_defaultsSetMediaType},
{"tinyWRAPc::MediaSessionMgr_defaultsSetVolume", _wrap_MediaSessionMgr_defaultsSetVolume},
{"tinyWRAPc::MediaSessionMgr_defaultsGetVolume", _wrap_MediaSessionMgr_defaultsGetVolume},
{"tinyWRAPc::delete_MediaContent", _wrap_delete_MediaContent},
{"tinyWRAPc::MediaContent_getType", _wrap_MediaContent_getType},
{"tinyWRAPc::MediaContent_getDataLength", _wrap_MediaContent_getDataLength},

View File

@ -205,6 +205,10 @@ class MediaSessionMgr(_object):
if _newclass:defaultsSetRtpPortRange = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetRtpPortRange)
__swig_getmethods__["defaultsSetMediaType"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetMediaType
if _newclass:defaultsSetMediaType = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetMediaType)
__swig_getmethods__["defaultsSetVolume"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetVolume
if _newclass:defaultsSetVolume = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetVolume)
__swig_getmethods__["defaultsGetVolume"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsGetVolume
if _newclass:defaultsGetVolume = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsGetVolume)
MediaSessionMgr_swigregister = _tinyWRAP.MediaSessionMgr_swigregister
MediaSessionMgr_swigregister(MediaSessionMgr)
@ -308,6 +312,14 @@ def MediaSessionMgr_defaultsSetMediaType(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetMediaType(*args)
MediaSessionMgr_defaultsSetMediaType = _tinyWRAP.MediaSessionMgr_defaultsSetMediaType
def MediaSessionMgr_defaultsSetVolume(*args):
return _tinyWRAP.MediaSessionMgr_defaultsSetVolume(*args)
MediaSessionMgr_defaultsSetVolume = _tinyWRAP.MediaSessionMgr_defaultsSetVolume
def MediaSessionMgr_defaultsGetVolume():
return _tinyWRAP.MediaSessionMgr_defaultsGetVolume()
MediaSessionMgr_defaultsGetVolume = _tinyWRAP.MediaSessionMgr_defaultsGetVolume
class MediaContent(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, MediaContent, name, value)

View File

@ -6689,6 +6689,41 @@ fail:
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetVolume(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int32_t arg1 ;
int val1 ;
int ecode1 = 0 ;
PyObject * obj0 = 0 ;
bool result;
if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetVolume",&obj0)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetVolume" "', argument " "1"" of type '" "int32_t""'");
}
arg1 = static_cast< int32_t >(val1);
result = (bool)MediaSessionMgr::defaultsSetVolume(arg1);
resultobj = SWIG_From_bool(static_cast< bool >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsGetVolume(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int32_t result;
if (!PyArg_ParseTuple(args,(char *)":MediaSessionMgr_defaultsGetVolume")) SWIG_fail;
result = (int32_t)MediaSessionMgr::defaultsGetVolume();
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *MediaSessionMgr_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
@ -21911,6 +21946,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"MediaSessionMgr_defaultsSetAudioGain", _wrap_MediaSessionMgr_defaultsSetAudioGain, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetRtpPortRange", _wrap_MediaSessionMgr_defaultsSetRtpPortRange, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetMediaType", _wrap_MediaSessionMgr_defaultsSetMediaType, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsSetVolume", _wrap_MediaSessionMgr_defaultsSetVolume, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_defaultsGetVolume", _wrap_MediaSessionMgr_defaultsGetVolume, METH_VARARGS, NULL},
{ (char *)"MediaSessionMgr_swigregister", MediaSessionMgr_swigregister, METH_VARARGS, NULL},
{ (char *)"delete_MediaContent", _wrap_delete_MediaContent, METH_VARARGS, NULL},
{ (char *)"MediaContent_getType", _wrap_MediaContent_getType, METH_VARARGS, NULL},

View File

@ -42,6 +42,12 @@
extern void tdav_win32_print_error(const char* func, HRESULT hr);
static _inline int32_t __convert_volume(int32_t volume)
{
static const int32_t __step = (DSBVOLUME_MAX - DSBVOLUME_MIN) / 100;
return (volume * __step) + DSBVOLUME_MIN;
}
static void *__playback_thread(void *param)
{
tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)param;
@ -105,9 +111,21 @@ next:
/* ============ Media Consumer Interface ================= */
static int tdav_consumer_dsound_set(tmedia_consumer_t* self, const tmedia_param_t* params)
static int tdav_consumer_dsound_set(tmedia_consumer_t* self, const tmedia_param_t* param)
{
return tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), params);
tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
int ret = tdav_consumer_audio_set(TDAV_CONSUMER_AUDIO(self), param);
if(ret == 0){
if(dsound->secondaryBuffer && tsk_striequals(param->key, "volume")){
if(IDirectSoundBuffer_SetVolume(dsound->secondaryBuffer, __convert_volume(TMEDIA_CONSUMER(self)->audio.volume)) != DS_OK){
TSK_DEBUG_ERROR("IDirectSoundBuffer_SetVolume() failed");
ret = -1;
}
}
}
return ret;
}
static int tdav_consumer_dsound_prepare(tmedia_consumer_t* self, const tmedia_codec_t* codec)
@ -173,7 +191,7 @@ static int tdav_consumer_dsound_prepare(tmedia_consumer_t* self, const tmedia_co
}
/* Creates the secondary buffer and apply format */
dsbd.dwFlags = (DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GLOBALFOCUS);
dsbd.dwFlags = (DSBCAPS_CTRLPOSITIONNOTIFY | DSBCAPS_GLOBALFOCUS | DSBCAPS_CTRLVOLUME);
dsbd.dwBufferBytes = (TDAV_DSOUNS_CONSUMER_NOTIF_POS_COUNT * dsound->bytes_per_notif);
dsbd.lpwfxFormat = &wfx;
@ -181,7 +199,11 @@ static int tdav_consumer_dsound_prepare(tmedia_consumer_t* self, const tmedia_co
tdav_win32_print_error("IDirectSound_CreateSoundBuffer", hr);
return -6;
}
/* Set Volume */
if(IDirectSoundBuffer_SetVolume(dsound->secondaryBuffer, __convert_volume(TMEDIA_CONSUMER(self)->audio.volume)) != DS_OK){
TSK_DEBUG_ERROR("IDirectSoundBuffer_SetVolume() failed");
}
return 0;
}

View File

@ -119,6 +119,10 @@ int tdav_consumer_audio_set(tdav_consumer_audio_t* self, const tmedia_param_t* p
return -2;
}
}
else if(tsk_striequals(param->key, "volume")){
TMEDIA_CONSUMER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
TMEDIA_CONSUMER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_CONSUMER(self)->audio.volume, 100);
}
}
}

View File

@ -99,6 +99,10 @@ int tdav_producer_audio_set(tdav_producer_audio_t* self, const tmedia_param_t* p
return -2;
}
}
else if(tsk_striequals(param->key, "volume")){
TMEDIA_PRODUCER(self)->audio.volume = TSK_TO_INT32((uint8_t*)param->value);
TMEDIA_PRODUCER(self)->audio.volume = TSK_CLAMP(0, TMEDIA_PRODUCER(self)->audio.volume, 100);
}
}
}

View File

@ -31,11 +31,11 @@
>>(reg-sid)
# sleep
++sleep --sec $$(sleep-sec)
#++sleep --sec $$(sleep-sec)
subscribe to reg event package
++sub --to sip:$$(user)@$$(domain) --xp $$(expires) --header Event=reg --header Accept=application/reginfo+xml \
--header Allow-Events=refer, presence, presence.winfo, xcap-diff, conference >>(sub-reg-sid)
#++sub --to sip:$$(user)@$$(domain) --xp $$(expires) --header Event=reg --header Accept=application/reginfo+xml \
# --header Allow-Events=refer, presence, presence.winfo, xcap-diff, conference >>(sub-reg-sid)
#subscribe to presence event package (alice)
#++sub --to sip:alice@$$(domain) --xp $$(expires) --header Event=presence --header Supported=eventlist\
@ -45,6 +45,10 @@
#publish
#++sn --path ./publish.sn
++av --to sip:004@$$(domain) \
--header Action-Header=Myheader-value @@action \
>>(inv_audio_sid)
# sleep
++sleep --sec -1 # Press ENTER

View File

@ -20,7 +20,7 @@
#++sn --path ./core-starent.sn
# sip2sip.info
++sn --path ./sip2sip.info.sn
#++sn --path ./sip2sip.info.sn
# asterisk
#++sn --path ./asterisk.sn
@ -29,7 +29,7 @@
#++sn --path ./sigcomp.sn
# open-ims.test
#++sn --path ./open-ims.test.sn
++sn --path ./open-ims.test.sn
# BlinkMind
#++sn --path ./blinkmind.sn

View File

@ -2,12 +2,12 @@
# 2233392625mamadoud3sb7j4fb8
# user's parameters (like ANSI-C #define)
%%domain open-ims.test
%%user bossiel
%%pwd diopmama
%%domain doubango.org
%%user 002
%%pwd 002
#%%proxy_ip 2a01:e35:8b32:7050:212:f0ff:fe99:c9fc # IP address or FQDN
%%proxy_ip 192.168.0.13
%%proxy_port 4060
%%proxy_ip 192.168.0.9
%%proxy_port 5060
%%proxy_trans udp # udp, tcp, tls or sctp
%%expires 300 # expires used by all dialogs
%%sleep-sec 1.0 # number of seconds to wait before sending next sip message
@ -44,7 +44,7 @@
# Press ENTER
++sleep --sec -1
++a --to sip:johndoe@$$(domain) \
++av --to sip:001@$$(domain) \
--header Action-Header=Myheader-value @@action \
>>(inv_audio_sid)

View File

@ -91,6 +91,7 @@ typedef struct tmedia_consumer_s
uint8_t channels;
uint32_t rate;
} out;
int32_t volume;
} audio;
uint64_t session_id;

View File

@ -70,6 +70,8 @@ TINYMEDIA_API uint16_t tmedia_defaults_get_rtp_port_range_stop();
TINYMEDIA_API int tmedia_defaults_set_rtp_port_range(uint16_t start, uint16_t stop);
TINYMEDIA_API tmedia_type_t tmedia_defaults_get_media_type();
TINYMEDIA_API int tmedia_defaults_set_media_type(tmedia_type_t media_type);
TINYMEDIA_API int tmedia_defaults_set_volume(int32_t volume);
TINYMEDIA_API int32_t tmedia_defaults_get_volume();

View File

@ -76,6 +76,7 @@ typedef struct tmedia_producer_s
uint32_t rate;
uint8_t ptime;
uint8_t gain;
int32_t volume;
} audio;
const struct tmedia_producer_plugin_def_s* plugin;

View File

@ -28,9 +28,11 @@
*/
#include "tinymedia/tmedia_consumer.h"
#include "tinymedia/tmedia_defaults.h"
#include "tsk_debug.h"
/**@defgroup tmedia_consumer_group Producers
*/
@ -56,6 +58,7 @@ int tmedia_consumer_init(tmedia_consumer_t* self)
self->audio.bits_per_sample = TMEDIA_CONSUMER_BITS_PER_SAMPLE_DEFAULT;
self->audio.ptime = TMEDIA_CONSUMER_PTIME_DEFAULT;
self->audio.volume = tmedia_defaults_get_volume();
return 0;
}

View File

@ -63,6 +63,7 @@ static int32_t __audio_consumer_gain = 0;
static uint16_t __rtp_port_range_start = 1024;
static uint16_t __rtp_port_range_stop = 65535;
static tmedia_type_t __media_type = tmedia_audio;
static int32_t __volume = 100;
int tmedia_defaults_set_jb_margin(int32_t jb_margin_ms)
{
@ -235,4 +236,13 @@ tmedia_type_t tmedia_defaults_get_media_type(){
int tmedia_defaults_set_media_type(tmedia_type_t media_type){
__media_type = media_type;
return 0;
}
int tmedia_defaults_set_volume(int32_t volume){
__volume = TSK_CLAMP(0, volume, 100);
return 0;
}
int32_t tmedia_defaults_get_volume(){
return __volume;
}

View File

@ -28,6 +28,7 @@
*/
#include "tinymedia/tmedia_producer.h"
#include "tinymedia/tmedia_defaults.h"
#include "tsk_debug.h"
@ -55,6 +56,7 @@ int tmedia_producer_init(tmedia_producer_t* self)
self->audio.bits_per_sample = TMEDIA_PRODUCER_BITS_PER_SAMPLE_DEFAULT;
self->audio.channels = TMEDIA_PRODUCER_CHANNELS_DEFAULT;
self->audio.rate = TMEDIA_PRODUCER_RATE_DEFAULT;
self->audio.volume = tmedia_defaults_get_volume();
return 0;
}

View File

@ -1189,7 +1189,7 @@ int tnet_sockfd_set_mode(tnet_fd_t fd, int nonBlocking)
// int on = 1;
// ioctl(fd, FIONBIO, (char *)&on);
}
return 0;
}

View File

@ -139,6 +139,10 @@ int tsk_condwait_wait(tsk_condwait_handle_t* handle)
{
int ret = EINVAL;
tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
if(!condwait){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TSK_UNDER_WINDOWS
if((ret = (WaitForSingleObject(condwait->pcond, INFINITE) == WAIT_FAILED) ? -1 : 0)){
@ -222,6 +226,10 @@ int tsk_condwait_signal(tsk_condwait_handle_t* handle)
{
int ret = EINVAL;
tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
if(!condwait){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TSK_UNDER_WINDOWS
if(ret = ((SetEvent(condwait->pcond) && ResetEvent(condwait->pcond)) ? 0 : -1)){
@ -252,6 +260,10 @@ int tsk_condwait_broadcast(tsk_condwait_handle_t* handle)
{
int ret = EINVAL;
tsk_condwait_t *condwait = (tsk_condwait_t*)handle;
if(!condwait){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
#if TSK_UNDER_WINDOWS
if(ret = ((SetEvent(condwait->pcond) && ResetEvent(condwait->pcond)) ? 0 : -1)){

View File

@ -165,7 +165,7 @@ void tsk_mutex_destroy(tsk_mutex_handle_t** handle)
if(handle && *handle){
#if TSK_UNDER_WINDOWS
CloseHandle((MUTEX_T)*handle);
*handle = 0;
*handle = tsk_null;
#else
pthread_mutex_destroy((MUTEX_T)*handle);
tsk_free(handle);

View File

@ -95,7 +95,7 @@ tsk_semaphore_handle_t* tsk_semaphore_create()
tsk_semaphore_handle_t* tsk_semaphore_create_2(int initial_val)
{
SEMAPHORE_T handle = 0;
SEMAPHORE_T handle = tsk_null;
#if TSK_UNDER_WINDOWS
handle = CreateSemaphore(NULL, initial_val, 0x7FFFFFFF, NULL);

View File

@ -55,8 +55,6 @@
/**@defgroup tsk_string_group String utillity functions.
*/
static char HEX[] = "0123456789abcdef";
/**@ingroup tsk_string_group
*/
tsk_string_t* tsk_string_create(const char* str)
@ -71,6 +69,7 @@ tsk_string_t* tsk_string_create(const char* str)
*/
char tsk_b10tob16(char c)
{
static char HEX[] = "0123456789abcdef";
return HEX[c & 15];
}

View File

@ -128,7 +128,7 @@ int tsk_gettimeofday(struct timeval *tv, struct timezone *tz)
* Gets the number of milliseconds in @a tv
* @retval The number of milliseconds
*/
uint64_t tsk_time_get_ms(struct timeval* tv)
uint64_t tsk_time_get_ms(const struct timeval* tv)
{
if(!tv){
TSK_DEBUG_ERROR("Invalid parameter");

View File

@ -46,7 +46,7 @@ struct timespec;
#define TSK_TIME_MS_2_S(MS) ((MS)/1000)
TINYSAK_API int tsk_gettimeofday(struct timeval *tv, struct timezone *tz);
TINYSAK_API uint64_t tsk_time_get_ms(struct timeval *tv);
TINYSAK_API uint64_t tsk_time_get_ms(const struct timeval *tv);
TINYSAK_API uint64_t tsk_time_epoch();
TINYSAK_API uint64_t tsk_time_now();

View File

@ -34,8 +34,8 @@
#define RUN_TEST_LOOP 1
#define RUN_TEST_ALL 0
#define RUN_TEST_MESSAGES 0
#define RUN_TEST_URI 1
#define RUN_TEST_MESSAGES 1
#define RUN_TEST_URI 0
#define RUN_TEST_TRANSAC 0
#define RUN_TEST_STACK 0
#define RUN_TEST_IMS_AKA 0

View File

@ -125,6 +125,7 @@
"WWW-Authenticate: Digest realm=\"ims.inexbee.com\", nonce=\"iTaxDEv2uO8sKxzVVaRy6IkU9Lra6wAA2xv4BrmCzvY=\", algorithm=AKAv1-MD5, qop=\"auth\"\r\n" \
"WWW-Authenticate: Digest realm=\"ims.cingularme.com\",\r\n nonce=\"b7c9036dbf3054aea9404c7286aee9703dc8f84c2008\",\r\n opaque=\"Lss:scsf-stdn.imsgroup0-001.ims1.wtcdca1.mobility.att.net:5060\",\r\n algorithm=MD5,\r\n qop=\"auth\"\r\n" \
"Content-Length: 11\r\n" \
"Etag: W/'1231-3213213'\r\n" \
"\r\n" \
"How are you"
@ -313,8 +314,8 @@ void test_responses()
void test_messages()
{
//test_parser();
test_requests();
//test_responses();
//test_requests();
test_responses();
}

View File

@ -31,7 +31,7 @@
<div id="main">
<h1>Getting Started</h1>
<p class="code">If you are a new developer, the best way to start programing with doubango is to download the <a href="http://doubango.googlecode.com/svn/trunk/documentation/programmer-guide.pdf">Programmer's Guide v1.0.0</a></p>
<p class="code">If you are a new developer, the best way to start programing with doubango is to download the <a href="http://doubango.googlecode.com/svn/branches/2.0/doubango/documentation/programmer-guide.pdf">Programmer's Guide v1.0.0</a></p>
<h2> Supported Operating Systems</h2>
<ul>