Commit f19cff21 authored by Sandrine Avakian's avatar Sandrine Avakian

Updating media streamer and propagating changes.

parent c0280bcb
......@@ -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_snd_card_manager_get(),card);
ms_snd_card_manager_add_card(ms_factory_get_snd_manager(linphone_core_get_factory((void*)lc))),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_snd_card_manager_get(),card);
ms_snd_card_manager_add_card(ms_factory_get_snd_manager(linphone_core_get_factory((void*)lc))),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_web_cam_manager_get());
elem=ms_web_cam_manager_get_list(ms_factory_get_wbc_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++){
......@@ -1679,13 +1679,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
ortp_init();
linphone_core_activate_log_serialization_if_needed();
if (lc->factory == NULL){
lc->factory = ms_factory_new();
}
ms_factory_init_voip(lc->factory);
ms_factory_init_plugins(lc->factory);
lc->factory = ms_factory_create(lc->factory);
linphone_core_register_default_codecs(lc);
linphone_core_register_offer_answer_providers(lc);
/* Get the mediastreamer2 event queue */
......@@ -4655,7 +4649,7 @@ void linphone_core_reload_video_devices(LinphoneCore *lc){
if (devid != NULL) {
devid_copy = ms_strdup(devid);
}
ms_web_cam_manager_reload(ms_web_cam_manager_get());
ms_web_cam_manager_reload(ms_factory_get_wbc_manager(lc->factory));
build_video_devices_table(lc);
if (devid_copy != NULL) {
linphone_core_set_video_device(lc, devid_copy);
......@@ -5406,13 +5400,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_web_cam_manager_get(),id);
lc->video_conf.device=ms_web_cam_manager_get_cam(ms_factory_get_wbc_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_web_cam_manager_get());
lc->video_conf.device=ms_web_cam_manager_get_default_cam(ms_factory_get_wbc_manager(lc->factory));
if (olddev!=NULL && olddev!=lc->video_conf.device){
toggle_video_preview(lc,FALSE);/*restart the video local preview*/
}
......
......@@ -1429,7 +1429,7 @@ void _linphone_core_add_listener(LinphoneCore *lc, LinphoneCoreVTable *vtable, b
#ifdef VIDEO_ENABLED
LINPHONE_PUBLIC MSWebCam *linphone_call_get_video_device(const LinphoneCall *call);
MSWebCam *get_nowebcam_device(void);
MSWebCam *get_nowebcam_device(MSFactory *f);
#endif
bool_t linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc);
......
......@@ -213,7 +213,7 @@ void linphone_gtk_start_record_sound(GtkWidget *w, gpointer data){
LinphoneCore *lc = linphone_gtk_get_core();
MSFactory *factory = linphone_core_get_factory((void*)lc);
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_snd_card_manager_get();
MSSndCardManager *manager = ms_factory_get_snd_manager(factory);
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
gint timeout_id;
......@@ -259,7 +259,7 @@ void linphone_gtk_start_play_record_sound(GtkWidget *w,gpointer data){
MSFactory *factory = linphone_core_get_factory((void*)lc);
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_snd_card_manager_get();
MSSndCardManager *manager = ms_factory_get_snd_manager(factory);
if(active){
gchar *path = g_object_get_data(G_OBJECT(audio_assistant),"path");
......@@ -455,7 +455,7 @@ static void prepare(GtkAssistant *w){
//Speaker page
if(page == 1){
MSSndCardManager *manager = ms_snd_card_manager_get();
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);
if (mic_audiolevel != NULL && audio_stream != NULL){
g_object_set_data(G_OBJECT(audio_assistant),"stream",audio_stream);
......
mediastreamer2 @ 2e8c945a
Subproject commit 00125cf3f29528da5c542733fcc006797c14d839
Subproject commit 2e8c945a113865f7ec04a65990b2ef2bdfe97f06
......@@ -47,7 +47,9 @@ static void play_file(const char *filename, bool_t supported_format, const char
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));
player = linphone_core_create_local_player(lc_manager->lc, ms_snd_card_manager_get_default_card(ms_snd_card_manager_get()), video_stream_get_default_video_renderer(), 0);
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))),
video_stream_get_default_video_renderer(), 0);
BC_ASSERT_PTR_NOT_NULL(player);
if(player == NULL) goto fail;
......
......@@ -302,13 +302,13 @@ void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) {
{
MSWebCam *cam;
cam = ms_web_cam_manager_get_cam(ms_web_cam_manager_get(), "Mire: Mire (synthetic moving picture)");
cam = ms_web_cam_manager_get_cam(ms_factory_get_wbc_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_web_cam_manager_get(), cam);
ms_web_cam_manager_add_cam(ms_factory_get_wbc_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_web_cam_manager_get(),ms_web_cam_new(desc));
ms_web_cam_manager_add_cam(ms_factory_get_wbc_manager(linphone_core_get_factory((void*)lc)),ms_web_cam_new(desc));
linphone_core_set_video_device(lc,"Mire: Mire (synthetic moving picture)");
}
}
......
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