Merge pull request #693 from dhewg/asterisk-opus

asterisk: add opus read and write support
This commit is contained in:
micmac1 2021-11-03 18:16:03 +01:00 committed by GitHub
commit d337eeadfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 16 deletions

View file

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=asterisk-opus PKG_NAME:=asterisk-opus
PKG_RELEASE:=1 PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_URL:=https://github.com/traud/asterisk-opus.git PKG_SOURCE_URL:=https://github.com/traud/asterisk-opus.git
PKG_SOURCE_DATE:=2017-10-09 PKG_SOURCE_DATE:=2021-11-01
PKG_SOURCE_VERSION:=83e1b458c77e0e287adeca494eeb79edb077b0ff PKG_SOURCE_VERSION:=20522fbcd3fdf6f0adb20602d096d14cd69055e8
PKG_MIRROR_HASH:=c71b859db7518cdafff1650e629c5901b290fe68f8af54ef1afd57bc9f15b122 PKG_MIRROR_HASH:=e14dc42b0e5f4720e3f028e0b426f4e660bf315a103a015820ca3697e1fe9985
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
@ -23,18 +23,21 @@ PKG_MAINTAINER:=Jiri Slachta <jiri@slachta.eu>
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS += \ TARGET_CFLAGS += \
-DAST_MODULE_SELF_SYM=__internal_codec_opus_open_source_self \
$(FPIC) $(FPIC)
define Package/asterisk-codec-opus define Package/asterisk-opus/Default
SUBMENU:=Telephony SUBMENU:=Telephony
SECTION:=net SECTION:=net
CATEGORY:=Network CATEGORY:=Network
TITLE:=Opus codec support
URL:=https://github.com/traud/asterisk-opus URL:=https://github.com/traud/asterisk-opus
DEPENDS:=asterisk +libopus DEPENDS:=asterisk +libopus
endef endef
define Package/asterisk-codec-opus
$(call Package/asterisk-opus/Default)
TITLE:=Opus codec support
endef
define Package/asterisk-codec-opus/description define Package/asterisk-codec-opus/description
Opus is the default audio codec in WebRTC. WebRTC is available in Opus is the default audio codec in WebRTC. WebRTC is available in
Asterisk via SIP over WebSockets (WSS). Nevertheless, Opus can be used Asterisk via SIP over WebSockets (WSS). Nevertheless, Opus can be used
@ -55,7 +58,24 @@ define Package/asterisk-codec-opus/install
$(1)/usr/lib/asterisk/modules $(1)/usr/lib/asterisk/modules
endef endef
define Package/asterisk-format-ogg-opus
$(call Package/asterisk-opus/Default)
TITLE:=OGG/Opus audio support
DEPENDS+=+libopusfile +libopusenc
endef
define Package/asterisk-format-ogg-opus/description
Reading and writing audio files in the OGG/Opus format.
endef
define Package/asterisk-format-ogg-opus/install
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
$(INSTALL_BIN) $(PKG_BUILD_DIR)/formats/format_ogg_opus_open_source.so \
$(1)/usr/lib/asterisk/modules
endef
define Build/Configure define Build/Configure
endef endef
$(eval $(call BuildPackage,asterisk-codec-opus)) $(eval $(call BuildPackage,asterisk-codec-opus))
$(eval $(call BuildPackage,asterisk-format-ogg-opus))

View file

@ -1,23 +1,35 @@
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -3,17 +3,17 @@ exec_prefix=$(prefix) @@ -5,18 +5,18 @@ libdir=$(exec_prefix)/lib
libdir=$(exec_prefix)/lib # build with `make OPUSENC=0` to disable rewrite support using libopusenc
OPUSENC?=1
CC=gcc -CFLAGS=-pthread -D_FORTIFY_SOURCE=2 -fPIC
-CFLAGS=-pthread -g3 -O3 -D_FORTIFY_SOURCE=2 -fPIC -DEBUG=-g3
+CFLAGS+=-pthread -OPTIMIZE=-O3
+CFLAGS+=-Wall -pthread
+DEBUG=
+OPTIMIZE=
CPPFLAGS= CPPFLAGS=
DEFS= DEFS=
INSTALL=/usr/bin/install -c INSTALL=/usr/bin/install -c
-LDFLAGS=-shared -pthread -Wl,--warn-common -LDFLAGS=-pthread -Wl,--warn-common
+LDFLAGS+=-shared -pthread -Wl,--warn-common +LDFLAGS+=-pthread -Wl,--warn-common
LIBS= LIBS=
MKDIR_P=/bin/mkdir -p
SHELL=/bin/sh SHELL=/bin/sh
ASTMODDIR=$(libdir)/asterisk/modules ASTMODDIR=$(libdir)/asterisk/modules
-MODULES=codec_opus_open_source format_ogg_opus_open_source format_vp8 res_format_attr_opus -MODULES=codec_opus_open_source format_ogg_opus_open_source format_vp8 res_format_attr_opus
+MODULES=codec_opus_open_source +MODULES=codec_opus_open_source format_ogg_opus_open_source
.SUFFIXES: .c .so .SUFFIXES: .c .so
@@ -38,7 +38,7 @@ codec_opus_open_source: DEFS+=-DAST_MODU
-DAST_MODULE_SELF_SYM=__internal_codec_opus_open_source_self
codec_opus_open_source: codecs/codec_opus_open_source.so
-format_ogg_opus_open_source: CPATH+=-I/usr/include/opus
+format_ogg_opus_open_source: CPATH+=-I$(STAGING_DIR)/usr/include/opus
format_ogg_opus_open_source: LIBS+=-lopus -lopusfile
format_ogg_opus_open_source: DEFS+=-DAST_MODULE=\"format_ogg_opus_open_source\" \
-DAST_MODULE_SELF_SYM=__internal_format_ogg_opus_open_source_self