asterisk-opus: enable format_ogg_opus_open_source 693/head
authorAndre Heider <a.heider@gmail.com>
Fri, 21 May 2021 07:17:35 +0000 (09:17 +0200)
committerAndre Heider <a.heider@gmail.com>
Wed, 3 Nov 2021 04:40:03 +0000 (05:40 +0100)
This enables reading and rewriting ogg/opus files.

Signed-off-by: Andre Heider <a.heider@gmail.com>
net/asterisk-opus/Makefile
net/asterisk-opus/patches/01-Makefile.patch

index 90de6e15e398f6cf5b37f7b95313a988b9a6f214..541bc0f925f303732185330ae9a60fb81767f3f5 100644 (file)
@@ -25,15 +25,19 @@ include $(INCLUDE_DIR)/package.mk
 TARGET_CFLAGS += \
        $(FPIC)
 
-define Package/asterisk-codec-opus
+define Package/asterisk-opus/Default
   SUBMENU:=Telephony
   SECTION:=net
   CATEGORY:=Network
-  TITLE:=Opus codec support
   URL:=https://github.com/traud/asterisk-opus
   DEPENDS:=asterisk +libopus
 endef
 
+define Package/asterisk-codec-opus
+$(call Package/asterisk-opus/Default)
+  TITLE:=Opus codec support
+endef
+
 define Package/asterisk-codec-opus/description
   Opus is the default audio codec in WebRTC. WebRTC is available in
   Asterisk via SIP over WebSockets (WSS). Nevertheless, Opus can be used
@@ -54,7 +58,24 @@ define Package/asterisk-codec-opus/install
                $(1)/usr/lib/asterisk/modules
 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
 endef
 
 $(eval $(call BuildPackage,asterisk-codec-opus))
+$(eval $(call BuildPackage,asterisk-format-ogg-opus))
index e7f34c46ed91f9dc540685c0aeda3bf3c370e213..e74f0a9b5b16d45666c90a07afbe3d78a930e3b1 100644 (file)
  
  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
++MODULES=codec_opus_open_source format_ogg_opus_open_source
  
  .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