Skip to content

Commit

Permalink
Merge branch 'pjsip:master' into Feature/siprec-extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sorooshm78 authored Dec 22, 2024
2 parents ff5be8b + dc3bb71 commit f6cb5d7
Show file tree
Hide file tree
Showing 14 changed files with 244 additions and 53 deletions.
5 changes: 3 additions & 2 deletions aconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -7064,7 +7064,7 @@ if ac_fn_c_try_link "$LINENO"
then :

CFLAGS="$CFLAGS -DPJNATH_HAS_UPNP=1 $UPNP_CFLAGS"
LDFLAGS="$LDFLAGS $UPNP_LDFLAGS"
LDFLAGS="$LDFLAGS $UPNP_LDFLAGS $UPNP_LIBS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }

Expand Down Expand Up @@ -8566,6 +8566,7 @@ printf "%s\n" "not found" >&6; }
ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags"
ac_sdl_ldflags=`$SDL_CONFIG --libs`
ac_sdl_ldflags=`echo "${ac_sdl_ldflags}" | sed -e 's/-mwindows//g'`
LIBS="$LIBS $ac_sdl_ldflags"
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Unsupported SDL version" >&5
printf "%s\n" "Unsupported SDL version" >&6; }
Expand Down Expand Up @@ -9230,7 +9231,7 @@ if ac_fn_c_try_link "$LINENO"
then :

ac_vpx_cflags="-DPJMEDIA_HAS_VPX_CODEC=1 $VPX_CFLAGS"
ac_vpx_ldflags="$VPX_LDFLAGS"
ac_vpx_ldflags="$VPX_LDFLAGS $VPX_LIBS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }

Expand Down
5 changes: 3 additions & 2 deletions aconfigure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ AC_ARG_ENABLE(upnp,
],
[
CFLAGS="$CFLAGS -DPJNATH_HAS_UPNP=1 $UPNP_CFLAGS"
LDFLAGS="$LDFLAGS $UPNP_LDFLAGS"
LDFLAGS="$LDFLAGS $UPNP_LDFLAGS $UPNP_LIBS"
AC_MSG_RESULT(yes)
],
[
Expand Down Expand Up @@ -1546,6 +1546,7 @@ AC_ARG_ENABLE(sdl,
ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags"
ac_sdl_ldflags=`$SDL_CONFIG --libs`
ac_sdl_ldflags=`echo "${ac_sdl_ldflags}" | sed -e 's/-mwindows//g'`
LIBS="$LIBS $ac_sdl_ldflags"
else
AC_MSG_RESULT([Unsupported SDL version])
fi
Expand Down Expand Up @@ -1805,7 +1806,7 @@ AC_ARG_ENABLE(vpx,
],
[
ac_vpx_cflags="-DPJMEDIA_HAS_VPX_CODEC=1 $VPX_CFLAGS"
ac_vpx_ldflags="$VPX_LDFLAGS"
ac_vpx_ldflags="$VPX_LDFLAGS $VPX_LIBS"
AC_MSG_RESULT(yes)
],
[
Expand Down
1 change: 1 addition & 0 deletions build.mak.in
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export APP_LDLIBS := $(PJSUA_LIB_LDLIB) \
$(PJLIB_LDLIB) \
@LIBS@
export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \
-lstdc++ \
$(APP_LDLIBS)

# Here are the variables to use if application is using the library
Expand Down
6 changes: 3 additions & 3 deletions build/vs/pjproject-vs14-common-config.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<Choose>
<When Condition="'$(API_Family)'=='WinDesktop'">
<PropertyGroup>
<BuildToolset>v140</BuildToolset>
<BuildToolset>v143</BuildToolset>
<PreprocessorDef Condition="'$(Platform)'=='Win32'">WIN32;PJ_WIN32=1;PJ_M_I386=1;</PreprocessorDef>
<PreprocessorDef Condition="'$(Platform)'=='x64'">WIN64;PJ_WIN64=1;PJ_M_X86_64=1;</PreprocessorDef>
<PreprocessorDef Condition="'$(Platform)'=='ARM64'">PJ_M_ARM64=1;</PreprocessorDef>
<PreprocessorDef Condition="'$(Platform)'=='ARM64'">PJ_M_ARM64=1;</PreprocessorDef>
</PropertyGroup>
</When>
<When Condition="'$(API_Family)'=='UWP'">
<PropertyGroup>
<BuildToolset>v140</BuildToolset>
<BuildToolset>v143</BuildToolset>
<PreprocessorDef>PJ_WIN32_UWP;UNICODE;_UNICODE;</PreprocessorDef>
<PreprocessorDef Condition="'$(Platform)'=='ARM'">$(PreprocessorDef);PJ_M_ARMV7=1;</PreprocessorDef>
<PlatformVersion>10.0.10586.0</PlatformVersion>
Expand Down
26 changes: 26 additions & 0 deletions pjlib/build/pjlib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,32 @@
</ClCompile>
<ClCompile Include="..\src\pj\os_error_win32.c" />
<ClCompile Include="..\src\pj\os_info.c" />
<ClCompile Include="..\src\pj\os_rwmutex.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Static|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Dynamic|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Static|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\src\pj\os_timestamp_common.c" />
<ClCompile Include="..\src\pj\os_timestamp_linux.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Dynamic|Win32'">true</ExcludedFromBuild>
Expand Down
6 changes: 6 additions & 0 deletions pjlib/build/pjlib.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@
<ClCompile Include="..\src\pj\ssl_sock_imp_common.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pj\ssl_sock_schannel.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pj\os_rwmutex.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\pj\ioqueue_common_abs.h">
Expand Down
2 changes: 1 addition & 1 deletion pjlib/include/pj/config_site_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#define PJMEDIA_CODEC_L16_HAS_48KHZ_STEREO 1
#define PJMEDIA_HAS_G7221_CODEC 1
#define PJMEDIA_HAS_G722_CODEC 1
#define PJ_EXCLUDE_BENCHMARK_TESTS 1
#define PJ_EXCLUDE_BENCHMARK_TESTS 0
21 changes: 16 additions & 5 deletions pjmedia/src/pjmedia-audiodev/oboe_dev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#include <android/log.h>
#include <oboe/Oboe.h>

/* Setting of maximum number of consecutive stream restart attempts. */
#define MAX_RESTART 3

/* Device info */
typedef struct aud_dev_info
{
Expand Down Expand Up @@ -416,7 +419,6 @@ static pj_status_t oboe_refresh(pjmedia_aud_dev_factory *ff)

f->dev_count++;

on_skip_dev:
jni_env->DeleteLocalRef(jdev_info);
}

Expand Down Expand Up @@ -530,7 +532,7 @@ class MyOboeEngine : oboe::AudioStreamDataCallback,
public:
MyOboeEngine(struct oboe_aud_stream *stream_, pjmedia_dir dir_)
: stream(stream_), dir(dir_), oboe_stream(NULL), dir_st(NULL),
thread(NULL), thread_quit(PJ_TRUE), queue(NULL),
thread(NULL), thread_quit(PJ_TRUE), nrestart(0), queue(NULL),
err_thread_registered(false), mutex(NULL)
{
pj_assert(dir == PJMEDIA_DIR_CAPTURE || dir == PJMEDIA_DIR_PLAYBACK);
Expand Down Expand Up @@ -745,6 +747,7 @@ class MyOboeEngine : oboe::AudioStreamDataCallback,
}
}

this->nrestart = 0;
sem_post(&sem);

return (thread_quit? oboe::DataCallbackResult::Stop :
Expand Down Expand Up @@ -775,12 +778,19 @@ class MyOboeEngine : oboe::AudioStreamDataCallback,
pj_status_t status;

PJ_LOG(3,(THIS_FILE,
"Oboe stream %s error (%d/%s), "
"trying to restart stream..",
"Oboe stream %s error (%d/%s)",
dir_st, result, oboe::convertToText(result)));

Stop();
status = Start();

if (nrestart < MAX_RESTART) {
++nrestart;
PJ_LOG(3, (THIS_FILE, "Trying to restart Oboe %s stream #%d",
dir_st, nrestart));
status = Start();
} else {
status = PJMEDIA_EAUD_SYSERR;
}

if (status != PJ_SUCCESS) {
pjmedia_event e;
Expand Down Expand Up @@ -930,6 +940,7 @@ class MyOboeEngine : oboe::AudioStreamDataCallback,
const char *dir_st;
pj_thread_t *thread;
volatile pj_bool_t thread_quit;
unsigned nrestart;
sem_t sem;
pj_atomic_queue_t *queue;
pj_timestamp ts;
Expand Down
31 changes: 7 additions & 24 deletions pjmedia/src/pjmedia/echo_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,6 @@ static struct ec_operations speex_aec_op =
};
#endif


/*
* IPP AEC prototypes
*/
#if defined(PJMEDIA_HAS_INTEL_IPP_AEC) && PJMEDIA_HAS_INTEL_IPP_AEC!=0
static struct ec_operations ipp_aec_op =
{
"IPP AEC",
&ipp_aec_create,
&ipp_aec_destroy,
&ipp_aec_reset,
&ipp_aec_cancel_echo
};
#endif

/*
* WebRTC AEC prototypes
*/
Expand Down Expand Up @@ -170,6 +155,7 @@ PJ_DEF(void) pjmedia_echo_stat_default(pjmedia_echo_stat *stat)
stat->return_loss_enh = (double)PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
stat->std = PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
stat->frac_delay = (float)PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
stat->learning = PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
stat->duration = PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
stat->tail = PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
stat->min_factor = PJMEDIA_ECHO_STAT_NOT_SPECIFIED;
Expand Down Expand Up @@ -229,14 +215,6 @@ PJ_DEF(pj_status_t) pjmedia_echo_create2(pj_pool_t *pool,
ec->op = &speex_aec_op;
#endif

#if defined(PJMEDIA_HAS_INTEL_IPP_AEC) && PJMEDIA_HAS_INTEL_IPP_AEC!=0
} else if ((options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_IPP ||
(options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_DEFAULT)
{
ec->op = &ipp_aec_op;

#endif

#if defined(PJMEDIA_HAS_WEBRTC_AEC) && PJMEDIA_HAS_WEBRTC_AEC!=0
} else if ((options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_WEBRTC ||
(options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_DEFAULT)
Expand All @@ -251,8 +229,13 @@ PJ_DEF(pj_status_t) pjmedia_echo_create2(pj_pool_t *pool,
ec->op = &webrtc_aec3_op;
#endif

} else {
} else if ((options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_SIMPLE ||
(options & PJMEDIA_ECHO_ALGO_MASK) == PJMEDIA_ECHO_DEFAULT)
{
ec->op = &echo_supp_op;

} else {
return PJ_ENOTSUP;
}

/* Completeness check for EC operation playback and capture, they must
Expand Down
11 changes: 10 additions & 1 deletion pjmedia/src/pjmedia/echo_webrtc_aec3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ PJ_DEF(pj_status_t) webrtc_aec3_create(pj_pool_t *pool,
webrtc_ec *echo;

*p_echo = NULL;


#if WEBRTC_LINUX == 1 && defined(WEBRTC_ARCH_ARM_V7)
/* Workaround to fix alignment trap issue on Linux ARMv7 machine. */
echo = new webrtc_ec();
#else
echo = PJ_POOL_ZALLOC_T(pool, webrtc_ec);
#endif
PJ_ASSERT_RETURN(echo != NULL, PJ_ENOMEM);

if (clock_rate != 16000 && clock_rate != 32000 && clock_rate != 48000) {
Expand Down Expand Up @@ -152,6 +157,10 @@ PJ_DEF(pj_status_t) webrtc_aec3_destroy(void *state )
echo->rend_buf = NULL;
}

#if WEBRTC_LINUX == 1 && defined(WEBRTC_ARCH_ARM_V7)
delete echo;
#endif

return PJ_SUCCESS;
}

Expand Down
4 changes: 2 additions & 2 deletions pjmedia/src/test/mips_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2388,8 +2388,8 @@ static pj_timestamp run_entry(unsigned clock_rate, struct test_entry *e)

if (e->custom_deinit)
e->custom_deinit(e);

pjmedia_port_destroy(port);
else
pjmedia_port_destroy(port);
pj_pool_release(pool);

return t1;
Expand Down
20 changes: 10 additions & 10 deletions pjproject-vs14.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31624.102
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1DFF1CF3-DBD7-4DA4-A36D-663D695EB678}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -121,10 +121,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimplePjsua2CS", "pjsip-apps\src\swig\csharp\sample\SimplePjsua2CS\SimplePjsua2CS.csproj", "{3DCDD02D-C3CF-40EB-A66C-F7C2DAD93FD9}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{207e7bd4-7b11-4a40-ba3a-cc627762a7b6}*SharedItemsImports = 4
pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{45d41acc-2c3c-43d2-bc10-02aa73ffc7c7}*SharedItemsImports = 9
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Expand Down Expand Up @@ -1571,8 +1567,8 @@ Global
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|ARM.ActiveCfg = Debug|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|ARM64.ActiveCfg = Debug|ARM64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|ARM64.Build.0 = Debug|ARM64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Win32.ActiveCfg = Debug|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Win32.Build.0 = Debug|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Win32.ActiveCfg = Debug-Dynamic|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|Win32.Build.0 = Debug-Dynamic|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|x64.ActiveCfg = Debug|x64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Dynamic|x64.Build.0 = Debug|x64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Debug-Static|Any CPU.ActiveCfg = Release|x64
Expand All @@ -1597,8 +1593,8 @@ Global
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|ARM.ActiveCfg = Release|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|ARM64.ActiveCfg = Release|ARM64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|ARM64.Build.0 = Release|ARM64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Win32.ActiveCfg = Release|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Win32.Build.0 = Release|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Win32.ActiveCfg = Release-Dynamic|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|Win32.Build.0 = Release-Dynamic|Win32
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|x64.ActiveCfg = Release|x64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Dynamic|x64.Build.0 = Release|x64
{5E507EA2-CB39-47CA-BD39-49EB58D7A0BB}.Release-Static|Any CPU.ActiveCfg = Release|x64
Expand Down Expand Up @@ -2525,4 +2521,8 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9D1363FE-B481-479E-82A2-290F6C4DB91B}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{207e7bd4-7b11-4a40-ba3a-cc627762a7b6}*SharedItemsImports = 4
pjsip-apps\src\pjsua\winrt\cli\comp\pjsua_cli_shared_comp.vcxitems*{45d41acc-2c3c-43d2-bc10-02aa73ffc7c7}*SharedItemsImports = 9
EndGlobalSection
EndGlobal
Loading

0 comments on commit f6cb5d7

Please sign in to comment.