From 8ff433a13316e98ffdf9e34eea2b0c92e5e3f0f0 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Tue, 24 Jul 2018 13:42:22 +0200 Subject: [PATCH] Move portaudio to proper third_party directory Bug: webrtc:8366 Change-Id: I2a6464c5097840219825fe08dde9630f2231451a Reviewed-on: https://webrtc-review.googlesource.com/84581 Commit-Queue: Artem Titov Reviewed-by: Niklas Enbom Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#24081} --- LICENSE_THIRD_PARTY | 100 ------------------ modules/audio_device/BUILD.gn | 11 +- modules/audio_device/mac/audio_device_mac.cc | 2 +- modules/third_party/portaudio/BUILD.gn | 18 ++++ modules/third_party/portaudio/LICENSE | 91 ++++++++++++++++ modules/third_party/portaudio/README.chromium | 12 +++ .../portaudio/pa_memorybarrier.h | 0 .../portaudio/pa_ringbuffer.c | 4 +- .../portaudio/pa_ringbuffer.h | 0 tools_webrtc/libs/generate_licenses.py | 1 + 10 files changed, 126 insertions(+), 113 deletions(-) create mode 100644 modules/third_party/portaudio/BUILD.gn create mode 100644 modules/third_party/portaudio/LICENSE create mode 100644 modules/third_party/portaudio/README.chromium rename modules/{audio_device/mac => third_party}/portaudio/pa_memorybarrier.h (100%) rename modules/{audio_device/mac => third_party}/portaudio/pa_ringbuffer.c (98%) rename modules/{audio_device/mac => third_party}/portaudio/pa_ringbuffer.h (100%) diff --git a/LICENSE_THIRD_PARTY b/LICENSE_THIRD_PARTY index 28a0c93807..7838d57473 100644 --- a/LICENSE_THIRD_PARTY +++ b/LICENSE_THIRD_PARTY @@ -13,9 +13,6 @@ modules/audio_coding/codecs/g722/main/source/g722_decode.c modules/audio_coding/codecs/g722/main/source/g722_enc_dec.h modules/audio_coding/codecs/g722/main/source/g722_encode.c modules/audio_coding/codecs/isac/main/source/fft.c -modules/audio_device/mac/portaudio/pa_memorybarrier.h -modules/audio_device/mac/portaudio/pa_ringbuffer.c -modules/audio_device/mac/portaudio/pa_ringbuffer.h Individual licenses for each file: ------------------------------------------------------------------------------- @@ -143,103 +140,6 @@ License: */ ------------------------------------------------------------------------------- Files: -modules/audio_device/mac/portaudio/pa_memorybarrier.h -modules/audio_device/mac/portaudio/pa_ringbuffer.c -modules/audio_device/mac/portaudio/pa_ringbuffer.h - -License: -/* - * $Id: pa_memorybarrier.h 1240 2007-07-17 13:05:07Z bjornroche $ - * Portable Audio I/O Library - * Memory barrier utilities - * - * Author: Bjorn Roche, XO Audio, LLC - * - * This program uses the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - -/* - * $Id: pa_ringbuffer.c 1421 2009-11-18 16:09:05Z bjornroche $ - * Portable Audio I/O Library - * Ring Buffer utility. - * - * Author: Phil Burk, http://www.softsynth.com - * modified for SMP safety on Mac OS X by Bjorn Roche - * modified for SMP safety on Linux by Leland Lucius - * also, allowed for const where possible - * modified for multiple-byte-sized data elements by Sven Fischer - * - * Note that this is safe only for a single-thread reader and a - * single-thread writer. - * - * This program uses the PortAudio Portable Audio Library. - * For more information see: http://www.portaudio.com - * Copyright (c) 1999-2000 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ -------------------------------------------------------------------------------- -Files: common_audio/fft4g.c License: diff --git a/modules/audio_device/BUILD.gn b/modules/audio_device/BUILD.gn index 5a7dfed54a..b5514d88b0 100644 --- a/modules/audio_device/BUILD.gn +++ b/modules/audio_device/BUILD.gn @@ -341,7 +341,7 @@ rtc_source_set("audio_device_impl") { "mac/audio_mixer_manager_mac.cc", "mac/audio_mixer_manager_mac.h", ] - deps += [ ":mac_portaudio" ] + deps += [ "../third_party/portaudio:mac_portaudio" ] libs = [ # Needed for CoreGraphics: "ApplicationServices.framework", @@ -386,15 +386,6 @@ rtc_source_set("audio_device_impl") { } } -rtc_source_set("mac_portaudio") { - visibility = [ ":*" ] # Only targets in this file can depend on this. - sources = [ - "mac/portaudio/pa_memorybarrier.h", - "mac/portaudio/pa_ringbuffer.c", - "mac/portaudio/pa_ringbuffer.h", - ] -} - rtc_source_set("mock_audio_device") { testonly = true sources = [ diff --git a/modules/audio_device/mac/audio_device_mac.cc b/modules/audio_device/mac/audio_device_mac.cc index 11a7555c28..b34e875a33 100644 --- a/modules/audio_device/mac/audio_device_mac.cc +++ b/modules/audio_device/mac/audio_device_mac.cc @@ -11,7 +11,7 @@ #include "modules/audio_device/mac/audio_device_mac.h" #include "absl/memory/memory.h" #include "modules/audio_device/audio_device_config.h" -#include "modules/audio_device/mac/portaudio/pa_ringbuffer.h" +#include "modules/third_party/portaudio/pa_ringbuffer.h" #include "rtc_base/arraysize.h" #include "rtc_base/checks.h" #include "rtc_base/platform_thread.h" diff --git a/modules/third_party/portaudio/BUILD.gn b/modules/third_party/portaudio/BUILD.gn new file mode 100644 index 0000000000..1aa32b1599 --- /dev/null +++ b/modules/third_party/portaudio/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +import("../../../webrtc.gni") + +rtc_source_set("mac_portaudio") { + visibility = [ "../../audio_device:*" ] + sources = [ + "pa_memorybarrier.h", + "pa_ringbuffer.c", + "pa_ringbuffer.h", + ] +} diff --git a/modules/third_party/portaudio/LICENSE b/modules/third_party/portaudio/LICENSE new file mode 100644 index 0000000000..6ccaca2910 --- /dev/null +++ b/modules/third_party/portaudio/LICENSE @@ -0,0 +1,91 @@ +/* + * $Id: pa_memorybarrier.h 1240 2007-07-17 13:05:07Z bjornroche $ + * Portable Audio I/O Library + * Memory barrier utilities + * + * Author: Bjorn Roche, XO Audio, LLC + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * The text above constitutes the entire PortAudio license; however, + * the PortAudio community also makes the following non-binding requests: + * + * Any person wishing to distribute modifications to the Software is + * requested to send the modifications to the original developer so that + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the + * license above. + */ + +/* + * $Id: pa_ringbuffer.c 1421 2009-11-18 16:09:05Z bjornroche $ + * Portable Audio I/O Library + * Ring Buffer utility. + * + * Author: Phil Burk, http://www.softsynth.com + * modified for SMP safety on Mac OS X by Bjorn Roche + * modified for SMP safety on Linux by Leland Lucius + * also, allowed for const where possible + * modified for multiple-byte-sized data elements by Sven Fischer + * + * Note that this is safe only for a single-thread reader and a + * single-thread writer. + * + * This program uses the PortAudio Portable Audio Library. + * For more information see: http://www.portaudio.com + * Copyright (c) 1999-2000 Ross Bencina and Phil Burk + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * The text above constitutes the entire PortAudio license; however, + * the PortAudio community also makes the following non-binding requests: + * + * Any person wishing to distribute modifications to the Software is + * requested to send the modifications to the original developer so that + * they can be incorporated into the canonical version. It is also + * requested that these non-binding requests be included along with the + * license above. + */ + diff --git a/modules/third_party/portaudio/README.chromium b/modules/third_party/portaudio/README.chromium new file mode 100644 index 0000000000..7a15b2e1fc --- /dev/null +++ b/modules/third_party/portaudio/README.chromium @@ -0,0 +1,12 @@ +Name: Portaudio library for mac +Short Name: portaudio +URL: https://app.assembla.com/spaces/portaudio/git/source/master/src/common +Version: 0 +Date: 2018-02-01 +License: Custom license +License File: LICENSE +Security Critical: yes + +Description: +Part of portaudio library to operate with memory barriers and ring buffer. + diff --git a/modules/audio_device/mac/portaudio/pa_memorybarrier.h b/modules/third_party/portaudio/pa_memorybarrier.h similarity index 100% rename from modules/audio_device/mac/portaudio/pa_memorybarrier.h rename to modules/third_party/portaudio/pa_memorybarrier.h diff --git a/modules/audio_device/mac/portaudio/pa_ringbuffer.c b/modules/third_party/portaudio/pa_ringbuffer.c similarity index 98% rename from modules/audio_device/mac/portaudio/pa_ringbuffer.c rename to modules/third_party/portaudio/pa_ringbuffer.c index 7a95024757..fc1053c5ff 100644 --- a/modules/audio_device/mac/portaudio/pa_ringbuffer.c +++ b/modules/third_party/portaudio/pa_ringbuffer.c @@ -56,8 +56,8 @@ #include #include #include -#include "modules/audio_device/mac/portaudio/pa_memorybarrier.h" -#include "modules/audio_device/mac/portaudio/pa_ringbuffer.h" +#include "modules/third_party/portaudio/pa_memorybarrier.h" +#include "modules/third_party/portaudio/pa_ringbuffer.h" /*************************************************************************** * Initialize FIFO. diff --git a/modules/audio_device/mac/portaudio/pa_ringbuffer.h b/modules/third_party/portaudio/pa_ringbuffer.h similarity index 100% rename from modules/audio_device/mac/portaudio/pa_ringbuffer.h rename to modules/third_party/portaudio/pa_ringbuffer.h diff --git a/tools_webrtc/libs/generate_licenses.py b/tools_webrtc/libs/generate_licenses.py index 77064f1d2c..66137f795c 100755 --- a/tools_webrtc/libs/generate_licenses.py +++ b/tools_webrtc/libs/generate_licenses.py @@ -48,6 +48,7 @@ LIB_TO_LICENSES_DICT = { 'webrtc': ['LICENSE', 'LICENSE_THIRD_PARTY'], 'zlib': ['third_party/zlib/LICENSE'], 'base64': ['rtc_base/third_party/base64/LICENSE'], + 'portaudio': ['modules/third_party/portaudio/LICENSE'], # Compile time dependencies, no license needed: 'yasm': [],