Commit b8468a56 authored by Sandrine Avakian's avatar Sandrine Avakian

Attempt on fixing ring stream.

parent 6fd92fdc
......@@ -3277,7 +3277,7 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
if (lc->ringstream && lc->dmfs_playing_start_time!=0){
linphone_core_stop_dtmf_stream(lc);
}
linphone_ringtoneplayer_start(lc->ringtoneplayer, ringcard, lc->sound_conf.local_ring, 2000);
linphone_ringtoneplayer_start(lc->factory, lc->ringtoneplayer, ringcard, lc->sound_conf.local_ring, 2000);
}else{
/* else play a tone within the context of the current call */
call->ringing_beep=TRUE;
......@@ -4779,7 +4779,7 @@ int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCb
}
lc_callback_obj_init(&lc->preview_finished_cb,end_of_ringtone,userdata);
lc->preview_finished=0;
err = linphone_ringtoneplayer_start_with_cb(lc->ringtoneplayer, ringcard, ring, -1, notify_end_of_ringtone,(void *)lc);
err = linphone_ringtoneplayer_start_with_cb(lc->factory, lc->ringtoneplayer, ringcard, ring, -1, notify_end_of_ringtone,(void *)lc);
if (err) {
lc->preview_finished=1;
}
......
......@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int linphone_player_open(LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback cb, void *user_data){
obj->user_data=user_data;
obj->cb=cb;
return obj->open(obj,filename);
return obj->open(obj,filename, NULL);
}
/**
......@@ -137,7 +137,7 @@ static void on_eof(void *user_data, MSFilter *f, unsigned int event_id, void *ar
if (player->cb) player->cb(player,player->user_data);
}
static int call_player_open(LinphonePlayer* player, const char *filename){
static int call_player_open(LinphonePlayer* player, const char *filename, MSFactory *factory){
LinphoneCall *call=(LinphoneCall*)player->impl;
MSFilter *filter;
if (!call_player_check_state(player,FALSE)) return -1;
......
......@@ -19,9 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "private.h"
#include <mediastreamer2/msfactory.h>
int linphone_ringtoneplayer_start(LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms) {
return linphone_ringtoneplayer_start_with_cb(rp, card, ringtone, loop_pause_ms, NULL, NULL);
int linphone_ringtoneplayer_start(MSFactory *factory, LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms) {
return linphone_ringtoneplayer_start_with_cb(factory, rp, card, ringtone, loop_pause_ms, NULL, NULL);
}
#ifdef __ios
......@@ -76,7 +77,7 @@ static void notify_end_of_ringtone(void *ud, MSFilter *f, unsigned int event, vo
}
}
int linphone_ringtoneplayer_start_with_cb(LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms, LinphoneRingtonePlayerFunc end_of_ringtone, void * user_data) {
int linphone_ringtoneplayer_start_with_cb(MSFactory *factory, LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms, LinphoneRingtonePlayerFunc end_of_ringtone, void * user_data) {
if (linphone_ringtoneplayer_is_started(rp)) {
ms_message("the local ringtone is already started");
return 2;
......@@ -85,7 +86,7 @@ int linphone_ringtoneplayer_start_with_cb(LinphoneRingtonePlayer* rp, MSSndCard*
ms_message("Starting local ringtone...");
rp->end_of_ringtone = end_of_ringtone;
rp->end_of_ringtone_ud = user_data;
rp->ringstream=ring_start_with_cb(ringtone,loop_pause_ms,card,notify_end_of_ringtone,rp,linphone_core_get_factory(user_data));
rp->ringstream=ring_start_with_cb(factory, ringtone,loop_pause_ms,card,notify_end_of_ringtone,rp);
return rp->ringstream != NULL ? 0 : 1;
}
return 3;
......
......@@ -24,7 +24,7 @@ typedef void (*LinphoneRingtonePlayerFunc)(LinphoneRingtonePlayer* rp, void* use
LINPHONE_PUBLIC LinphoneRingtonePlayer* linphone_ringtoneplayer_new(void);
LINPHONE_PUBLIC void linphone_ringtoneplayer_destroy(LinphoneRingtonePlayer* rp);
LINPHONE_PUBLIC int linphone_ringtoneplayer_start(LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms);
LINPHONE_PUBLIC int linphone_ringtoneplayer_start(MSFactory *factory, LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms);
/**
* Start a ringtone player
* @param rp LinphoneRingtonePlayer object
......@@ -33,7 +33,8 @@ LINPHONE_PUBLIC int linphone_ringtoneplayer_start(LinphoneRingtonePlayer* rp, MS
* @param loop_pause_ms pause interval in milliseconds to be observed between end of play and resuming at start. A value of -1 disables loop mode
* @return 0 if the player successfully started, positive error code otherwise
*/
LINPHONE_PUBLIC int linphone_ringtoneplayer_start_with_cb(LinphoneRingtonePlayer* rp, MSSndCard* card, const char* ringtone, int loop_pause_ms, LinphoneRingtonePlayerFunc end_of_ringtone, void * user_data);
LINPHONE_PUBLIC int linphone_ringtoneplayer_start_with_cb(MSFactory *factory, LinphoneRingtonePlayer* rp, MSSndCard* card,
const char* ringtone, int loop_pause_ms, LinphoneRingtonePlayerFunc end_of_ringtone, void * user_data);
LINPHONE_PUBLIC bool_t linphone_ringtoneplayer_is_started(LinphoneRingtonePlayer* rp);
LINPHONE_PUBLIC int linphone_ringtoneplayer_stop(LinphoneRingtonePlayer* rp);
......
mediastreamer2 @ a93ad507
Subproject commit 22bc24eaf3d6ac3617c37cd1948aae20fa0050d4
Subproject commit a93ad507480abdc363f4c3a9d4c2dacf90ce8028
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment