Commit 55865d73 authored by Ghislain MARY's avatar Ghislain MARY

Merge branch 'master' into dev_windows10_video_background

Conflicts:
	tester/mediastreamer2_tester_windows.cpp
	tester/mediastreamer2_tester_windows.h
parents f22f8dc0 cda13b73
......@@ -28,7 +28,7 @@ set(MEDIASTREAMER_MAJOR_VERSION "2")
set(MEDIASTREAMER_MINOR_VERSION "12")
set(MEDIASTREAMER_MICRO_VERSION "1")
set(MEDIASTREAMER_VERSION "${MEDIASTREAMER_MAJOR_VERSION}.${MEDIASTREAMER_MINOR_VERSION}.${MEDIASTREAMER_MICRO_VERSION}")
set(MEDIASTREAMER_SO_VERSION "6")
set(MEDIASTREAMER_SO_VERSION "7") # incremented on January, the 20th 2016. DO NOT INCREMENT BEFORE MEDIASTREAMER 2.13
string(REGEX MATCH "^(arm*|aarch64)" FIXED_POINT_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
if(FIXED_POINT_PROCESSOR)
......@@ -121,8 +121,8 @@ include(CheckIncludeFile)
include(CheckLibraryExists)
include(CMakePushCheckState)
set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC")
if(MSVC)
if(MSVC AND MSVC_VERSION LESS 1800)
set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC")
list(APPEND CMAKE_REQUIRED_INCLUDES "${MSVC_INCLUDE_DIR}")
endif()
......@@ -191,7 +191,11 @@ if(ENABLE_ZRTP)
endif()
if(ENABLE_DTLS AND ENABLE_SRTP) # DTLS requires SRTP
if(NOT POLARSSL_FOUND OR NOT HAVE_SSL_GET_DTLS_SRTP_PROTECTION_PROFILE)
message(WARNING "Could not find polarssl library with DTLS support, mediastreamer2 will be compiled without DTLS support.")
if (NOT POLARSSL_FOUND)
message(WARNING "Could not find polarssl library required by DTLS, mediastreamer2 will be compiled without DTLS support.")
else()
message(WARNING "Polarssl library was found but misses HAVE_SSL_GET_DTLS_SRTP_PROTECTION_PROFILE required by DTLS, mediastreamer2 will be compiled without DTLS support.")
endif()
set(ENABLE_DTLS OFF CACHE BOOL "Build mediastreamer2 with DTLS support." FORCE)
endif()
endif()
......@@ -384,7 +388,7 @@ endif()
if(PCAP_FOUND)
include_directories(${PCAP_INCLUDE_DIRS})
endif()
if(MSVC)
if(MSVC_INCLUDE_DIR)
include_directories(${MSVC_INCLUDE_DIR})
endif()
......@@ -442,8 +446,13 @@ if(MATROSKA2_FOUND)
set(HAVE_MATROSKA 1)
endif()
if(ENABLE_RELATIVE_PREFIX)
set(PACKAGE_PLUGINS_DIR "./lib/mediastreamer/plugins")
set(PACKAGE_DATA_DIR "./share")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(PACKAGE_PLUGINS_DIR ".")
set(PACKAGE_DATA_DIR ".")
else()
set(PACKAGE_PLUGINS_DIR "./lib/mediastreamer/plugins")
set(PACKAGE_DATA_DIR "./share")
endif()
else()
set(PACKAGE_PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/lib/mediastreamer/plugins")
set(PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share")
......
......@@ -198,10 +198,10 @@ LOCAL_CFLAGS += \
-DNDEBUG
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../../../externals/libmatroska \
$(LOCAL_PATH)/../../../externals/libmatroska/corec \
$(LOCAL_PATH)/../../../externals/libmatroska/libebml2 \
$(LOCAL_PATH)/../../../externals/libmatroska/libmatroska2
$(LOCAL_PATH)/../../../externals/libmatroska-c \
$(LOCAL_PATH)/../../../externals/libmatroska-c/corec \
$(LOCAL_PATH)/../../../externals/libmatroska-c/libebml2 \
$(LOCAL_PATH)/../../../externals/libmatroska-c/libmatroska2
LOCAL_SRC_FILES += \
utils/mkv_reader.c \
......
......@@ -16,7 +16,7 @@ MEDIASTREAMER_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
MEDIASTREAMER_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
MEDIASTREAMER_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
LIBMEDIASTREAMER_SO_CURRENT=6 dnl increment this number when you add/change/remove an interface
LIBMEDIASTREAMER_SO_CURRENT=7 dnl increment this number when you add/change/remove an interface
LIBMEDIASTREAMER_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
LIBMEDIASTREAMER_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
......@@ -888,69 +888,80 @@ AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${package_prefix}/share" ,[path of data])
AC_SUBST(PACKAGE_DATA_DIR)
dnl check for video4linux headers
AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
if test "${ac_cv_header_linux_videodev_h}" = "yes" ; then
found_v4l1=yes
else
found_v4l1=no
fi
if test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then
found_v4l2=yes
else
found_v4l2=no
fi
AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
AC_ARG_ENABLE(libv4l1,
[AS_HELP_STRING([--disable-libv4l1], [Disable usage of libv4l1, really discouraged])],
AC_ARG_ENABLE(v4l,
[AS_HELP_STRING([--disable-v4l], [Disable usage of video4linux, really discouraged (linux-only)])],
[case "${enableval}" in
yes) libv4l1=yes ;;
no) libv4l1=no ;;
yes) v4l=yes ;;
no) v4l=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l1) ;;
esac],
[libv4l1=yes]
[v4l=yes]
)
AC_ARG_ENABLE(libv4l2,
[AS_HELP_STRING([--disable-libv4l2], [Disable usage of libv4l2, really discouraged])],
[case "${enableval}" in
yes) libv4l2=yes ;;
no) libv4l2=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l2) ;;
esac],
[libv4l2=yes]
)
if test "$v4l" = "yes" ; then
AC_CHECK_HEADERS(linux/videodev.h linux/videodev2.h)
if test "${ac_cv_header_linux_videodev_h}" = "yes" ; then
found_v4l1=yes
else
found_v4l1=no
fi
if test "${ac_cv_header_linux_videodev2_h}" = "yes" ; then
found_v4l2=yes
else
found_v4l2=no
fi
PKG_CHECK_MODULES(LIBV4L2, libv4l2,
[AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])
have_libv4l2=yes],
[echo "No libv4l2 found."]
)
PKG_CHECK_MODULES(LIBV4L1, libv4l1,
[AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])
have_libv4l1=yes],
[echo "No libv4l1 found."]
)
PKG_CHECK_MODULES(LIBV4LCONVERT, libv4lconvert,
[AC_DEFINE(HAVE_LIBV4LCONVERT,1,[Defined if we have libv4lconvert])
have_libv4lconvert=yes],
[echo "No libv4lconvert found."]
)
AC_ARG_ENABLE(libv4l1,
[AS_HELP_STRING([--disable-libv4l1], [Disable usage of libv4l1, really discouraged])],
[case "${enableval}" in
yes) libv4l1=yes ;;
no) libv4l1=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l1) ;;
esac],
[libv4l1=yes]
)
if test "$found_v4l2" = "yes" && test "$have_libv4l2" != "yes" ; then
if test "$video" = "true" && test "$libv4l2" = "yes" ; then
AC_MSG_ERROR([
Missing libv4l2. It is highly recommended to build with
libv4l2 headers and library. Many camera will won't work or will crash
your application if libv4l2 is not installed.
If you know what you are doing, you can use --disable-libv4l2 to disable
this check.
])
AC_ARG_ENABLE(libv4l2,
[AS_HELP_STRING([--disable-libv4l2], [Disable usage of libv4l2, really discouraged])],
[case "${enableval}" in
yes) libv4l2=yes ;;
no) libv4l2=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-libv4l2) ;;
esac],
[libv4l2=yes]
)
PKG_CHECK_MODULES(LIBV4L2, libv4l2,
[AC_DEFINE(HAVE_LIBV4L2,1,[Defined if we have libv4l2])
have_libv4l2=yes],
[echo "No libv4l2 found."]
)
PKG_CHECK_MODULES(LIBV4L1, libv4l1,
[AC_DEFINE(HAVE_LIBV4L1,1,[Defined if we have libv4l1])
have_libv4l1=yes],
[echo "No libv4l1 found."]
)
PKG_CHECK_MODULES(LIBV4LCONVERT, libv4lconvert,
[AC_DEFINE(HAVE_LIBV4LCONVERT,1,[Defined if we have libv4lconvert])
have_libv4lconvert=yes],
[echo "No libv4lconvert found."]
)
if test "$found_v4l2" = "yes" && test "$have_libv4l2" != "yes" ; then
if test "$video" = "true" && test "$libv4l2" = "yes" ; then
AC_MSG_ERROR([
Missing libv4l2. It is highly recommended to build with
libv4l2 headers and library. Many camera will won't work or will crash
your application if libv4l2 is not installed.
If you know what you are doing, you can use --disable-libv4l2 to disable
this check.
])
fi
fi
fi
AM_CONDITIONAL(BUILD_V4L1, test x$found_v4l1 = xyes )
AM_CONDITIONAL(BUILD_V4L2, test x$found_v4l2 = xyes )
AC_PATH_PROG(PCAP,pcap-config,false)
AM_CONDITIONAL(HAVE_PCAP, test $PCAP != false)
......@@ -1028,12 +1039,6 @@ fi
AM_CONDITIONAL(BUILD_TESTS,test x$found_cunit = xyes)
case "$target_os" in
*linux*)
# Eliminate -lstdc++ addition to postdeps for cross compiles.
postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'`
;;
esac
dnl check for libsrtp support (secure rtp)
AC_ARG_WITH(srtp,
......
......@@ -4,7 +4,7 @@
dh $@ --parallel --with autotools_dev
override_dh_auto_configure:
dh_auto_configure -- --disable-video --with-srtp=none
dh_auto_configure --
override_dh_makeshlibs:
dh_makeshlibs -V
......
......@@ -30,7 +30,8 @@ extern "C"{
typedef enum _MSFormatType{
MSAudio,
MSVideo,
MSText
MSText,
MSUnknownMedia
}MSFormatType;
/**
......
......@@ -331,7 +331,7 @@ MS2_PUBLIC const char * ice_session_remote_pwd(const IceSession *session);
MS2_PUBLIC IceSessionState ice_session_state(const IceSession *session);
/**
* Gte the role of the agent for an ICE session.
* Get the role of the agent for an ICE session.
*
* @param session A pointer to a session
* @return The role of the agent for the session
......@@ -502,7 +502,7 @@ MS2_PUBLIC void ice_session_select_candidates(IceSession *session);
*
* @param session A pointer to a session
*/
MS2_PUBLIC void ice_session_restart(IceSession *session);
MS2_PUBLIC void ice_session_restart(IceSession *session, IceRole role);
/**
* Get the state of an ICE check list.
......
......@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ortp/ortp.h>
#include <ortp/event.h>
#include <mediastreamer2/msfactory.h>
#include <mediastreamer2/msfilter.h>
#include <mediastreamer2/msticker.h>
#include <mediastreamer2/mssndcard.h>
......@@ -63,8 +64,8 @@ struct _RingStream
typedef struct _RingStream RingStream;
MS2_PUBLIC RingStream *ring_start (const char * file, int interval, MSSndCard *sndcard);
MS2_PUBLIC RingStream *ring_start_with_cb(const char * file, int interval, MSSndCard *sndcard, MSFilterNotifyFunc func, void * user_data);
MS2_PUBLIC RingStream *ring_start(MSFactory *factory, const char * file, int interval, MSSndCard *sndcard);
MS2_PUBLIC RingStream *ring_start_with_cb(MSFactory *factory, const char * file, int interval, MSSndCard *sndcard, MSFilterNotifyFunc func, void * user_data);
MS2_PUBLIC void ring_stop (RingStream * stream);
/**
......@@ -392,14 +393,15 @@ struct _AudioStream
int sample_rate;
int nchannels;
struct _VideoStream *videostream;/*the stream with which this audiostream is paired*/
MSAudioRoute audio_route;
bool_t play_dtmfs;
bool_t use_ec;
bool_t use_gc;
bool_t use_agc;
bool_t eq_active;
bool_t use_ng;/*noise gate*/
bool_t is_ec_delay_set;
MSAudioRoute audio_route;
};
/**
......@@ -409,10 +411,11 @@ typedef struct _AudioStream AudioStream;
/* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */
MS2_PUBLIC AudioStream *audio_stream_start (RtpProfile * prof, int locport, const char *remip,
MS2_PUBLIC AudioStream *audio_stream_start(MSFactory* factory, RtpProfile * prof, int locport, const char *remip,
int remport, int payload_type, int jitt_comp, bool_t echo_cancel);
MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(RtpProfile * prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t echocancel);
MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(MSFactory* factory, RtpProfile* prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard,
MSSndCard *captcard, bool_t echocancel);
MS2_PUBLIC int audio_stream_start_with_files (AudioStream * stream, RtpProfile * prof,
const char *remip, int remport, int rem_rtcp_port,
......@@ -475,25 +478,28 @@ MS2_PUBLIC void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno);
* @param loc_rtp_port the local UDP port to listen for RTP packets.
* @param loc_rtcp_port the local UDP port to listen for RTCP packets
* @param ipv6 TRUE if ipv6 must be used.
* @param factory
* @return a new AudioStream.
**/
MS2_PUBLIC AudioStream *audio_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
MS2_PUBLIC AudioStream *audio_stream_new(MSFactory* factory, int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
/**
* Creates an AudioStream object listening on a RTP port for a dedicated address.
* @param loc_ip the local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses
* @param loc_rtp_port the local UDP port to listen for RTP packets.
* @param loc_rtcp_port the local UDP port to listen for RTCP packets
* @param factory
* @return a new AudioStream.
**/
MS2_PUBLIC AudioStream *audio_stream_new2(const char* ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC AudioStream *audio_stream_new2(MSFactory* factory, const char* ip, int loc_rtp_port, int loc_rtcp_port);
/**Creates an AudioStream object from initialized MSMediaStreamSessions.
* @param sessions the MSMediaStreamSessions
* @param factory the MSFActory from the core object
* @return a new AudioStream
**/
MS2_PUBLIC AudioStream *audio_stream_new_with_sessions(const MSMediaStreamSessions *sessions);
MS2_PUBLIC AudioStream *audio_stream_new_with_sessions(MSFactory* factory, const MSMediaStreamSessions *sessions);
#define AUDIO_STREAM_FEATURE_PLC (1 << 0)
#define AUDIO_STREAM_FEATURE_EC (1 << 1)
......@@ -797,22 +803,23 @@ struct _VideoStream
int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */
uint64_t last_reported_decoding_error_time;
uint64_t last_fps_check;
MediaStreamVideoStat ms_video_stat;
bool_t use_preview_window;
bool_t freeze_on_error;
bool_t display_filter_auto_rotate_enabled;
bool_t source_performs_encoding;
bool_t output_performs_decoding;
bool_t player_active;
bool_t staticimage_webcam_fps_optimization; /* if TRUE, the StaticImage webcam will ignore the fps target in order to save CPU time. Default is TRUE */
MediaStreamVideoStat ms_video_stat;
};
typedef struct _VideoStream VideoStream;
MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6);
MS2_PUBLIC VideoStream *video_stream_new(MSFactory* factory, int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6);
/**
* Creates a VideoStream object listening on a RTP port for a dedicated address.
* @param loc_ip the local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses
......@@ -820,9 +827,9 @@ MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bo
* @param [in] loc_rtcp_port the local UDP port to listen for RTCP packets
* @return a new VideoStream.
**/
MS2_PUBLIC VideoStream *video_stream_new2(const char* ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC VideoStream *video_stream_new2(MSFactory* factory, const char* ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC VideoStream *video_stream_new_with_sessions(const MSMediaStreamSessions *sessions);
MS2_PUBLIC VideoStream *video_stream_new_with_sessions(MSFactory* factory, const MSMediaStreamSessions *sessions);
MS2_PUBLIC void video_stream_set_direction(VideoStream *vs, MediaStreamDir dir);
static MS2_INLINE void video_stream_enable_adaptive_bitrate_control(VideoStream *stream, bool_t enabled) {
media_stream_enable_adaptive_bitrate_control(&stream->ms, enabled);
......@@ -1166,7 +1173,7 @@ MS2_PUBLIC MSWebCamDesc *ms_mire_webcam_desc_get(void);
* @param[in] local_rtp_port The local port to bind the RTP socket to.
* @param[in] local_rtcp_port The local port to bind the RTCP socket to.
*/
MS2_PUBLIC RtpSession * ms_create_duplex_rtp_session(const char* local_ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC RtpSession * ms_create_duplex_rtp_session(const char* local_ip, int loc_rtp_port, int loc_rtcp_port, int mtu);
/**
* Asks the audio playback filter to route to the selected device (currently only used for blackberry)
......@@ -1200,25 +1207,28 @@ typedef struct _TextStream TextStream;
* @param loc_rtp_port the local UDP port to listen for RTP packets.
* @param loc_rtcp_port the local UDP port to listen for RTCP packets
* @param ipv6 TRUE if ipv6 must be used.
* @param factory
* @return a new TextStream.
**/
MS2_PUBLIC TextStream *text_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
MS2_PUBLIC TextStream *text_stream_new(MSFactory *factory, int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
/**
* Creates a TextStream object from initialized MSMediaStreamSessions.
* @param sessions the MSMediaStreamSessions
* @param factory
* @return a new TextStream
**/
MS2_PUBLIC TextStream *text_stream_new_with_sessions(const MSMediaStreamSessions *sessions);
MS2_PUBLIC TextStream *text_stream_new_with_sessions(MSFactory *factory, const MSMediaStreamSessions *sessions);
/**
* Creates a TextStream object listening on a RTP port for a dedicated address.
* @param loc_ip the local ip to listen for RTP packets. Can be ::, O.O.O.O or any ip4/6 addresses
* @param [in] loc_rtp_port the local UDP port to listen for RTP packets.
* @param [in] loc_rtcp_port the local UDP port to listen for RTCP packets
* @param factory
* @return a new TextStream.
**/
MS2_PUBLIC TextStream *text_stream_new2(const char* ip, int loc_rtp_port, int loc_rtcp_port);
MS2_PUBLIC TextStream *text_stream_new2(MSFactory *factory, const char* ip, int loc_rtp_port, int loc_rtcp_port);
/**
* Starts a text stream.
......@@ -1230,8 +1240,10 @@ MS2_PUBLIC TextStream *text_stream_new2(const char* ip, int loc_rtp_port, int lo
* @param[in] rem_rtcp_addr The remote IP address for RTCP.
* @param[in] rem_rtcp_port The remote port for RTCP.
* @param[in] payload_type The payload type number used to send the text stream. A valid PayloadType must be available at this index in the profile.
* @param[in] factory
*/
MS2_PUBLIC TextStream* text_stream_start(TextStream *stream, RtpProfile *profile, const char *rem_rtp_addr, int rem_rtp_port, const char *rem_rtcp_addr, int rem_rtcp_port, int payload_type);
MS2_PUBLIC TextStream* text_stream_start(TextStream *stream, RtpProfile *profile, const char *rem_rtp_addr, int rem_rtp_port, const char *rem_rtcp_addr, int rem_rtcp_port,
int payload_type);
/**
* Stops the text streaming thread and free everything
......
......@@ -28,6 +28,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "TargetConditionals.h"
#endif
#ifndef MS2_DEPRECATED
#if defined(_MSC_VER)
#define MS2_DEPRECATED __declspec(deprecated)
#else
#define MS2_DEPRECATED __attribute__ ((deprecated))
#endif
#endif
#define MS_UNUSED(x) ((void)(x))
#define ms_malloc ortp_malloc
......@@ -54,6 +61,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define ms_cond_broadcast ortp_cond_broadcast
#define ms_cond_destroy ortp_cond_destroy
#define MS_DEFAULT_MAX_PAYLOAD_SIZE 1440
#define MS2_INLINE ORTP_INLINE
#ifdef _WIN32
......@@ -89,7 +98,7 @@ static MS2_INLINE void ms_debug(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_DEBUG, fmt, args);
ortp_logv(ORTP_LOG_DOMAIN, ORTP_DEBUG, fmt, args);
va_end (args);
}
#else
......@@ -132,6 +141,7 @@ typedef struct _MSList MSList;
typedef int (*MSCompareFunc)(const void *a, const void *b);
typedef void (*MSIterateFunc)(void *a);
typedef void (*MSIterate2Func)(void *a, void *b);
typedef void (*MSIterate3Func)(void *a, void *b, void *c);
#ifdef __cplusplus
extern "C"{
......@@ -220,8 +230,11 @@ MS2_PUBLIC void ms_list_for_each(const MSList *list, MSIterateFunc iterate_func)
* @param list List object
* @param iterate_func Function to invoke on each element.
* @param user_data User data to pass to iterate_func function.
*
**/
MS2_PUBLIC void ms_list_for_each2(const MSList *list, MSIterate2Func iterate_func, void *user_data);
MS2_PUBLIC void ms_list_for_each3(const MSList *list, MSIterate3Func iterate_func, void *user_data, void *factory);
/** Finds and remove given element in list.
* @param list List in which element must be removed
......@@ -336,29 +349,33 @@ MS2_PUBLIC bool_t ms_tags_list_contains_tag(const MSList *list, const char *tag)
* Initialize the mediastreamer2 base library.
*
* This must be called once before calling any other API.
* @deprecated use ms_factory_new()
*/
MS2_PUBLIC void ms_base_init(void);
MS2_PUBLIC MS2_DEPRECATED void ms_base_init(void);
/**
* Initialize the mediastreamer2 VoIP library.
*
* This must be called one before calling any other API.
* @deprecated use ms_factory_new_with_voip().
*/
MS2_PUBLIC void ms_voip_init(void);
MS2_PUBLIC MS2_DEPRECATED void ms_voip_init(void);
/**
* Load the plugins from the default plugin directory.
*
* This is just a wrapper around ms_load_plugins().
* This must be called after ms_base_init() and after ms_voip_init().
* @deprecated use ms_factory_init_plugins(), or ms_factory_new_with_voip() that does it automatically.
*/
MS2_PUBLIC void ms_plugins_init(void);
MS2_PUBLIC MS2_DEPRECATED void ms_plugins_init(void);
/**
* Set the directory from where the plugins are to be loaded when calling ms_plugins_init().
* @param[in] path The path to the plugins directory.
* @deprecated use ms_factory_set_plugins_dir().
*/
MS2_PUBLIC void ms_set_plugins_dir(const char *path);
MS2_PUBLIC MS2_DEPRECATED void ms_set_plugins_dir(const char *path);
/**
* Load plugins from a specific directory.
......@@ -369,28 +386,32 @@ MS2_PUBLIC void ms_set_plugins_dir(const char *path);
*
* @param directory A directory where plugins library are available.
*
* Returns: >0 if successfull, 0 if not plugins loaded, -1 otherwise.
* @return >0 if successfull, 0 if not plugins loaded, -1 otherwise.
* @deprecated use ms_factory_load_plugins().
*/
MS2_PUBLIC int ms_load_plugins(const char *directory);
MS2_PUBLIC MS2_DEPRECATED int ms_load_plugins(const char *directory);
/**
* Release resource allocated in the mediastreamer2 base library.
*
* This must be called once before closing program.
* @deprecated use ms_factory_destroy().
*/
MS2_PUBLIC void ms_base_exit(void);
MS2_PUBLIC MS2_DEPRECATED void ms_base_exit(void);
/**
* Release resource allocated in the mediastreamer2 VoIP library.
*
* This must be called once before closing program.
* @deprecated use ms_factory_destroy().
*/
MS2_PUBLIC void ms_voip_exit(void);
MS2_PUBLIC MS2_DEPRECATED void ms_voip_exit(void);
/**
* Unload the plugins loaded by ms_plugins_init().
* @deprecated use ms_factory_destroy().
*/
MS2_PUBLIC void ms_plugins_exit(void);
MS2_PUBLIC MS2_DEPRECATED void ms_plugins_exit(void);
struct _MSSndCardDesc;
......@@ -405,11 +426,15 @@ MS2_PUBLIC void ms_usleep(uint64_t usec);
* The default value is 1440 computed as the standard internet MTU minus IPv6 header,
* UDP header and RTP header. As IPV4 header is smaller than IPv6 header, this
* value works for both.
*
* @deprecated use ms_factory_get_payload_max_size().
**/
MS2_PUBLIC int ms_get_payload_max_size(void);
MS2_PUBLIC MS2_DEPRECATED int ms_get_payload_max_size(void);
MS2_PUBLIC void ms_set_payload_max_size(int size);
/**
* Set the maximum payload size allowed.
* @deprecated use ms_factory_set_payload_max_size().
**/
MS2_PUBLIC MS2_DEPRECATED void ms_set_payload_max_size(int size);
/**
* Returns the network Max Transmission Unit to reach destination_host.
......@@ -421,21 +446,26 @@ MS2_PUBLIC int ms_discover_mtu(const char *destination_host);
/**
* Set mediastreamer default mtu, used to compute the default RTP max payload size.
* This function will call ms_set_payload_max_size(mtu-[ipv6 header size]).
* @deprecated use ms_factory_set_mtu()
**/
MS2_PUBLIC void ms_set_mtu(int mtu);
MS2_PUBLIC MS2_DEPRECATED void ms_set_mtu(int mtu);
/**
* Get mediastreamer default mtu, used to compute the default RTP max payload size.
* @deprecated use ms_factory_get_mtu().
**/
MS2_PUBLIC int ms_get_mtu(void);
MS2_PUBLIC MS2_DEPRECATED int ms_get_mtu(void);
/**
* Declare how many cpu (cores) are available on the platform
* @deprecated use ms_factory_set_cpu_count().
*/
MS2_PUBLIC void ms_set_cpu_count(unsigned int c);
MS2_PUBLIC MS2_DEPRECATED void ms_set_cpu_count(unsigned int c);
MS2_PUBLIC unsigned int ms_get_cpu_count(void);
/**
* @deprecated use ms_factory_get_cpu_count().
**/
MS2_PUBLIC MS2_DEPRECATED unsigned int ms_get_cpu_count(void);
/**
* Adds a new entry in the SoundDeviceDescription table
......
......@@ -75,9 +75,10 @@ extern "C" {
/**
* Creates a conference.
* @param params a MSAudioConferenceParams structure, containing conference parameters.
* @param factory a MSFactory structure, containing filters parameters
* @return a MSAudioConference object.
**/
MS2_PUBLIC MSAudioConference * ms_audio_conference_new(const MSAudioConferenceParams *params);
MS2_PUBLIC MSAudioConference * ms_audio_conference_new(const MSAudioConferenceParams *params, MSFactory *factory);
/**
* Gets conference's current parameters.
......@@ -175,8 +176,9 @@ MS2_PUBLIC void ms_audio_endpoint_release_from_stream(MSAudioEndpoint *obj);
/**
* Creates an audio endpoint (or virtual participant) to record the conference into a wav file.
* @param factory The factory used by the linphone core.
**/
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(void);
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(MSFactory* factory);
/**
* Start audio recording.
......
......@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define mseventqueue_h
#include <mediastreamer2/mscommon.h>
#include <mediastreamer2/msfactory.h>
typedef struct _MSEventQueue MSEventQueue;
......@@ -40,7 +41,7 @@ MS2_PUBLIC MSEventQueue *ms_event_queue_new(void);
* to the event queue.
*
**/
MS2_PUBLIC void ms_set_global_event_queue(MSEventQueue *q);
MS2_PUBLIC MS2_DEPRECATED void ms_set_global_event_queue(MSEventQueue *q);
/**
* Run callbacks associated to the events received.
......@@ -58,6 +59,6 @@ MS2_PUBLIC void ms_event_queue_skip(MSEventQueue *q);
/**
* Destroys an event queue.
**/
//MS2_PUBLIC MS2_DEPRECATED void ms_event_queue_destroy(MSEventQueue *q);
MS2_PUBLIC void ms_event_queue_destroy(MSEventQueue *q);
#endif
......@@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef msfactory_h
#define msfactory_h
#include "mediastreamer2/msfilter.h"
/*do not use these fields directly*/
struct _MSFactory{
MSList *desc_list;
......@@ -36,6 +40,9 @@ struct _MSFactory{
struct _MSEventQueue *evq;
int max_payload_size;
int mtu;
struct _MSSndCardManager* sndcardmanager;
struct _MSWebCamManager* wbcmanager;
void (*voip_uninit_func)(struct _MSFactory*);
bool_t statistics_enabled;
bool_t voip_initd;
};
......@@ -46,21 +53,34 @@ typedef struct _MSFactory MSFactory;
extern "C" {
#endif
#ifndef MS2_DEPRECATED
#if defined(_MSC_VER)
#define MS2_DEPRECATED __declspec(deprecated)
#else
#define MS2_DEPRECATED __attribute__ ((deprecated))
#endif
#endif
/**
* Create a mediastreamer2 factory. This is the root object that will create everything else from mediastreamer2.
**/
MS2_PUBLIC MSFactory *ms_factory_new(void);
/**
* Create a mediastreamer2 factory and initialize all voip related filter, card and webcam managers.
**/
MS2_PUBLIC MSFactory* ms_factory_new_with_voip(void);
/**
* Create the fallback factory (for compatibility with applications not using MSFactory to create ms2 object)
**/
MS2_PUBLIC MSFactory *ms_factory_create_fallback(void);
MS2_DEPRECATED MS2_PUBLIC MSFactory *ms_factory_create_fallback(void);
/**
* Used by the legacy functions before MSFactory was added.
* Do not use in an ap