Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2018 18:22:06 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r481919 - in head/audio: . webrtc-audio-processing webrtc-audio-processing/files
Message-ID:  <201810121822.w9CIM6mp086735@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Oct 12 18:22:06 2018
New Revision: 481919
URL: https://svnweb.freebsd.org/changeset/ports/481919

Log:
  audio/webrtc-audio-processing: add new port
  
  Audio processing routines extracted from WebRTC project into a
  standalone library. It provides the following features:
  
  - Acoustic echo cancellation
  - Acoustic echo control for mobile
  - Automatic gain control
  - High-pass filter
  - Level estimator
  - Noise suppression
  - Voice activity detection
  
  https://freedesktop.org/software/pulseaudio/webrtc-audio-processing/

Added:
  head/audio/webrtc-audio-processing/
  head/audio/webrtc-audio-processing/Makefile   (contents, props changed)
  head/audio/webrtc-audio-processing/distinfo   (contents, props changed)
  head/audio/webrtc-audio-processing/files/
  head/audio/webrtc-audio-processing/files/patch-configure.ac   (contents, props changed)
  head/audio/webrtc-audio-processing/files/patch-webrtc_base_checks.cc   (contents, props changed)
  head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc   (contents, props changed)
  head/audio/webrtc-audio-processing/files/patch-webrtc_base_stringutils.h   (contents, props changed)
  head/audio/webrtc-audio-processing/files/patch-webrtc_system__wrappers_source_condition__variable.cc   (contents, props changed)
  head/audio/webrtc-audio-processing/pkg-descr   (contents, props changed)
  head/audio/webrtc-audio-processing/pkg-plist   (contents, props changed)
Modified:
  head/audio/Makefile   (contents, props changed)

Modified: head/audio/Makefile
==============================================================================
--- head/audio/Makefile	Fri Oct 12 18:21:32 2018	(r481918)
+++ head/audio/Makefile	Fri Oct 12 18:22:06 2018	(r481919)
@@ -869,6 +869,7 @@
     SUBDIR += waveplay
     SUBDIR += wavpack
     SUBDIR += wavplay
+    SUBDIR += webrtc-audio-processing
     SUBDIR += whysynth
     SUBDIR += wildmidi
     SUBDIR += wmalbum

Added: head/audio/webrtc-audio-processing/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/Makefile	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+PORTNAME=	webrtc-audio-processing
+PORTVERSION=	0.3.1
+CATEGORIES=	audio
+MASTER_SITES=	https://freedesktop.org/software/pulseaudio/${PORTNAME}/
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	AudioProcessing module from WebRTC project
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+USES=		autoreconf compiler:c++11-lib libtool pkgconfig tar:xz
+USE_LDCONFIG=	yes
+GNU_CONFIGURE=	yes
+
+.include <bsd.port.mk>

Added: head/audio/webrtc-audio-processing/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/distinfo	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1532354746
+SHA256 (webrtc-audio-processing-0.3.1.tar.xz) = a0fdd938fd85272d67e81572c5a4d9e200a0c104753cb3c209ded175ce3c5dbf
+SIZE (webrtc-audio-processing-0.3.1.tar.xz) = 695920

Added: head/audio/webrtc-audio-processing/files/patch-configure.ac
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/files/patch-configure.ac	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,18 @@
+- Add WEBRTC_BSD as it's closer to WEBRTC_LINUX than WEBRTC_MAC
+
+--- configure.ac.orig	2018-07-23 14:02:57 UTC
++++ configure.ac
+@@ -63,6 +63,13 @@ AS_CASE(["${host}"],
+          OS_LDFLAGS="-lrt -lpthread"
+          HAVE_POSIX=1
+         ],
++    [*-*dragonfly*|*-*bsd*],
++        [
++         OS_CFLAGS="-DWEBRTC_BSD -DWEBRTC_THREAD_RR"
++         PLATFORM_CFLAGS="-DWEBRTC_POSIX"
++         OS_LDFLAGS="-lpthread"
++         HAVE_POSIX=1
++        ],
+     [*-*darwin*],
+         [
+          OS_CFLAGS="-DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"

Added: head/audio/webrtc-audio-processing/files/patch-webrtc_base_checks.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/files/patch-webrtc_base_checks.cc	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,70 @@
+- Drop unnecessary dependency on libexecinfo for GCC build
+  https://chromium.googlesource.com/external/webrtc/+/7c4dedade158%5E!/
+
+--- webrtc/base/checks.cc.orig	2018-07-23 14:02:57 UTC
++++ webrtc/base/checks.cc
+@@ -11,16 +11,10 @@
+ // Most of this was borrowed (with minor modifications) from V8's and Chromium's
+ // src/base/logging.cc.
+ 
+-// Use the C++ version to provide __GLIBCXX__.
+ #include <cstdarg>
+ #include <cstdio>
+ #include <cstdlib>
+ 
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+-#include <cxxabi.h>
+-#include <execinfo.h>
+-#endif
+-
+ #if defined(WEBRTC_ANDROID)
+ #define LOG_TAG "rtc"
+ #include <android/log.h>  // NOLINT
+@@ -51,39 +45,6 @@ void PrintError(const char* format, ...) {
+   va_end(args);
+ }
+ 
+-// TODO(ajm): This works on Mac (although the parsing fails) but I don't seem
+-// to get usable symbols on Linux. This is copied from V8. Chromium has a more
+-// advanced stace trace system; also more difficult to copy.
+-void DumpBacktrace() {
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
+-  void* trace[100];
+-  int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
+-  char** symbols = backtrace_symbols(trace, size);
+-  PrintError("\n==== C stack trace ===============================\n\n");
+-  if (size == 0) {
+-    PrintError("(empty)\n");
+-  } else if (symbols == NULL) {
+-    PrintError("(no symbols)\n");
+-  } else {
+-    for (int i = 1; i < size; ++i) {
+-      char mangled[201];
+-      if (sscanf(symbols[i], "%*[^(]%*[(]%200[^)+]", mangled) == 1) {  // NOLINT
+-        PrintError("%2d: ", i);
+-        int status;
+-        size_t length;
+-        char* demangled = abi::__cxa_demangle(mangled, NULL, &length, &status);
+-        PrintError("%s\n", demangled != NULL ? demangled : mangled);
+-        free(demangled);
+-      } else {
+-        // If parsing failed, at least print the unparsed symbol.
+-        PrintError("%s\n", symbols[i]);
+-      }
+-    }
+-  }
+-  free(symbols);
+-#endif
+-}
+-
+ FatalMessage::FatalMessage(const char* file, int line) {
+   Init(file, line);
+ }
+@@ -99,7 +60,6 @@ NO_RETURN FatalMessage::~FatalMessage() {
+   fflush(stderr);
+   stream_ << std::endl << "#" << std::endl;
+   PrintError(stream_.str().c_str());
+-  DumpBacktrace();
+   fflush(stderr);
+   abort();
+ }

Added: head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,48 @@
+- Implement CurrentThreadId() using global thread ID
+- Implement SetCurrentThreadName()
+
+--- webrtc/base/platform_thread.cc.orig	2018-07-23 14:02:57 UTC
++++ webrtc/base/platform_thread.cc
+@@ -19,6 +19,12 @@
+ #include <sys/syscall.h>
+ #endif
+ 
++#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) // WEBRTC_BSD
++#include <pthread_np.h>
++#elif defined(__NetBSD__) // WEBRTC_BSD
++#include <lwp.h>
++#endif
++
+ namespace rtc {
+ 
+ PlatformThreadId CurrentThreadId() {
+@@ -32,9 +38,17 @@ PlatformThreadId CurrentThreadId() {
+   ret =  syscall(__NR_gettid);
+ #elif defined(WEBRTC_ANDROID)
+   ret = gettid();
++#elif defined(__DragonFly__) // WEBRTC_BSD
++  ret = lwp_gettid();
++#elif defined(__FreeBSD__) // WEBRTC_BSD
++  ret = pthread_getthreadid_np();
++#elif defined(__NetBSD__) // WEBRTC_BSD
++  ret = _lwp_self();
+ #else
+   // Default implementation for nacl and solaris.
+-  ret = reinterpret_cast<pid_t>(pthread_self());
++  // WEBRTC_BSD: pthread_t is a pointer, so cannot be casted to pid_t
++  //             (aka int32_t) on 64-bit archs. Required on OpenBSD.
++  ret = reinterpret_cast<uintptr_t>(pthread_self());
+ #endif
+ #endif  // defined(WEBRTC_POSIX)
+   RTC_DCHECK(ret);
+@@ -76,6 +90,10 @@ void SetCurrentThreadName(const char* name) {
+   prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name));
+ #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
+   pthread_setname_np(name);
++#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) // WEBRTC_BSD
++  pthread_set_name_np(pthread_self(), name);
++#elif defined(__NetBSD__) // WEBRTC_BSD
++  pthread_setname_np(pthread_self(), "%s", (void*)name);
+ #endif
+ }
+ 

Added: head/audio/webrtc-audio-processing/files/patch-webrtc_base_stringutils.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/files/patch-webrtc_base_stringutils.h	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,13 @@
+- BSD macro (in sys/param.h) is an archaic of the (University of California) past
+
+--- webrtc/base/stringutils.h.orig	2018-07-23 14:02:57 UTC
++++ webrtc/base/stringutils.h
+@@ -23,7 +23,7 @@
+ #endif  // WEBRTC_WIN 
+ 
+ #if defined(WEBRTC_POSIX)
+-#ifdef BSD
++#ifdef WEBRTC_BSD
+ #include <stdlib.h>
+ #else  // BSD
+ #include <alloca.h>

Added: head/audio/webrtc-audio-processing/files/patch-webrtc_system__wrappers_source_condition__variable.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/files/patch-webrtc_system__wrappers_source_condition__variable.cc	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,22 @@
+- Match conditional in webrtc/system_wrappers/Makefile.am
+
+--- webrtc/system_wrappers/source/condition_variable.cc.orig	2018-07-23 14:02:57 UTC
++++ webrtc/system_wrappers/source/condition_variable.cc
+@@ -14,7 +14,7 @@
+ #include <windows.h>
+ #include "webrtc/system_wrappers/source/condition_variable_event_win.h"
+ #include "webrtc/system_wrappers/source/condition_variable_native_win.h"
+-#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
++#elif defined(WEBRTC_POSIX)
+ #include <pthread.h>
+ #include "webrtc/system_wrappers/source/condition_variable_posix.h"
+ #endif
+@@ -31,7 +31,7 @@ ConditionVariableWrapper* ConditionVariableWrapper::Cr
+     ret_val = new ConditionVariableEventWin();
+   }
+   return ret_val;
+-#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
++#elif defined(WEBRTC_POSIX)
+   return ConditionVariablePosix::Create();
+ #else
+   return NULL;

Added: head/audio/webrtc-audio-processing/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/pkg-descr	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,12 @@
+Audio processing routines extracted from WebRTC project into a
+standalone library. It provides the following features:
+
+- Acoustic echo cancellation
+- Acoustic echo control for mobile
+- Automatic gain control
+- High-pass filter
+- Level estimator
+- Noise suppression
+- Voice activity detection
+
+WWW: https://freedesktop.org/software/pulseaudio/webrtc-audio-processing/

Added: head/audio/webrtc-audio-processing/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/webrtc-audio-processing/pkg-plist	Fri Oct 12 18:22:06 2018	(r481919)
@@ -0,0 +1,18 @@
+include/webrtc_audio_processing/webrtc/base/arraysize.h
+include/webrtc_audio_processing/webrtc/base/basictypes.h
+include/webrtc_audio_processing/webrtc/base/checks.h
+include/webrtc_audio_processing/webrtc/base/constructormagic.h
+include/webrtc_audio_processing/webrtc/base/maybe.h
+include/webrtc_audio_processing/webrtc/base/platform_file.h
+include/webrtc_audio_processing/webrtc/common.h
+include/webrtc_audio_processing/webrtc/common_types.h
+include/webrtc_audio_processing/webrtc/modules/audio_processing/beamformer/array_util.h
+include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h
+include/webrtc_audio_processing/webrtc/modules/interface/module_common_types.h
+include/webrtc_audio_processing/webrtc/system_wrappers/include/trace.h
+include/webrtc_audio_processing/webrtc/typedefs.h
+lib/libwebrtc_audio_processing.a
+lib/libwebrtc_audio_processing.so
+lib/libwebrtc_audio_processing.so.1
+lib/libwebrtc_audio_processing.so.1.0.0
+libdata/pkgconfig/webrtc-audio-processing.pc



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810121822.w9CIM6mp086735>