mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-01 02:39:22 +00:00
Fix "Player/Local MKV file" liblinphone's tester
This commit is contained in:
parent
23232b101f
commit
ea4c24e84e
1 changed files with 10 additions and 22 deletions
|
|
@ -17,24 +17,7 @@
|
|||
*/
|
||||
|
||||
#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
|
||||
}
|
||||
#include <mediastreamer2/mediastream.h>
|
||||
|
||||
static bool_t wait_for_eof(bool_t *eof, int *time,int time_refresh, int timeout) {
|
||||
while(*time < timeout && !*eof) {
|
||||
|
|
@ -49,7 +32,7 @@ static void eof_callback(LinphonePlayer *player, void *user_data) {
|
|||
*eof = TRUE;
|
||||
}
|
||||
|
||||
static void play_file(const char *filename, bool_t unsupported_format) {
|
||||
static void play_file(const char *filename, bool_t unsupported_format, const char *audio_mime, const char *video_mime) {
|
||||
LinphoneCoreManager *lc_manager;
|
||||
LinphonePlayer *player;
|
||||
int res, time = 0;
|
||||
|
|
@ -59,12 +42,15 @@ 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(), 0);
|
||||
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);
|
||||
CU_ASSERT_PTR_NOT_NULL(player);
|
||||
if(player == NULL) goto fail;
|
||||
|
||||
res = linphone_player_open(player, filename, eof_callback, &eof);
|
||||
if(unsupported_format) {
|
||||
if(unsupported_format
|
||||
|| (audio_mime == NULL && video_mime == NULL)
|
||||
|| (video_mime == NULL && audio_mime && !ms_filter_codec_supported(audio_mime))
|
||||
|| (audio_mime == NULL && video_mime && !ms_filter_codec_supported(video_mime))) {
|
||||
CU_ASSERT_EQUAL(res, -1);
|
||||
} else {
|
||||
CU_ASSERT_EQUAL(res, 0);
|
||||
|
|
@ -85,7 +71,9 @@ static void play_file(const char *filename, bool_t unsupported_format) {
|
|||
|
||||
static void playing_test(void) {
|
||||
char *filename = ms_strdup_printf("%s/sounds/hello_opus_h264.mkv", liblinphone_tester_file_prefix);
|
||||
play_file(filename, !linphone_local_player_matroska_supported());
|
||||
const char *audio_mime = "opus";
|
||||
const char *video_mime = "h264";
|
||||
play_file(filename, !linphone_local_player_matroska_supported(), audio_mime, video_mime);
|
||||
ms_free(filename);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue