Commit b1e6b986 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Merge remote-tracking branch 'origin/master' into dev_continuous_bw_measurement

parents 68bce248 67c0672e
......@@ -42,22 +42,6 @@ option(ENABLE_DEBUG_LOGS "Turn on or off debug level logs." NO)
set(WITH_THREAD_STACK_SIZE "0" CACHE STRING "Set thread stack size (0 is the OS default).")
macro(apply_compile_flags SOURCE_FILES)
if(${SOURCE_FILES})
set(options "")
foreach(a ${ARGV})
if(STRICT_OPTIONS_${a})
string(REPLACE ";" " " options_${a} "${STRICT_OPTIONS_${a}}")
set(options "${options} ${options_${a}}")
endif()
endforeach()
if(options)
set_source_files_properties(${${SOURCE_FILES}} PROPERTIES COMPILE_FLAGS "${options}")
endif()
endif()
endmacro()
include(CheckIncludeFile)
include(CheckFunctionExists)
include(GNUInstallDirs)
......@@ -102,7 +86,6 @@ include_directories(
include/
src/
${CMAKE_CURRENT_BINARY_DIR}
${BCTOOLBOX_CORE_INCLUDE_DIRS}
)
if(MSVC)
include_directories(${MSVC_INCLUDE_DIR})
......@@ -237,3 +220,5 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README"
"${CMAKE_CURRENT_SOURCE_DIR}/COPYING"
"${CMAKE_CURRENT_SOURCE_DIR}/AUTHORS"
DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/ortp-${ORTP_VERSION}")
......@@ -32,16 +32,24 @@ if(NOT LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${CMAKE_CURRENT_LIST_DIR}/ORTPTargets.cmake")
endif()
get_filename_component(ORTP_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(ORTP_INCLUDE_DIRS "${EP_ortp_INCLUDE_DIR}")
if(@ENABLE_SHARED@)
set(ORTP_TARGETNAME ortp)
set(ORTP_LIBRARIES ${ORTP_TARGETNAME})
else()
set(ORTP_INCLUDE_DIRS "${ORTP_CMAKE_DIR}/../../../include")
set(ORTP_TARGETNAME ortp-static)
get_target_property(ORTP_LIBRARIES ${ORTP_TARGETNAME} LOCATION)
get_target_property(ORTP_LINK_LIBRARIES ${ORTP_TARGETNAME} INTERFACE_LINK_LIBRARIES)
if(ORTP_LINK_LIBRARIES)
list(APPEND ORTP_LIBRARIES ${ORTP_LINK_LIBRARIES})
endif()
endif()
if(@ENABLE_SHARED@)
set(ORTP_LIBRARIES ortp)
get_target_property(ORTP_INCLUDE_DIRS ${ORTP_TARGETNAME} INTERFACE_INCLUDE_DIRECTORIES)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
list(INSERT ORTP_INCLUDE_DIRS 0 "${EP_ortp_INCLUDE_DIR}")
else()
set(ORTP_LIBRARIES ortp-static)
list(INSERT ORTP_INCLUDE_DIRS 0 "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
endif()
list(REMOVE_DUPLICATES ORTP_INCLUDE_DIRS)
set(ORTP_CPPFLAGS @ORTP_CPPFLAGS@)
set(ORTP_FOUND 1)
......@@ -79,7 +79,7 @@ develop programs using the oRTP library.
%setup -n %{name}-%{version}-%build_number
%build
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir}
%{expand:%%%cmake_name} . -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} -DCMAKE_PREFIX_PATH:PATH=%{_prefix}
make %{?_smp_mflags}
%install
......
......@@ -70,7 +70,7 @@ struct _PayloadTypeAvpfParams {
uint16_t trr_interval; /**< The interval in milliseconds between regular RTCP packets. */
};
struct _PayloadType
struct _OrtpPayloadType
{
int type; /**< one of PAYLOAD_* macros*/
int clock_rate; /**< rtp clock rate*/
......@@ -90,7 +90,8 @@ struct _PayloadType
#ifndef PayloadType_defined
#define PayloadType_defined
typedef struct _PayloadType PayloadType;
typedef struct _OrtpPayloadType OrtpPayloadType;
typedef OrtpPayloadType PayloadType;
typedef struct _PayloadTypeAvpfParams PayloadTypeAvpfParams;
#endif
......@@ -109,6 +110,7 @@ ORTP_PUBLIC void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp
ORTP_PUBLIC void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp);
#define payload_type_get_avpf_params(pt) ((pt)->avpf)
ORTP_PUBLIC void payload_type_set_avpf_params(PayloadType *pt, PayloadTypeAvpfParams params);
ORTP_PUBLIC bool_t payload_type_is_vbr(const PayloadType *pt);
#define payload_type_get_bitrate(pt) ((pt)->normal_bitrate)
#define payload_type_get_rate(pt) ((pt)->clock_rate)
......
......@@ -82,14 +82,15 @@ if(WIN32)
endif()
endif()
apply_compile_flags(ORTP_SOURCE_FILES_C "CPP" "C")
apply_compile_flags(ORTP_SOURCE_FILES_CXX "CPP" "CXX")
bc_apply_compile_flags(ORTP_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
bc_apply_compile_flags(ORTP_SOURCE_FILES_CXX STRICT_OPTIONS_CPP STRICT_OPTIONS_CXX)
if(ENABLE_STATIC)
add_library(ortp-static STATIC ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES_C} ${ORTP_SOURCE_FILES_CXX})
set_target_properties(ortp-static PROPERTIES OUTPUT_NAME ortp)
target_compile_definitions(ortp-static PRIVATE "ORTP_EXPORTS")
target_link_libraries(ortp-static ${LIBS})
target_include_directories(ortp-static PUBLIC ${BCTOOLBOX_CORE_INCLUDE_DIRS})
target_link_libraries(ortp-static INTERFACE ${LIBS})
install(TARGETS ortp-static EXPORT ${EXPORT_TARGETS_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
......@@ -98,7 +99,7 @@ endif()
if(ENABLE_SHARED)
add_library(ortp SHARED ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES_C} ${ORTP_SOURCE_FILES_CXX})
if(ANDROID)
set_target_properties(ortp PROPERTIES OUTPUT_NAME "ortp-${NDK_ARCHITECTURE}")
set_target_properties(ortp PROPERTIES OUTPUT_NAME "ortp-${CMAKE_ANDROID_ARCH_ABI}")
else()
# Do not version shared library on Android
set_target_properties(ortp PROPERTIES SOVERSION ${ORTP_SO_VERSION})
......@@ -107,6 +108,7 @@ if(ENABLE_SHARED)
target_compile_options(ortp PRIVATE "/DELAYLOAD:Qwave.dll")
endif()
target_compile_definitions(ortp PRIVATE "ORTP_EXPORTS")
target_include_directories(ortp PUBLIC ${BCTOOLBOX_CORE_INCLUDE_DIRS})
target_link_libraries(ortp PRIVATE ${LIBS})
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
......
......@@ -311,13 +311,13 @@ void jitter_control_new_packet_rls(JitterControl *ctl, uint32_t packet_ts, uint3
((float)ctl->adapt_jitt_comp_ts/(float)ctl->clock_rate)*1000.0,
ctl->jitter_buffer_mean_size,
ctl->params.min_size, ctl->params.nom_size, ctl->params.max_size);
ortp_message("jitter buffer rls stats: count=%d"
ortp_message("jitter buffer rls stats: count=%d, clockrate=%i"
", offset=%g clock_ratio=%g"
", capped_offset=%i capped_clock_ratio=%f"
", max_ts_deviation=%f prev_max_ts_deviation=%f"
", deviation=%i"
", RLS VARIABLES: P[0][0]=%f, P[1][0]=%f, P[0][1]=%f, P[1][1]=%f"
, ctl->count
, ctl->count, ctl->clock_rate
, ctl->kalman_rls.b, ctl->kalman_rls.m
, (int) ctl->clock_offset_ts, (float)ctl->capped_clock_ratio
, ortp_extremum_get_current(&ctl->max_ts_deviation), ortp_extremum_get_previous(&ctl->max_ts_deviation)
......
......@@ -128,6 +128,11 @@ void payload_type_set_avpf_params(PayloadType *pt, PayloadTypeAvpfParams params)
}
}
bool_t payload_type_is_vbr(const PayloadType *pt) {
if (pt->type == PAYLOAD_VIDEO) return TRUE;
return !!(pt->flags & PAYLOAD_TYPE_IS_VBR);
}
/**
* Frees a PayloadType.
......
......@@ -23,7 +23,7 @@
if (NOT IOS)
set(EXECUTABLES rtpsend rtprecv mrtpsend mrtprecv test_timer tevrtpsend tevrtprecv rtpsend_stupid)
foreach(executable ${EXECUTABLES})
apply_compile_flags(${executable}.c "CPP" "C")
bc_apply_compile_flags(${executable}.c STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
add_executable(${executable} ${executable}.c)
target_link_libraries(${executable} ortp)
endforeach()
......
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