Commit cd49716a authored by Matthieu Tanon's avatar Matthieu Tanon

Merge branch 'master' into dev_lime_v2

parents c08cd438 6dbb3f1f
......@@ -34,7 +34,7 @@ real-time streaming and processing. Written in pure C, it is based
upon the oRTP library.
BuildRequires:
BuildRequires:
%package devel
Summary: Development libraries for mediastreamer
......@@ -61,7 +61,7 @@ develop programs using the mediastreamer2 library.
%setup -n %{name}-%{version}%{?build_number_ext}
%build
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_INSTALL_LIBDIR=%{_lib} -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
make %{?_smp_mflags}
%install
......@@ -104,7 +104,12 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
* Tue Nov 27 2018 ronan.abhamon <ronan.abhamon@belledonne-communications.com>
- Do not set CMAKE_INSTALL_LIBDIR.
* Thu Jul 13 2017 jehan.monnier <jehan.monnier@linphone.org>
- cmake port
* Mon Aug 19 2013 jehan.monnier <jehan.monnier@linphone.org>
- Initial RPM release.
......@@ -72,7 +72,7 @@ typedef struct _MSTickerLateEvent MSTickerLateEvent;
struct _MSTicker
{
ms_mutex_t lock;
ms_mutex_t lock; /*main lock protecting the filter execution list */
ms_cond_t cond;
MSList *execution_list; /* the list of source filters to be executed.*/
MSList *task_list; /* list of tasks (see ms_filter_postpone_task())*/
......@@ -84,6 +84,7 @@ struct _MSTicker
uint64_t orig; /* a relative time to take in account difference between time base given by consecutive get_cur_time_ptr() functions.*/
MSTickerTimeFunc get_cur_time_ptr;
void *get_cur_time_data;
ms_mutex_t cur_time_lock; /*mutex protecting the get_cur_time_ptr/get_cur_time_data which can be changed at any time*/
char *name;
double av_load; /*average load of the ticker */
MSTickerPrio prio;
......
......@@ -56,6 +56,8 @@ public class Version {
public static final int API24_NOUGAT_70 = 24;
public static final int API25_NOUGAT_71 = 25;
public static final int API26_O_80 = 26;
public static final int API27_OREO_81 = 27;
public static final int API28_PIE_90 = 28;
private static native boolean nativeHasZrtp();
private static native boolean nativeHasNeon();
......
......@@ -940,14 +940,18 @@ static void android_snd_write_postprocess(MSFilter *obj) {
SLresult result;
OpenSLESOutputContext *octx = (OpenSLESOutputContext*)obj->data;
result = (*octx->playerPlay)->SetPlayState(octx->playerPlay, SL_PLAYSTATE_STOPPED);
if (result != SL_RESULT_SUCCESS) {
ms_error("OpenSLES Error %u while stopping player", result);
if (octx->playerPlay){
result = (*octx->playerPlay)->SetPlayState(octx->playerPlay, SL_PLAYSTATE_STOPPED);
if (result != SL_RESULT_SUCCESS) {
ms_error("OpenSLES Error %u while stopping player", result);
}
}
result = (*octx->playerBufferQueue)->Clear(octx->playerBufferQueue);
if (result != SL_RESULT_SUCCESS) {
ms_error("OpenSLES Error %u while clearing player buffer queue", result);
if (octx->playerBufferQueue){
result = (*octx->playerBufferQueue)->Clear(octx->playerBufferQueue);
if (result != SL_RESULT_SUCCESS) {
ms_error("OpenSLES Error %u while clearing player buffer queue", result);
}
}
if (octx->playerObject != NULL) {
......
This diff is collapsed.
......@@ -55,6 +55,7 @@ static void ms_ticker_start(MSTicker *s){
static void ms_ticker_init(MSTicker *ticker, const MSTickerParams *params)
{
ms_mutex_init(&ticker->lock,NULL);
ms_mutex_init(&ticker->cur_time_lock, NULL);
ticker->execution_list=NULL;
ticker->task_list=NULL;
ticker->ticks=1;
......@@ -112,6 +113,7 @@ static void ms_ticker_uninit(MSTicker *ticker)
ms_ticker_stop(ticker);
ms_free(ticker->name);
ms_mutex_destroy(&ticker->lock);
ms_mutex_destroy(&ticker->cur_time_lock);
}
void ms_ticker_destroy(MSTicker *ticker){
......@@ -394,7 +396,10 @@ static int wait_next_tick(void *data, uint64_t virt_ticker_time){
int late;
while(1){
ms_mutex_lock(&s->cur_time_lock);
realtime=s->get_cur_time_ptr(s->get_cur_time_data)-s->orig;
ms_mutex_unlock(&s->cur_time_lock);
diff=s->time-realtime;
if (diff>0){
/* sleep until next tick */
......@@ -420,7 +425,9 @@ void * ms_ticker_run(void *arg)
precision = set_high_prio(s);
s->thread_id = ms_thread_self();
s->ticks=1;
ms_mutex_lock(&s->cur_time_lock);
s->orig=s->get_cur_time_ptr(s->get_cur_time_data);
ms_mutex_unlock(&s->cur_time_lock);
while(s->run){
uint64_t late_tick_time=0;
......@@ -469,12 +476,14 @@ void * ms_ticker_run(void *arg)
void ms_ticker_set_time_func(MSTicker *ticker, MSTickerTimeFunc func, void *user_data){
if (func==NULL) func=get_cur_time_ms;
ms_mutex_lock(&ticker->cur_time_lock);
ticker->get_cur_time_ptr=func;
ticker->get_cur_time_data=user_data;
/*re-set the origin to take in account that previous function ptr and the
new one may return different times*/
ticker->orig=func(user_data)-ticker->time;
ms_mutex_unlock(&ticker->cur_time_lock);
ms_message("ms_ticker_set_time_func: ticker's time method updated.");
}
......
......@@ -54,7 +54,7 @@ static int get_next_buf(const RealTimeTextSourceData *stream, const int cur) {
}
static uint32_t get_red_subheader(int pt, int offset, size_t length) {
return (1 << 31) | ((0x7F & pt) << 24) | ((0x3FFF & offset) << 10) | (0x3FF & (int)length);
return ((uint32_t)1 << 31) | ((0x7F & pt) << 24) | ((0x3FFF & offset) << 10) | (0x3FF & (int)length);
}
static mblk_t *realtime_text_stream_generate_red_packet(RealTimeTextSourceData *stream) {
......
......@@ -164,7 +164,7 @@ bool_t ms_media_player_open(MSMediaPlayer *obj, const char *filepath) {
_destroy_graph(obj);
return FALSE;
}
ms_filter_add_notify_callback(obj->player, _eof_filter_notify_cb, obj, TRUE);
ms_filter_add_notify_callback(obj->player, _eof_filter_notify_cb, obj, FALSE);
ms_filter_call_method(obj->player, MS_PLAYER_SET_LOOP, &obj->loop_interval);
obj->ticker = ms_ticker_new();
ms_ticker_set_name(obj->ticker, "Player");
......@@ -249,7 +249,7 @@ int ms_media_player_get_duration(MSMediaPlayer *obj) {
}
int ms_media_player_get_current_position(MSMediaPlayer *obj) {
int position;
int64_t position;
if(!obj->is_open) {
ms_error("Could not get position. No file is open");
return -1;
......
......@@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <mediastreamer2/stun.h>
#include <bctoolbox/compiler.h>
#include <bctoolbox/crypto.h>
#include <bctoolbox/port.h>
......@@ -359,7 +360,7 @@ static uint32_t decode32(StunMessageDecoder *decoder) {
return value;
}
static uint64_t decode64(StunMessageDecoder *decoder) {
BCTBX_DISABLE_UBSAN static uint64_t decode64(StunMessageDecoder *decoder) {
uint64_t value = ntohq(*((uint64_t *)decoder->ptr));
decoder->ptr += sizeof(uint64_t);
decoder->remaining -= sizeof(uint64_t);
......
......@@ -108,7 +108,7 @@ set(SOURCE_FILES_C
mediastreamer2_text_stream_tester.c
mediastreamer2_jitterbuffer_tester.c
)
set(SOURCE_FILES_CXX mediastreamer2_h26x_tools_tester.cpp)
set(SOURCE_FILES_CXX )
set(SOURCE_FILES_OBJC )
add_definitions(
......@@ -117,6 +117,7 @@ add_definitions(
if(ENABLE_VIDEO)
list(APPEND SOURCE_FILES_C mediastreamer2_video_stream_tester.c)
list(APPEND SOURCE_FILES_CXX mediastreamer2_h26x_tools_tester.cpp)
if(ENABLE_QRCODE)
list(APPEND SOURCE_FILES_C mediastreamer2_qrcode_tester.c)
endif()
......
......@@ -44,7 +44,25 @@ static void log_handler(int lev, const char *fmt, va_list args) {
}
}
int silent_arg_func(const char *arg) {
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_FATAL);
return 0;
}
int verbose_arg_func(const char *arg) {
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
return 0;
}
int logfile_arg_func(const char *arg) {
if (mediastreamer2_tester_set_log_file(arg) < 0) return -2;
return 0;
}
void mediastreamer2_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args)) {
bc_tester_set_silent_func(silent_arg_func);
bc_tester_set_verbose_func(verbose_arg_func);
bc_tester_set_logfile_func(logfile_arg_func);
if (ftester_printf == NULL) ftester_printf = log_handler;
bc_tester_init(ftester_printf, ORTP_MESSAGE, ORTP_ERROR, "sounds");
......@@ -54,6 +72,7 @@ void mediastreamer2_tester_init(void(*ftester_printf)(int level, const char *fmt
bc_tester_add_suite(&audio_stream_test_suite);
#ifdef VIDEO_ENABLED
bc_tester_add_suite(&video_stream_test_suite);
bc_tester_add_suite(&h26x_tools_test_suite);
#endif
#ifdef QRCODE_ENABLED
bc_tester_add_suite(&qrcode_test_suite);
......@@ -68,7 +87,6 @@ void mediastreamer2_tester_init(void(*ftester_printf)(int level, const char *fmt
bc_tester_add_suite(&codec_impl_test_suite);
bc_tester_add_suite(&jitterbuffer_test_suite);
#endif
bc_tester_add_suite(&h26x_tools_test_suite);
}
void mediastreamer2_tester_uninit(void) {
......@@ -101,12 +119,6 @@ int mediastreamer2_tester_set_log_file(const char *filename) {
return 0;
}
static const char* mediastreamer2_helper =
"\t\t\t--verbose\n"
"\t\t\t--silent\n"
"\t\t\t--log-file <output log file path>\n";
#if defined(_WIN32) && !defined(MS2_WINDOWS_DESKTOP)
#define BUILD_ENTRY_POINT 0
#else
......@@ -134,23 +146,14 @@ int main (int argc, char *argv[]) {
ms_free(prefix);
}
for(i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--verbose") == 0) {
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
} else if (strcmp(argv[i], "--silent") == 0) {
ortp_set_log_level_mask(ORTP_LOG_DOMAIN, ORTP_FATAL);
} else if (strcmp(argv[i],"--log-file")==0){
CHECK_ARG("--log-file", ++i, argc);
if (mediastreamer2_tester_set_log_file(argv[i]) < 0) return -2;
} else {
int ret = bc_tester_parse_args(argc, argv, i);
if (ret>0) {
i += ret - 1;
continue;
} else if (ret<0) {
bc_tester_helper(argv[0], mediastreamer2_helper);
}
return ret;
int ret = bc_tester_parse_args(argc, argv, i);
if (ret>0) {
i += ret - 1;
continue;
} else if (ret<0) {
bc_tester_helper(argv[0], "");
}
return ret;
}
ret = bc_tester_start(argv[0]);
......
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