Commit 6fd92fdc authored by Sandrine Avakian's avatar Sandrine Avakian

Fixes in gtk audio_assistant and property box.

parent de1ed361
......@@ -60,7 +60,7 @@ static void ecc_init_filters(EcCalibrator *ecc){
ecc->gen=ms_factory_create_filter(ecc->factory, MS_DTMF_GEN_ID);
ms_filter_call_method(ecc->gen,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
ecc->write_resampler=ms_factory_create_filter(ecc->factory, MS_RESAMPLE_ID);
ecc->sndwrite=ms_snd_card_create_writer((void*)ecc->factory, ecc->play_card);
ecc->sndwrite=ms_snd_card_create_writer(ecc->play_card);
ms_filter_call_method(ecc->sndwrite,MS_FILTER_SET_SAMPLE_RATE,&ecc->rate);
ms_filter_call_method(ecc->sndwrite,MS_FILTER_GET_SAMPLE_RATE,&rate);
......
......@@ -211,14 +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);
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_snd_card_manager_get();
MSSndCardManager *manager = ms_snd_card_manager_get(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, lc->factory);
stream=audio_stream_new(8888, 8889, FALSE, factory);
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);
......@@ -255,13 +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);
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_snd_card_manager_get();
MSSndCardManager *manager = ms_snd_card_manager_get(factory);
if(active){
gchar *path = g_object_get_data(G_OBJECT(audio_assistant),"path");
stream=audio_stream_new(8888, 8889, FALSE, lc->factory);
stream=audio_stream_new(8888, 8889, FALSE, factory);
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);
......@@ -446,14 +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);
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_snd_card_manager_get();
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, lc->factory);
MSSndCardManager *manager = ms_snd_card_manager_get(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);
linphone_gtk_init_audio_meter(mic_audiolevel,(get_volume_t)audio_stream_get_record_volume,audio_stream);
......
......@@ -1417,8 +1417,9 @@ 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);
GtkWidget *combo=linphone_gtk_get_widget(pb,"renderers");
MSList *l=ms_filter_lookup_by_interface(MSFilterVideoDisplayInterface);
MSList *l=ms_factory_lookup_filter_by_interface(factory, MSFilterVideoDisplayInterface);
MSList *elem;
int i;
int active=-1;
......
......@@ -44,8 +44,8 @@ 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(ms_factory_get_fallback(), audio_mime));
video_codec_supported = (video_mime && ms_factory_get_decoder(ms_factory_get_fallback(), video_mime));
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);
BC_ASSERT_PTR_NOT_NULL(player);
......
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