From 29f51d8d279a44b0e484c9d2f8d89f5771c88df5 Mon Sep 17 00:00:00 2001 From: Sandrine Avakian Date: Fri, 22 Jan 2016 14:14:39 +0100 Subject: [PATCH] linphone_player_open prototype change: adding MSFactory * as parameter. --- coreapi/linphonecore.h | 2 +- coreapi/player.c | 4 ++-- gtk/videowindow.c | 2 +- tester/call_tester.c | 8 ++++---- tester/player_tester.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 36da70623..592ef536e 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -627,7 +627,7 @@ typedef struct _LinphonePlayer LinphonePlayer; **/ typedef void (*LinphonePlayerEofCallback)(struct _LinphonePlayer *obj, void *user_data); -LINPHONE_PUBLIC int linphone_player_open(LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback, void *user_data); +LINPHONE_PUBLIC int linphone_player_open(MSFactory* f, LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback, void *user_data); LINPHONE_PUBLIC int linphone_player_start(LinphonePlayer *obj); LINPHONE_PUBLIC int linphone_player_pause(LinphonePlayer *obj); LINPHONE_PUBLIC int linphone_player_seek(LinphonePlayer *obj, int time_ms); diff --git a/coreapi/player.c b/coreapi/player.c index c0506dfa1..8c9913ab6 100644 --- a/coreapi/player.c +++ b/coreapi/player.c @@ -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(LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback cb, void *user_data){ +int linphone_player_open(MSFactory *f, LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback cb, void *user_data){ obj->user_data=user_data; obj->cb=cb; - return obj->open(obj,filename, NULL); + return obj->open(obj,filename, f); } /** diff --git a/gtk/videowindow.c b/gtk/videowindow.c index c4a10d970..46375f9bc 100644 --- a/gtk/videowindow.c +++ b/gtk/videowindow.c @@ -58,7 +58,7 @@ static void drag_data_received(GtkWidget *widget, GdkDragContext *context, gint const char *path=(const char*)data; if (player){ if (strstr(path,"file://")==path) path+=strlen("file://"); - if (linphone_player_open(player,path,on_end_of_play,NULL)==0){ + if (linphone_player_open(linphone_core_get_factory((void*)linphone_call_get_core(call)),player,path,on_end_of_play,NULL)==0){ linphone_player_start(player); }else{ GtkWidget *warn=gtk_message_dialog_new(GTK_WINDOW(widget),GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, diff --git a/tester/call_tester.c b/tester/call_tester.c index 2b3d7a974..4bc136606 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -2918,7 +2918,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(player,hellopath,on_eof,marie),0, int, "%d"); + BC_ASSERT_EQUAL(linphone_player_open(marie->lc->factory, 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 */ @@ -2984,7 +2984,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(player,hellomkv,on_eof,marie); + int res = linphone_player_open(marie->lc->factory, 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"); @@ -5048,7 +5048,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(player, hellopath, on_eof, marie) , 0, int, "%d"); + BC_ASSERT_EQUAL(linphone_player_open(marie->lc->factory, player, hellopath, on_eof, marie) , 0, int, "%d"); BC_ASSERT_EQUAL(linphone_player_start(player) , 0, int, "%d"); } @@ -5340,7 +5340,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(player, hellopath, on_eof, pauline),0, int, "%d"); + BC_ASSERT_EQUAL(linphone_player_open(marie->lc->factory,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 */ diff --git a/tester/player_tester.c b/tester/player_tester.c index c14a62d44..cd66d3ab4 100644 --- a/tester/player_tester.c +++ b/tester/player_tester.c @@ -51,7 +51,7 @@ static void play_file(const char *filename, bool_t supported_format, const char BC_ASSERT_PTR_NOT_NULL(player); if(player == NULL) goto fail; - res = linphone_player_open(player, filename, eof_callback, &eof); + res = linphone_player_open(linphone_core_get_factory((void*)lc_manager->lc), player, filename, eof_callback, &eof); if(supported_format && (audio_codec_supported || video_codec_supported)) { BC_ASSERT_EQUAL(res, 0, int, "%d"); } else {