mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 06:38:08 +00:00
Change window IDs type and make local player to use the default ring sound card instead of the default playback one
This commit is contained in:
parent
b70e389ef5
commit
a9a651b954
5 changed files with 25 additions and 25 deletions
|
|
@ -603,10 +603,10 @@ void linphone_player_destroy(LinphonePlayer *obj);
|
|||
* @param lc A LinphoneCore object
|
||||
* @param snd_card Playback sound card. If NULL, the sound card set in LinphoneCore will be used
|
||||
* @param video_out Video display. If NULL, the video display set in LinphoneCore will be used
|
||||
* @param window_id Pointer on the drawing window
|
||||
* @param window_id Id of the drawing window. Depend of video out
|
||||
* @return A pointer on the new instance. NULL if faild.
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, void *window_id);
|
||||
LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, unsigned long window_id);
|
||||
|
||||
/**
|
||||
* @brief Check whether Matroksa format is supported by the player
|
||||
|
|
|
|||
|
|
@ -5326,7 +5326,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createLocalPlayer(JNIEn
|
|||
return 0;
|
||||
}
|
||||
window_ref = env->NewGlobalRef(window);
|
||||
LinphonePlayer *player = linphone_core_create_local_player((LinphoneCore *)ptr, snd_card, "MSAndroidDisplay", window_ref);
|
||||
LinphonePlayer *player = linphone_core_create_local_player((LinphoneCore *)ptr, NULL, "MSAndroidDisplay", (unsigned long)window_ref);
|
||||
if(player == NULL) {
|
||||
ms_error("Fails to create a player");
|
||||
if(window_ref) env->DeleteGlobalRef(window_ref);
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ static void _local_player_close(LinphonePlayer *obj);
|
|||
static void _local_player_destroy(LinphonePlayer *obj);
|
||||
static void _local_player_eof_callback(void *user_data);
|
||||
|
||||
LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, void *window_id) {
|
||||
LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, unsigned long window_id) {
|
||||
LinphonePlayer *obj = ms_new0(LinphonePlayer, 1);
|
||||
if(snd_card == NULL) snd_card = lc->sound_conf.play_sndcard;
|
||||
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->open = _local_player_open;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit d344de5fe5875b219bc19aa0fa76380986a70fa2
|
||||
Subproject commit cebd5a0e1d1aa69cc2721a82a4d6514288abe7c7
|
||||
|
|
@ -18,23 +18,23 @@
|
|||
|
||||
#include "liblinphone_tester.h"
|
||||
|
||||
static const char *_get_default_video_renderer(void){
|
||||
#ifdef WIN32
|
||||
return "MSDrawDibDisplay";
|
||||
#elif defined(ANDROID)
|
||||
return "MSAndroidDisplay";
|
||||
#elif __APPLE__ && !defined(__ios)
|
||||
return "MSOSXGLDisplay";
|
||||
#elif defined (HAVE_XV)
|
||||
return "MSX11Video";
|
||||
#elif defined(HAVE_GL)
|
||||
return "MSGLXVideo";
|
||||
#elif defined(__ios)
|
||||
return "IOSDisplay";
|
||||
#else
|
||||
return "MSVideoOut";
|
||||
#endif
|
||||
}
|
||||
//static const char *_get_default_video_renderer(void){
|
||||
//#ifdef WIN32
|
||||
// return "MSDrawDibDisplay";
|
||||
//#elif defined(ANDROID)
|
||||
// return "MSAndroidDisplay";
|
||||
//#elif __APPLE__ && !defined(__ios)
|
||||
// return "MSOSXGLDisplay";
|
||||
//#elif defined (HAVE_XV)
|
||||
// return "MSX11Video";
|
||||
//#elif defined(HAVE_GL)
|
||||
// return "MSGLXVideo";
|
||||
//#elif defined(__ios)
|
||||
// return "IOSDisplay";
|
||||
//#else
|
||||
// return "MSVideoOut";
|
||||
//#endif
|
||||
//}
|
||||
|
||||
static bool_t wait_for_eof(bool_t *eof, int *time,int time_refresh, int timeout) {
|
||||
while(*time < timeout && !*eof) {
|
||||
|
|
@ -59,7 +59,7 @@ static void play_file(const char *filename, bool_t unsupported_format) {
|
|||
CU_ASSERT_PTR_NOT_NULL(lc_manager);
|
||||
if(lc_manager == NULL) return;
|
||||
|
||||
player = linphone_core_create_local_player(lc_manager->lc, ms_snd_card_manager_get_default_card(ms_snd_card_manager_get()), _get_default_video_renderer(), NULL);
|
||||
player = linphone_core_create_local_player(lc_manager->lc, ms_snd_card_manager_get_default_card(ms_snd_card_manager_get()), "MSX11Video", 0);
|
||||
CU_ASSERT_PTR_NOT_NULL(player);
|
||||
if(player == NULL) goto fail;
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ static void play_file(const char *filename, bool_t unsupported_format) {
|
|||
}
|
||||
|
||||
static void playing_test(void) {
|
||||
play_file("sounds/hello_opus_h264.mkv", !linphone_local_player_matroska_supported());
|
||||
play_file("/home/francois/Téléchargements/test_linphone.mkv", !linphone_local_player_matroska_supported());
|
||||
}
|
||||
|
||||
test_t player_tests[] = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue