Skip to content

Commit

Permalink
Merge branch 'OpenIPC:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
libc0607 authored May 28, 2024
2 parents 89655d1 + 1c03a1c commit 34266b9
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 698 deletions.
1 change: 0 additions & 1 deletion general/package/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ source "$BR2_EXTERNAL_GENERAL_PATH/package/libhv-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/libjpeg-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/libogg-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/libre-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/librem-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/libsrt-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/libsrtp-openipc/Config.in"
source "$BR2_EXTERNAL_GENERAL_PATH/package/libwebsockets-openipc/Config.in"
Expand Down
15 changes: 15 additions & 0 deletions general/package/baresip-openipc/0001-skip-audio-files.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3960973..3e3dd9e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -384,10 +384,3 @@ install(TARGETS baresip
NAMELINK_ONLY
COMPONENT Development
)
-
-file(GLOB SHARE_FILES "${PROJECT_SOURCE_DIR}/share/*")
-
-install(FILES ${SHARE_FILES}
- DESTINATION ${CMAKE_INSTALL_DATADIR}/baresip
- COMPONENT Applications
-)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/include/baresip.h b/include/baresip.h
index 2049ac74..a1b0501e 100644
index ab7b1b38..d33959d9 100644
--- a/include/baresip.h
+++ b/include/baresip.h
@@ -540,12 +540,15 @@ typedef int (auplay_alloc_h)(struct auplay_st **stp, const struct auplay *ap,
@@ -616,12 +616,15 @@ typedef int (auplay_alloc_h)(struct auplay_st **stp, const struct auplay *ap,
struct auplay_prm *prm, const char *device,
auplay_write_h *wh, void *arg);

Expand All @@ -14,21 +14,21 @@ index 2049ac74..a1b0501e 100644
const char *name;
struct list dev_list;
auplay_alloc_h *alloch;
+ auplay_send_h *asend;
+ auplay_send_h *asendh;
};

int auplay_register(struct auplay **pp, struct list *auplayl,
diff --git a/src/audio.c b/src/audio.c
index 67af6f0e..add06d6b 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -1035,6 +1035,9 @@ static int aurx_stream_decode(struct aurx *rx, bool marker,
rx->aubuf_started = true;
lock_rel(rx->lock);
diff --git a/src/aureceiver.c b/src/aureceiver.c
index 43ae2bd8..bc03f025 100644
--- a/src/aureceiver.c
+++ b/src/aureceiver.c
@@ -194,6 +194,9 @@ static int aurecv_push_aubuf(struct audio_recv *ar, const struct auframe *af)
re_atomic_rlx_set(&ar->stats.latency,
aubuf_cur_size(ar->aubuf) / bpms);

+ if (rx->ap->asend)
+ rx->ap->asend(af.sampv, num_bytes);
+ if (ar->ap->asendh)
+ ar->ap->asendh(af->sampv, af->sampc * 2);
+
out:
return err;
return 0;
}

3 changes: 0 additions & 3 deletions general/package/baresip-openipc/Config.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
config BR2_PACKAGE_BARESIP_OPENIPC
bool "baresip-openipc"
default n
select BR2_PACKAGE_LIBRE_OPENIPC
select BR2_PACKAGE_LIBREM_OPENIPC
help
Baresip is a portable and modular SIP User-Agent with audio
and video support. Copyright (c) 2010 - 2022 Alfred E. Heggestad
Expand Down
69 changes: 7 additions & 62 deletions general/package/baresip-openipc/baresip-openipc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,13 @@
#############################################################

BARESIP_OPENIPC_SITE = $(call github,baresip,baresip,$(BARESIP_OPENIPC_VERSION))
BARESIP_OPENIPC_VERSION = v2.0.1
BARESIP_OPENIPC_VERSION = v3.12.0

BARESIP_OPENIPC_DEPENDENCIES = libre-openipc librem-openipc zlib
BARESIP_OPENIPC_DEPENDENCIES = libre-openipc

BARESIP_OPENIPC_MAKE_ENV = \
$(TARGET_CONFIGURE_OPTS) \
SYSROOT=$(STAGING_DIR)/usr \
SYSROOT_LOCAL=$(STAGING_DIR)/usr \
LD="$(TARGET_CC)" \
LFLAGS="$(TARGET_LDFLAGS)"
BARESIP_OPENIPC_CONF_OPTS = \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -s" \
-DUSE_MBEDTLS=ON

BARESIP_OPENIPC_MAKE_ARGS = \
LIBRE_MK="$(STAGING_DIR)/usr/share/re/re.mk" \
LIBRE_INC="$(STAGING_DIR)/usr/include/re" \
LIBRE_SO="$(STAGING_DIR)/usr/lib" \
LIBREM_MK="$(STAGING_DIR)/usr/share/rem/rem.mk" \
LIBREM_INC="$(STAGING_DIR)/usr/include/rem" \
LIBREM_SO="$(STAGING_DIR)/usr/lib"

ifeq ($(BR2_PACKAGE_ALSA_LIB),y)
BARESIP_OPENIPC_DEPENDENCIES += alsa-lib
endif

ifeq ($(BR2_PACKAGE_FFMPEG_SWSCALE),y)
BARESIP_OPENIPC_DEPENDENCIES += ffmpeg
BARESIP_OPENIPC_MAKE_ENV += \
CFLAGS+=-DCODEC_TYPE_VIDEO=AVMEDIA_TYPE_VIDEO
endif

ifeq ($(BR2_PACKAGE_LIBSNDFILE),y)
BARESIP_OPENIPC_DEPENDENCIES += libsndfile
endif

ifeq ($(BR2_PACKAGE_SPEEX),y)
BARESIP_OPENIPC_DEPENDENCIES += speex
endif

ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
BARESIP_OPENIPC_DEPENDENCIES += util-linux
endif

ifeq ($(BR2_PACKAGE_XORG7),y)
BARESIP_OPENIPC_DEPENDENCIES += xlib_libXext
endif

define BARESIP_OPENIPC_BUILD_CMDS
$(BARESIP_OPENIPC_MAKE_ENV) $(MAKE) $(BARESIP_OPENIPC_MAKE_ARGS) -C $(@D) all
endef

define BARESIP_OPENIPC_CLEAN_CMDS
$(BARESIP_OPENIPC_MAKE_ENV) $(MAKE) $(BARESIP_OPENIPC_MAKE_ARGS) -C $(@D) clean
endef

define BARESIP_OPENIPC_INSTALL_TARGET_CMDS
$(BARESIP_OPENIPC_MAKE_ENV) DESTDIR=$(TARGET_DIR) $(MAKE) $(BARESIP_OPENIPC_MAKE_ARGS) -C $(@D) install
endef

define BARESIP_OPENIPC_UNINSTALL_TARGET_CMDS
$(RM) $(TARGET_DIR)/usr/bin/baresip
$(RM) -r $(TARGET_DIR)/usr/lib/baresip
$(RM) -r $(TARGET_DIR)/usr/share/baresip
endef

$(eval $(generic-package))
$(eval $(host-generic-package))
$(eval $(cmake-package))
65 changes: 65 additions & 0 deletions general/package/libre-openipc/0001-set-mbed-symbols.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/cmake/re-config.cmake b/cmake/re-config.cmake
index 426a79d..ddbeb1a 100644
--- a/cmake/re-config.cmake
+++ b/cmake/re-config.cmake
@@ -235,6 +235,10 @@ if(USE_OPENSSL)
list(APPEND RE_LIBS OpenSSL::SSL OpenSSL::Crypto)
endif()

+if(USE_MBEDTLS)
+ list(APPEND RE_LIBS mbedtls)
+endif()
+
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
list(APPEND RE_LIBS
"-framework SystemConfiguration" "-framework CoreFoundation"
diff --git a/src/md5/wrap.c b/src/md5/wrap.c
index 6b8168b..e29bb96 100644
--- a/src/md5/wrap.c
+++ b/src/md5/wrap.c
@@ -60,12 +60,7 @@ void md5(const uint8_t *d, size_t n, uint8_t *md)
CryptDestroyHash(hash);
CryptReleaseContext(context, 0);
#elif defined (MBEDTLS_MD_C)
- int err;
-
- err = mbedtls_md5(d, n, md);
- if (err)
- DEBUG_WARNING("mbedtls_md5: %s\n",
- mbedtls_high_level_strerr(err));
+ mbedtls_md5(d, n, md);
#else
#error missing MD5 backend
#endif
diff --git a/src/sha/wrap.c b/src/sha/wrap.c
index 59ec123..f2a7ea2 100644
--- a/src/sha/wrap.c
+++ b/src/sha/wrap.c
@@ -61,12 +61,7 @@ void sha1(const uint8_t *d, size_t n, uint8_t *md)
#elif defined (WIN32)
compute_hash(CALG_SHA1, d, n, md, SHA1_DIGEST_SIZE);
#elif defined (MBEDTLS_MD_C)
- int err;
-
- err = mbedtls_sha1(d, n, md);
- if (err)
- DEBUG_WARNING("mbedtls_sha1: %s\n",
- mbedtls_high_level_strerr(err));
+ mbedtls_sha1(d, n, md);
#else
(void)d;
(void)n;
@@ -92,12 +87,7 @@ void sha256(const uint8_t *d, size_t n, uint8_t *md)
#elif defined (WIN32)
compute_hash(CALG_SHA_256, d, n, md, SHA256_DIGEST_SIZE);
#elif defined (MBEDTLS_MD_C)
- int err;
-
- err = mbedtls_sha256(d, n, md, 0);
- if (err)
- DEBUG_WARNING("mbedtls_sha256: %s\n",
- mbedtls_high_level_strerr(err));
+ mbedtls_sha256(d, n, md, 0);
#else
(void)d;
(void)n;
Loading

0 comments on commit 34266b9

Please sign in to comment.