Commit df4ea94a authored by Simon Morlat's avatar Simon Morlat

clean a few things around MSFactory usage

parent 0d0d9ee8
......@@ -405,7 +405,7 @@ static void start_remote_ring(LinphoneCore *lc, LinphoneCall *call) {
if (call->audiostream)
audio_stream_unprepare_sound(call->audiostream);
if( lc->sound_conf.remote_ring ){
lc->ringstream=ring_start(lc->sound_conf.remote_ring,2000,ringcard,lc->factory);
lc->ringstream=ring_start(lc->factory, lc->sound_conf.remote_ring,2000,ringcard);
}
}
}
......
......@@ -317,7 +317,7 @@ RtpProfile *LocalConference::sMakeDummyProfile(int samplerate){
void LocalConference::addLocalEndpoint() {
/*create a dummy audiostream in order to extract the local part of it */
/* network address and ports have no meaning and are not used here. */
AudioStream *st=audio_stream_new(65000,65001,FALSE,m_core->factory);
AudioStream *st=audio_stream_new(m_core->factory, 65000,65001,FALSE);
MSSndCard *playcard=m_core->sound_conf.lsd_card ?
m_core->sound_conf.lsd_card : m_core->sound_conf.play_sndcard;
MSSndCard *captcard=m_core->sound_conf.capt_sndcard;
......
......@@ -50,7 +50,7 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index);
MSWebCam *get_nowebcam_device(MSFactory* f){
#ifdef VIDEO_ENABLED
return ms_web_cam_manager_get_cam(ms_factory_get_wbc_manager(f),"StaticImage: Static picture");
return ms_web_cam_manager_get_cam(ms_factory_get_web_cam_manager(f),"StaticImage: Static picture");
#else
return NULL;
#endif
......@@ -2340,10 +2340,9 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
if (remotedesc)
stream_desc = sal_media_description_find_best_stream(remotedesc, SalAudio);
call->audiostream=audiostream=audio_stream_new2(linphone_call_get_bind_ip_for_stream(call,call->main_audio_stream_index),
call->audiostream=audiostream=audio_stream_new2(lc->factory, linphone_call_get_bind_ip_for_stream(call,call->main_audio_stream_index),
multicast_role == SalMulticastReceiver ? stream_desc->rtp_port : call->media_ports[call->main_audio_stream_index].rtp_port,
multicast_role == SalMulticastReceiver ? 0 /*disabled for now*/ : call->media_ports[call->main_audio_stream_index].rtcp_port,
call->core->factory);
multicast_role == SalMulticastReceiver ? 0 /*disabled for now*/ : call->media_ports[call->main_audio_stream_index].rtcp_port);
if (multicast_role == SalMulticastReceiver)
linphone_call_join_multicast_group(call, call->main_audio_stream_index, &audiostream->ms);
rtp_session_enable_network_simulation(call->audiostream->ms.sessions.rtp_session, &lc->net_conf.netsim_params);
......@@ -2354,7 +2353,7 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
setup_dtls_params(call, &audiostream->ms);
media_stream_reclaim_sessions(&audiostream->ms, &call->sessions[call->main_audio_stream_index]);
}else{
call->audiostream=audio_stream_new_with_sessions(&call->sessions[call->main_audio_stream_index], lc->factory);
call->audiostream=audio_stream_new_with_sessions(lc->factory, &call->sessions[call->main_audio_stream_index]);
}
audiostream=call->audiostream;
......@@ -2441,10 +2440,9 @@ void linphone_call_init_video_stream(LinphoneCall *call){
if (remotedesc)
stream_desc = sal_media_description_find_best_stream(remotedesc, SalVideo);
call->videostream=video_stream_new2(linphone_call_get_bind_ip_for_stream(call,call->main_video_stream_index),
call->videostream=video_stream_new2(lc->factory, linphone_call_get_bind_ip_for_stream(call,call->main_video_stream_index),
multicast_role == SalMulticastReceiver ? stream_desc->rtp_port : call->media_ports[call->main_video_stream_index].rtp_port,
multicast_role == SalMulticastReceiver ? 0 /*disabled for now*/ : call->media_ports[call->main_video_stream_index].rtcp_port,
lc->factory);
multicast_role == SalMulticastReceiver ? 0 /*disabled for now*/ : call->media_ports[call->main_video_stream_index].rtcp_port);
if (multicast_role == SalMulticastReceiver)
linphone_call_join_multicast_group(call, call->main_video_stream_index, &call->videostream->ms);
rtp_session_enable_network_simulation(call->videostream->ms.sessions.rtp_session, &lc->net_conf.netsim_params);
......@@ -2455,7 +2453,7 @@ void linphone_call_init_video_stream(LinphoneCall *call){
setup_dtls_params(call, &call->videostream->ms);
media_stream_reclaim_sessions(&call->videostream->ms, &call->sessions[call->main_video_stream_index]);
}else{
call->videostream=video_stream_new_with_sessions(&call->sessions[call->main_video_stream_index], lc->factory);
call->videostream=video_stream_new_with_sessions(lc->factory, &call->sessions[call->main_video_stream_index]);
}
if (call->media_ports[call->main_video_stream_index].rtp_port==-1){
......@@ -2508,10 +2506,9 @@ void linphone_call_init_text_stream(LinphoneCall *call){
if (call->op) remotedesc = sal_call_get_remote_media_description(call->op);
if (remotedesc) stream_desc = sal_media_description_find_best_stream(remotedesc, SalText);
call->textstream = textstream = text_stream_new2(linphone_call_get_bind_ip_for_stream(call,call->main_text_stream_index),
call->textstream = textstream = text_stream_new2(lc->factory, linphone_call_get_bind_ip_for_stream(call,call->main_text_stream_index),
multicast_role == SalMulticastReceiver ? stream_desc->rtp_port : call->media_ports[call->main_text_stream_index].rtp_port,
multicast_role == SalMulticastReceiver ? 0 /*disabled for now*/ : call->media_ports[call->main_text_stream_index].rtcp_port,
call->core->factory);
multicast_role == SalMulticastReceiver ? 0 /*disabled for now*/ : call->media_ports[call->main_text_stream_index].rtcp_port);
if (multicast_role == SalMulticastReceiver)
linphone_call_join_multicast_group(call, call->main_text_stream_index, &textstream->ms);
rtp_session_enable_network_simulation(call->textstream->ms.sessions.rtp_session, &lc->net_conf.netsim_params);
......@@ -2521,7 +2518,7 @@ void linphone_call_init_text_stream(LinphoneCall *call){
setup_dtls_params(call, &textstream->ms);
media_stream_reclaim_sessions(&textstream->ms, &call->sessions[call->main_text_stream_index]);
} else {
call->textstream = text_stream_new_with_sessions(&call->sessions[call->main_text_stream_index],call->core->factory);
call->textstream = text_stream_new_with_sessions(lc->factory, &call->sessions[call->main_text_stream_index]);
}
textstream = call->textstream;
if (call->media_ports[call->main_text_stream_index].rtp_port == -1) {
......@@ -2946,7 +2943,7 @@ static RtpSession * create_audio_rtp_io_session(LinphoneCall *call) {
if (pt != NULL) {
call->rtp_io_audio_profile = rtp_profile_new("RTP IO audio profile");
rtp_profile_set_payload(call->rtp_io_audio_profile, ptnum, payload_type_clone(pt));
rtp_session = ms_create_duplex_rtp_session(local_ip, local_port, -1);
rtp_session = ms_create_duplex_rtp_session(local_ip, local_port, -1, ms_factory_get_mtu(lc->factory));
rtp_session_set_profile(rtp_session, call->rtp_io_audio_profile);
rtp_session_set_remote_addr_and_port(rtp_session, remote_ip, remote_port, -1);
rtp_session_enable_rtcp(rtp_session, FALSE);
......@@ -3147,7 +3144,7 @@ static RtpSession * create_video_rtp_io_session(LinphoneCall *call) {
if (pt != NULL) {
call->rtp_io_video_profile = rtp_profile_new("RTP IO video profile");
rtp_profile_set_payload(call->rtp_io_video_profile, ptnum, payload_type_clone(pt));
rtp_session = ms_create_duplex_rtp_session(local_ip, local_port, -1);
rtp_session = ms_create_duplex_rtp_session(local_ip, local_port, -1, ms_factory_get_mtu(lc->factory));
rtp_session_set_profile(rtp_session, call->rtp_io_video_profile);
rtp_session_set_remote_addr_and_port(rtp_session, remote_ip, remote_port, -1);
rtp_session_enable_rtcp(rtp_session, FALSE);
......@@ -3342,7 +3339,7 @@ static void linphone_call_start_text_stream(LinphoneCall *call) {
if (is_multicast) rtp_session_set_multicast_ttl(call->textstream->ms.sessions.rtp_session,tstream->ttl);
text_stream_start(call->textstream, call->text_profile, rtp_addr, tstream->rtp_port, rtcp_addr, (linphone_core_rtcp_enabled(lc) && !is_multicast) ? (tstream->rtcp_port ? tstream->rtcp_port : tstream->rtp_port + 1) : 0, used_pt, call->core->factory);
text_stream_start(call->textstream, call->text_profile, rtp_addr, tstream->rtp_port, rtcp_addr, (linphone_core_rtcp_enabled(lc) && !is_multicast) ? (tstream->rtcp_port ? tstream->rtcp_port : tstream->rtp_port + 1) : 0, used_pt);
ms_filter_add_notify_callback(call->textstream->rttsink, real_time_text_character_received, call, FALSE);
ms_media_stream_sessions_set_encryption_mandatory(&call->textstream->ms.sessions,call->current_params->encryption_mandatory);
......
......@@ -779,7 +779,7 @@ static void build_sound_devices_table(LinphoneCore *lc){
const char **old;
int ndev;
int i;
const MSList *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_manager(lc->factory));
const MSList *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_card_manager(lc->factory));
ndev=ms_list_size(elem);
devices=ms_malloc((ndev+1)*sizeof(const char *));
for (i=0;elem!=NULL;elem=elem->next,i++){
......@@ -824,13 +824,13 @@ static void sound_config_read(LinphoneCore *lc)
char s=*i;
*i='\0';
card=ms_alsa_card_new_custom(d+l,d+l);
ms_snd_card_manager_add_card(ms_factory_get_snd_manager(linphone_core_get_factory((void*)lc))),card);
ms_snd_card_manager_add_card(ms_factory_get_snd_card_manager(lc->factory),card);
*i=s;
l=i-d+1;
}
if(d[l]!='\0') {
card=ms_alsa_card_new_custom(d+l,d+l);
ms_snd_card_manager_add_card(ms_factory_get_snd_manager(linphone_core_get_factory((void*)lc))),card);
ms_snd_card_manager_add_card(ms_factory_get_snd_card_manager(lc->factory),card);
}
free(d);
}
......@@ -1295,7 +1295,7 @@ static void build_video_devices_table(LinphoneCore *lc){
if (lc->video_conf.cams)
ms_free(lc->video_conf.cams);
/* retrieve all video devices */
elem=ms_web_cam_manager_get_list(ms_factory_get_wbc_manager(lc->factory));
elem=ms_web_cam_manager_get_list(ms_factory_get_web_cam_manager(lc->factory));
ndev=ms_list_size(elem);
devices=ms_malloc((ndev+1)*sizeof(const char *));
for (i=0;elem!=NULL;elem=elem->next,i++){
......@@ -1686,7 +1686,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
ortp_init();
linphone_core_activate_log_serialization_if_needed();
lc->factory = ms_factory_create(lc->factory);
lc->factory = ms_factory_new_with_voip();
linphone_core_register_default_codecs(lc);
linphone_core_register_offer_answer_providers(lc);
/* Get the mediastreamer2 event queue */
......@@ -4458,7 +4458,7 @@ void linphone_core_set_rec_level(LinphoneCore *lc, int level)
static MSSndCard *get_card_from_string_id(const char *devid, unsigned int cap, MSFactory *f){
MSSndCard *sndcard=NULL;
if (devid!=NULL){
sndcard=ms_snd_card_manager_get_card(ms_factory_get_snd_manager(f),devid);
sndcard=ms_snd_card_manager_get_card(ms_factory_get_snd_card_manager(f),devid);
if (sndcard!=NULL &&
(ms_snd_card_get_capabilities(sndcard) & cap)==0 ){
ms_warning("%s card does not have the %s capability, ignoring.",
......@@ -4469,15 +4469,15 @@ static MSSndCard *get_card_from_string_id(const char *devid, unsigned int cap, M
}
if (sndcard==NULL) {
if ((cap & MS_SND_CARD_CAP_CAPTURE) && (cap & MS_SND_CARD_CAP_PLAYBACK)){
sndcard=ms_snd_card_manager_get_default_card(ms_factory_get_snd_manager(f));
sndcard=ms_snd_card_manager_get_default_card(ms_factory_get_snd_card_manager(f));
}else if (cap & MS_SND_CARD_CAP_CAPTURE){
sndcard=ms_snd_card_manager_get_default_capture_card(ms_factory_get_snd_manager(f));
sndcard=ms_snd_card_manager_get_default_capture_card(ms_factory_get_snd_card_manager(f));
}
else if (cap & MS_SND_CARD_CAP_PLAYBACK){
sndcard=ms_snd_card_manager_get_default_playback_card(ms_factory_get_snd_manager(f));
sndcard=ms_snd_card_manager_get_default_playback_card(ms_factory_get_snd_card_manager(f));
}
if (sndcard==NULL){/*looks like a bug! take the first one !*/
const MSList *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_manager(f));
const MSList *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_card_manager(f));
if (elem) sndcard=(MSSndCard*)elem->data;
}
}
......@@ -4494,7 +4494,7 @@ static MSSndCard *get_card_from_string_id(const char *devid, unsigned int cap, M
**/
bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *devid){
MSSndCard *sndcard;
sndcard=ms_snd_card_manager_get_card(ms_factory_get_snd_manager(lc->factory),devid);
sndcard=ms_snd_card_manager_get_card(ms_factory_get_snd_card_manager(lc->factory),devid);
if (sndcard!=NULL && (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_CAPTURE)) return TRUE;
return FALSE;
}
......@@ -4508,7 +4508,7 @@ bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *devi
**/
bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *devid){
MSSndCard *sndcard;
sndcard=ms_snd_card_manager_get_card(ms_factory_get_snd_manager(lc->factory),devid);
sndcard=ms_snd_card_manager_get_card(ms_factory_get_snd_card_manager(lc->factory),devid);
if (sndcard!=NULL && (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_PLAYBACK)) return TRUE;
return FALSE;
}
......@@ -4634,7 +4634,7 @@ void linphone_core_reload_sound_devices(LinphoneCore *lc){
if (capture != NULL) {
capture_copy = ms_strdup(capture);
}
ms_snd_card_manager_reload(ms_factory_get_snd_manager(lc->factory));
ms_snd_card_manager_reload(ms_factory_get_snd_card_manager(lc->factory));
build_sound_devices_table(lc);
if (ringer_copy != NULL) {
linphone_core_set_ringer_device(lc, ringer_copy);
......@@ -4656,7 +4656,7 @@ void linphone_core_reload_video_devices(LinphoneCore *lc){
if (devid != NULL) {
devid_copy = ms_strdup(devid);
}
ms_web_cam_manager_reload(ms_factory_get_wbc_manager(lc->factory));
ms_web_cam_manager_reload(ms_factory_get_web_cam_manager(lc->factory));
build_video_devices_table(lc);
if (devid_copy != NULL) {
linphone_core_set_video_device(lc, devid_copy);
......@@ -4789,8 +4789,8 @@ int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCb
return err;
}
MSFactory *linphone_core_get_factory(void *lc){
return ((LinphoneCore*)lc)->factory;
MSFactory *linphone_core_get_ms_factory(LinphoneCore *lc){
return lc->factory;
}
/**
* Sets the path to a wav file used for ringing back.
......@@ -5407,13 +5407,13 @@ int linphone_core_set_video_device(LinphoneCore *lc, const char *id){
MSWebCam *olddev=lc->video_conf.device;
const char *vd;
if (id!=NULL){
lc->video_conf.device=ms_web_cam_manager_get_cam(ms_factory_get_wbc_manager(lc->factory),id);
lc->video_conf.device=ms_web_cam_manager_get_cam(ms_factory_get_web_cam_manager(lc->factory),id);
if (lc->video_conf.device==NULL){
ms_warning("Could not find video device %s",id);
}
}
if (lc->video_conf.device==NULL)
lc->video_conf.device=ms_web_cam_manager_get_default_cam(ms_factory_get_wbc_manager(lc->factory));
lc->video_conf.device=ms_web_cam_manager_get_default_cam(ms_factory_get_web_cam_manager(lc->factory));
if (olddev!=NULL && olddev!=lc->video_conf.device){
toggle_video_preview(lc,FALSE);/*restart the video local preview*/
}
......@@ -5922,7 +5922,7 @@ static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType
if (ringcard == NULL)
return NULL;
ringstream=lc->ringstream=ring_start(NULL,0,ringcard, lc->factory);
ringstream=lc->ringstream=ring_start(lc->factory, NULL,0,ringcard);
ms_filter_call_method(lc->ringstream->gendtmf,MS_DTMF_GEN_SET_DEFAULT_AMPLITUDE,&amp);
lc->dmfs_playing_start_time = ms_get_cur_time_ms()/1000;
}else{
......@@ -6440,13 +6440,12 @@ static void linphone_core_uninit(LinphoneCore *lc)
if (lc->supported_formats) ms_free(lc->supported_formats);
linphone_core_message_storage_close(lc);
linphone_core_call_log_storage_close(lc);
lc->factory = ms_factory_exit(lc->factory);
linphone_core_set_state(lc,LinphoneGlobalOff,"Off");
linphone_core_deactivate_log_serialization_if_needed();
ms_list_free_with_data(lc->vtable_refs,(void (*)(void *))v_table_reference_destroy);
ms_factory_destroy(lc->factory);
}
static void set_sip_network_reachable(LinphoneCore* lc,bool_t is_sip_reachable, time_t curtime){
......
This diff is collapsed.
......@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <mediastreamer2/msmediaplayer.h>
#include <mediastreamer2/mssndcard.h>
static int _local_player_open(LinphonePlayer *obj, const char *filename, MSFactory *factory);
static int _local_player_open(LinphonePlayer *obj, const char *filename);
static int _local_player_start(LinphonePlayer *obj);
static int _local_player_pause(LinphonePlayer *obj);
static int _local_player_seek(LinphonePlayer *obj, int time_ms);
......@@ -36,7 +36,7 @@ LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *s
LinphonePlayer *obj = ms_new0(LinphonePlayer, 1);
if(snd_card == NULL) snd_card = lc->sound_conf.ring_sndcard;
if(video_out == NULL) video_out = linphone_core_get_video_display_filter(lc);
obj->impl = ms_media_player_new(snd_card, video_out, window_id);
obj->impl = ms_media_player_new(lc->factory, snd_card, video_out, window_id);
obj->open = _local_player_open;
obj->start = _local_player_start;
obj->pause = _local_player_pause;
......@@ -54,8 +54,8 @@ bool_t linphone_local_player_matroska_supported(void) {
return ms_media_player_matroska_supported();
}
static int _local_player_open(LinphonePlayer *obj, const char *filename,MSFactory* factory) {
return ms_media_player_open((MSMediaPlayer *)obj->impl, filename, factory) ? 0 : -1;
static int _local_player_open(LinphonePlayer *obj, const char *filename) {
return ms_media_player_open((MSMediaPlayer *)obj->impl, filename) ? 0 : -1;
}
static int _local_player_start(LinphonePlayer *obj) {
......
......@@ -61,7 +61,7 @@ struct _LinphoneSoundDaemon {
static MSFilter *create_writer(MSSndCard *c){
LinphoneSoundDaemon *lsd=(LinphoneSoundDaemon*)c->data;
MSFilter *itcsink=ms_factory_create_filter(ms_snd_card_factory_get(c), MS_ITC_SINK_ID);
MSFilter *itcsink=ms_factory_create_filter(ms_snd_card_get_factory(c), MS_ITC_SINK_ID);
ms_filter_call_method(itcsink,MS_ITC_SINK_CONNECT,lsd->branches[0].player);
return itcsink;
}
......@@ -223,11 +223,11 @@ LinphoneSoundDaemon * linphone_sound_daemon_new(MSFactory* factory, const char *
int i;
MSConnectionPoint mp;
LinphoneSoundDaemon *lsd;
MSSndCard *card=ms_snd_card_manager_get_card(ms_factory_get_snd_manager(factory),
MSSndCard *card=ms_snd_card_manager_get_card(ms_factory_get_snd_card_manager(factory),
cardname);
if (card==NULL){
card=ms_snd_card_manager_get_default_playback_card (
ms_factory_get_snd_manager(factory));
ms_factory_get_snd_card_manager(factory));
if (card==NULL){
ms_error("linphone_sound_daemon_new(): No playback soundcard available");
return NULL;
......@@ -236,7 +236,7 @@ LinphoneSoundDaemon * linphone_sound_daemon_new(MSFactory* factory, const char *
lsd=ms_new0(LinphoneSoundDaemon,1);
lsd->soundout=ms_snd_card_create_writer(card);
lsd->mixer=ms_factory_create_filter(ms_snd_card_factory_get(card),MS_AUDIO_MIXER_ID);
lsd->mixer=ms_factory_create_filter(ms_snd_card_get_factory(card),MS_AUDIO_MIXER_ID);
lsd->out_rate=rate;
lsd->out_nchans=nchannels;
ms_filter_call_method(lsd->soundout,MS_FILTER_SET_SAMPLE_RATE,&lsd->out_rate);
......
......@@ -28,10 +28,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* @param user_data a user-data provided in the callback to help the application to retrieve its context.
* @return 0 if successful, -1 otherwise
**/
int linphone_player_open(MSFactory *f, LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback cb, void *user_data){
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, f);
return obj->open(obj,filename);
}
/**
......@@ -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, MSFactory *factory){
static int call_player_open(LinphonePlayer* player, const char *filename){
LinphoneCall *call=(LinphoneCall*)player->impl;
MSFilter *filter;
if (!call_player_check_state(player,FALSE)) return -1;
......
......@@ -1235,7 +1235,7 @@ LINPHONE_PUBLIC int linphone_remote_provisioning_load_file( LinphoneCore* lc, co
****************************************************************************/
struct _LinphonePlayer{
int (*open)(struct _LinphonePlayer* player, const char *filename, MSFactory *factory);
int (*open)(struct _LinphonePlayer* player, const char *filename);
int (*start)(struct _LinphonePlayer* player);
int (*pause)(struct _LinphonePlayer* player);
int (*seek)(struct _LinphonePlayer* player, int time_ms);
......
......@@ -211,15 +211,15 @@ static gboolean linphone_gtk_stop_record(gpointer data){
void linphone_gtk_start_record_sound(GtkWidget *w, gpointer data){
LinphoneCore *lc = linphone_gtk_get_core();
MSFactory *factory = linphone_core_get_factory((void*)lc);
MSFactory *factory = linphone_core_get_ms_factory(lc);
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_factory_get_snd_manager(factory);
MSSndCardManager *manager = ms_factory_get_snd_card_manager(factory);
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
gint timeout_id;
if(active){
gchar *path = get_record_file();
stream=audio_stream_new(8888, 8889, FALSE, factory);
stream=audio_stream_new(factory, 8888, 8889, FALSE);
if(stream != NULL){
audio_stream_start_full(stream,&av_profile,"127.0.0.1",8888,"127.0.0.1",8889,0,0,NULL,
path,NULL,ms_snd_card_manager_get_card(manager,linphone_core_get_capture_device(lc)),FALSE);
......@@ -256,14 +256,14 @@ static void endoffile_cb(void *ud, MSFilter *f, unsigned int ev,void * arg){
void linphone_gtk_start_play_record_sound(GtkWidget *w,gpointer data){
LinphoneCore *lc = linphone_gtk_get_core();
MSFactory *factory = linphone_core_get_factory((void*)lc);
MSFactory *factory = linphone_core_get_ms_factory(lc);
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_factory_get_snd_manager(factory);
MSSndCardManager *manager = ms_factory_get_snd_card_manager(factory);
if(active){
gchar *path = g_object_get_data(G_OBJECT(audio_assistant),"path");
stream=audio_stream_new(8888, 8889, FALSE, factory);
stream=audio_stream_new(factory, 8888, 8889, FALSE);
if(path != NULL){
audio_stream_start_full(stream,&av_profile,"127.0.0.1",8888,"127.0.0.1",8889,0,0,path,
NULL,ms_snd_card_manager_get_card(manager,linphone_core_get_playback_device(lc)),NULL,FALSE);
......@@ -448,15 +448,15 @@ static GtkWidget *create_end_page(void){
static void prepare(GtkAssistant *w){
AudioStream *audio_stream = NULL;
LinphoneCore *lc=linphone_gtk_get_core();
MSFactory *factory = linphone_core_get_factory((void*)lc);
MSFactory *factory = linphone_core_get_ms_factory(lc);
int page = gtk_assistant_get_current_page(w);
GtkWidget *mic_audiolevel = get_widget_from_assistant("mic_audiolevel");
GtkWidget *label_audiolevel = get_widget_from_assistant("label_audiolevel");
//Speaker page
if(page == 1){
MSSndCardManager *manager = ms_factory_get_snd_manager(factory);
audio_stream = audio_stream_start_with_sndcards(&av_profile,9898,"127.0.0.1",19898,0,0,ms_snd_card_manager_get_card(manager,linphone_core_get_playback_device(lc)),ms_snd_card_manager_get_card(manager,linphone_core_get_capture_device(lc)),FALSE, factory);
MSSndCardManager *manager = ms_factory_get_snd_card_manager(factory);
audio_stream = audio_stream_start_with_sndcards(factory, &av_profile,9898,"127.0.0.1",19898,0,0,ms_snd_card_manager_get_card(manager,linphone_core_get_playback_device(lc)),ms_snd_card_manager_get_card(manager,linphone_core_get_capture_device(lc)),FALSE);
if (mic_audiolevel != NULL && audio_stream != NULL){
g_object_set_data(G_OBJECT(audio_assistant),"stream",audio_stream);
linphone_gtk_init_audio_meter(mic_audiolevel,(get_volume_t)audio_stream_get_record_volume,audio_stream);
......
......@@ -1417,7 +1417,7 @@ void linphone_gtk_fill_webcams(GtkWidget *pb){
void linphone_gtk_fill_video_renderers(GtkWidget *pb){
#ifdef VIDEO_ENABLED /* video_stream_get_default_video_renderer requires video enabled */
LinphoneCore *lc=linphone_gtk_get_core();
MSFactory *factory = linphone_core_get_factory((void*)lc);
MSFactory *factory = linphone_core_get_ms_factory(lc);
GtkWidget *combo=linphone_gtk_get_widget(pb,"renderers");
MSList *l=ms_factory_lookup_filter_by_interface(factory, MSFilterVideoDisplayInterface);
MSList *elem;
......
......@@ -63,7 +63,7 @@ static void drag_data_received(GtkWidget *widget, GdkDragContext *context, gint
if (player){
const char* filepath = (strstr(path,"file://")==path) ? path+strlen("file://") : path;
if (linphone_player_open(linphone_core_get_factory((void*)linphone_call_get_core(call)),player,filepath,on_end_of_play,NULL)==0){
if (linphone_player_open(player,filepath,on_end_of_play,NULL)==0){
linphone_player_start(player);
}else{
......
mediastreamer2 @ 483fcd85
Subproject commit b2eb303aabac2620b80f366d4aab50d38d7acc86
Subproject commit 483fcd85d98ffdf220e37195575c6dd8209e7d6b
......@@ -2917,7 +2917,7 @@ static void call_with_file_player(void) {
player=linphone_call_get_player(linphone_core_get_current_call(marie->lc));
BC_ASSERT_PTR_NOT_NULL(player);
if (player){
BC_ASSERT_EQUAL(linphone_player_open(marie->lc->factory, player,hellopath,on_eof,marie),0, int, "%d");
BC_ASSERT_EQUAL(linphone_player_open(player,hellopath,on_eof,marie),0, int, "%d");
BC_ASSERT_EQUAL(linphone_player_start(player),0, int, "%d");
}
/* This assert should be modified to be at least as long as the WAV file */
......@@ -2983,7 +2983,7 @@ static void call_with_mkv_file_player(void) {
player=linphone_call_get_player(linphone_core_get_current_call(marie->lc));
BC_ASSERT_PTR_NOT_NULL(player);
if (player){
int res = linphone_player_open(marie->lc->factory, player,hellomkv,on_eof,marie);
int res = linphone_player_open(player,hellomkv,on_eof,marie);
//if(!ms_filter_codec_supported("opus")) {
if(!ms_factory_codec_supported(marie->lc->factory, "opus") && !ms_factory_codec_supported(pauline->lc->factory, "opus")){
BC_ASSERT_EQUAL(res, -1, int, "%d");
......@@ -5047,7 +5047,7 @@ static void call_with_rtp_io_mode(void) {
player = linphone_call_get_player(linphone_core_get_current_call(marie->lc));
BC_ASSERT_PTR_NOT_NULL(player);
if (player) {
BC_ASSERT_EQUAL(linphone_player_open(marie->lc->factory, player, hellopath, on_eof, marie) , 0, int, "%d");
BC_ASSERT_EQUAL(linphone_player_open(player, hellopath, on_eof, marie) , 0, int, "%d");
BC_ASSERT_EQUAL(linphone_player_start(player) , 0, int, "%d");
}
......@@ -5339,7 +5339,7 @@ static void custom_rtp_modifier(bool_t pauseResumeTest, bool_t recordTest) {
BC_ASSERT_PTR_NOT_NULL(player);
if (player) {
// This will ask pauline to play the file
BC_ASSERT_EQUAL(linphone_player_open(marie->lc->factory,player, hellopath, on_eof, pauline),0, int, "%d");
BC_ASSERT_EQUAL(linphone_player_open(player, hellopath, on_eof, pauline),0, int, "%d");
BC_ASSERT_EQUAL(linphone_player_start(player), 0, int, "%d");
}
/* This assert should be modified to be at least as long as the WAV file */
......
......@@ -44,16 +44,16 @@ static void play_file(const char *filename, bool_t supported_format, const char
BC_ASSERT_PTR_NOT_NULL(lc_manager);
if(lc_manager == NULL) return;
audio_codec_supported = (audio_mime && ms_factory_get_decoder(linphone_core_get_factory((void *)lc_manager->lc), audio_mime));
video_codec_supported = (video_mime && ms_factory_get_decoder(linphone_core_get_factory((void *)lc_manager->lc), video_mime));
audio_codec_supported = (audio_mime && ms_factory_get_decoder(linphone_core_get_ms_factory((void *)lc_manager->lc), audio_mime));
video_codec_supported = (video_mime && ms_factory_get_decoder(linphone_core_get_ms_factory((void *)lc_manager->lc), video_mime));
player = linphone_core_create_local_player(lc_manager->lc,
ms_snd_card_manager_get_default_card(ms_factory_get_snd_manager(linphone_core_get_factory((void *)lc_manager->lc))),
ms_snd_card_manager_get_default_card(ms_factory_get_snd_card_manager(linphone_core_get_ms_factory((void *)lc_manager->lc))),
video_stream_get_default_video_renderer(), 0);
BC_ASSERT_PTR_NOT_NULL(player);
if(player == NULL) goto fail;
res = linphone_player_open(linphone_core_get_factory((void*)lc_manager->lc), player, filename, eof_callback, &eof);
res = linphone_player_open(player, filename, eof_callback, &eof);
if(supported_format && (audio_codec_supported || video_codec_supported)) {
BC_ASSERT_EQUAL(res, 0, int, "%d");
} else {
......
......@@ -296,13 +296,13 @@ void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) {
{
MSWebCam *cam;
cam = ms_web_cam_manager_get_cam(ms_factory_get_wbc_manager(mgr->lc->factory), "Mire: Mire (synthetic moving picture)");
cam = ms_web_cam_manager_get_cam(ms_factory_get_web_cam_manager(mgr->lc->factory), "Mire: Mire (synthetic moving picture)");
if (cam == NULL) {
MSWebCamDesc *desc = ms_mire_webcam_desc_get();
if (desc){
cam=ms_web_cam_new(desc);
ms_web_cam_manager_add_cam(ms_factory_get_wbc_manager(mgr->lc->factory), cam);
ms_web_cam_manager_add_cam(ms_factory_get_web_cam_manager(mgr->lc->factory), cam);
}
}
}
......
......@@ -164,7 +164,7 @@ int main(int argc, char *argv[]){
{
MSWebCamDesc *desc = ms_mire_webcam_desc_get();
if (desc){
ms_web_cam_manager_add_cam(ms_factory_get_wbc_manager(linphone_core_get_factory((void*)lc)),ms_web_cam_new(desc));
ms_web_cam_manager_add_cam(ms_factory_get_web_cam_manager(linphone_core_get_ms_factory(lc)),ms_web_cam_new(desc));
linphone_core_set_video_device(lc,"Mire: Mire (synthetic moving picture)");
}
}
......
......@@ -51,7 +51,7 @@ int main(int argc, char *argv[]) {
linphone_core_enable_logs(stdout);
lc = linphone_core_new(&vtable, NULL, NULL, NULL);
lsd = linphone_sound_daemon_new(NULL, 44100, 1);
lsd = linphone_sound_daemon_new(linphone_core_get_ms_factory(lc), NULL, 44100, 1);
linphone_core_use_sound_daemon(lc, lsd);
......
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