From fc4ab03344359fa2e52a98673ddd47c3e6804264 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 16 Jun 2010 16:22:44 +0200 Subject: [PATCH 1/2] add test code for renderer callback --- coreapi/linphonecore.c | 13 ++++++++++++- mediastreamer2 | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 778494aa3..ce57abed8 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2142,6 +2142,13 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc){ return FALSE; } +#ifdef TEST_EXT_RENDERER +static void rendercb(void *data, const MSPicture *local, const MSPicture *remote){ + ms_message("rendercb, local buffer=%p, remote buffer=%p", + local ? local->planes[0] : NULL, remote? remote->planes[0] : NULL); +} +#endif + void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){ SalMediaDescription *md=call->localdesc; lc->audiostream=audio_stream_new(md->streams[0].port,linphone_core_ipv6_enabled(lc)); @@ -2169,8 +2176,12 @@ void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){ rtp_session_set_transports(lc->audiostream->session,lc->a_rtp,lc->a_rtcp); #ifdef VIDEO_ENABLED - if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].port>0) + if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].port>0){ lc->videostream=video_stream_new(md->streams[1].port,linphone_core_ipv6_enabled(lc)); +#ifdef TEST_EXT_RENDERER + video_stream_set_render_callback(lc->videostream,rendercb,NULL); +#endif + } #else lc->videostream=NULL; #endif diff --git a/mediastreamer2 b/mediastreamer2 index a6484a846..f05af00e9 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a6484a8463b62a60d03ef8358b2e305408f3b011 +Subproject commit f05af00e9c6d04920ad352633413f4065d00744f From 62a94c9c262a3c36df6623333cd819622428b129 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 17 Jun 2010 12:17:42 +0200 Subject: [PATCH 2/2] fix get_soft_playback_level(): was returning the measured volume ! --- coreapi/linphonecore.c | 14 ++++++++++++-- mediastreamer2 | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index ce57abed8..8f86188ba 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2655,7 +2655,11 @@ void linphone_core_set_ring_level(LinphoneCore *lc, int level){ if (sndcard) ms_snd_card_set_level(sndcard,MS_SND_CARD_PLAYBACK,level); } - +/** + * Sets call playback gain in db + * + * @ingroup media_parameters +**/ void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){ float gain=level; lc->sound_conf.soft_play_lev=level; @@ -2666,11 +2670,17 @@ void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){ ms_filter_call_method(st->volrecv,MS_VOLUME_SET_DB_GAIN,&gain); }else ms_warning("Could not apply gain: gain control wasn't activated."); } + +/** + * Returns call playback gain in db + * + * @ingroup media_parameters +**/ float linphone_core_get_soft_play_level(LinphoneCore *lc) { float gain=0; AudioStream *st=lc->audiostream; if (st->volrecv){ - ms_filter_call_method(st->volrecv,MS_VOLUME_GET,&gain); + ms_filter_call_method(st->volrecv,MS_VOLUME_GET_GAIN_DB,&gain); }else ms_warning("Could not get gain: gain control wasn't activated."); return gain; diff --git a/mediastreamer2 b/mediastreamer2 index f05af00e9..17e879de8 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit f05af00e9c6d04920ad352633413f4065d00744f +Subproject commit 17e879de84d894df6a1875665594567c1cf43617