Commit 75080eb5 authored by François Grisez's avatar François Grisez
Browse files

Add a function for MSFilePlayer to check whether Matroska support is enable

parent aea0153d
......@@ -85,4 +85,10 @@ MS2_PUBLIC bool_t ms_file_player_seek(MSFilePlayer *obj, int seek_pos_ms);
*/
MS2_PUBLIC MSPlayerState ms_file_player_get_state(MSFilePlayer *obj);
/**
* @brief Check whether Matroska format is supported by the player
* @return TRUE if supported
*/
MS2_PUBLIC bool_t ms_file_player_matroska_supported(void);
#endif
......@@ -408,7 +408,8 @@ endif
if BUILD_MATROSKA
AM_CFLAGS+= $(EBML_CFLAGS) \
$(MATROSKA_CFLAGS)
$(MATROSKA_CFLAGS) \
-DHAVE_MATROSKA
libmediastreamer_voip_la_LIBADD+= $(MATROSKA_LIBS) \
$(EBML_LIBS)
......
......@@ -225,6 +225,15 @@ void ms_file_player_set_eof_callback(MSFilePlayer *obj, MSFilePlayerEofCallback
ms_mutex_unlock(&obj->cb_access);
}
bool_t ms_file_player_matroska_supported(void) {
#ifdef HAVE_MATROSKA
return TRUE;
#else
return FALSE;
#endif
}
/* Private functions */
static bool_t _get_format(const char *filepath, FileFormat *format) {
FourCC four_cc;
size_t data_read;
......
......@@ -88,35 +88,19 @@ static void play_hello_16000_wav(void) {
}
static void play_hello_pcmu_mka(void) {
#ifdef HAVE_MATROSKA
play_file("./sounds/hello_pcmu.mka", FALSE);
#else
play_file("./sounds/hello_pcmu.mka", TRUE);
#endif
play_file("./sounds/hello_pcmu.mka", !ms_file_player_matroska_supported());
}
static void play_hello_opus_mka(void) {
#ifdef HAVE_MATROSKA
play_file("./sounds/hello_opus.mka", FALSE);
#else
play_file("./sounds/hello_opus.mka", TRUE);
#endif
play_file("./sounds/hello_opus.mka", !ms_file_player_matroska_supported());
}
static void play_hello_pcmu_h264_mkv(void) {
#ifdef HAVE_MATROSKA
play_file("./sounds/hello_pcmu_h264.mkv", FALSE);
#else
play_file("./sounds/hello_pcmu_h264.mkv", TRUE);
#endif
play_file("./sounds/hello_pcmu_h264.mkv", !ms_file_player_matroska_supported());
}
static void play_hello_opus_h264_mkv(void) {
#ifdef HAVE_MATROSKA
play_file("./sounds/hello_opus_h264.mkv", FALSE);
#else
play_file("./sounds/hello_opus_h264.mkv", TRUE);
#endif
play_file("./sounds/hello_opus_h264.mkv", !ms_file_player_matroska_supported());
}
static test_t tests[] = {
......
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