added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
From 0c332b7d94f8425c4f33344ddf406b6eea458861 Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <tanuk@iki.fi>
Date: Mon, 8 May 2017 17:01:49 +0300
Subject: [PATCH 4/6] typedefs.h: add support for 64-bit and big endian MIPS
The 64-bit check is taken from the upstream webrtc project, the big
endian check is my own addition.
Upstream-Status: Pending
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
---
webrtc/typedefs.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
index d875490..d1b2f54 100644
--- a/webrtc/typedefs.h
+++ b/webrtc/typedefs.h
@@ -41,9 +41,18 @@
//#define WEBRTC_ARCH_ARMEL
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
-#elif defined(__MIPSEL__)
+#elif defined(__MIPSEL__) || defined(__MIPSEB__)
+#define WEBRTC_ARCH_MIPS_FAMILY
+#if defined(__LP64__)
+#define WEBRTC_ARCH_64_BITS
+#else
#define WEBRTC_ARCH_32_BITS
+#endif
+#if defined(__MIPSEL__)
#define WEBRTC_ARCH_LITTLE_ENDIAN
+#else
+#define WEBRTC_ARCH_BIG_ENDIAN
+#endif
#elif defined(__pnacl__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
--
2.11.0

View File

@@ -0,0 +1,28 @@
From db5f570e928c8ca5b0b8dc702e1af0a57277f092 Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <tanuk@iki.fi>
Date: Mon, 3 Jul 2017 16:20:08 +0300
Subject: [PATCH 5/6] typedefs.h: add support for PowerPC
Upstream-Status: Pending
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
---
webrtc/typedefs.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
index d1b2f54..6e34d9e 100644
--- a/webrtc/typedefs.h
+++ b/webrtc/typedefs.h
@@ -53,6 +53,9 @@
#else
#define WEBRTC_ARCH_BIG_ENDIAN
#endif
+#elif defined(__powerpc__)
+#define WEBRTC_ARCH_32_BITS
+#define WEBRTC_ARCH_BIG_ENDIAN
#elif defined(__pnacl__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN
--
2.11.0

View File

@@ -0,0 +1,116 @@
From 7d31da8ef93987000f297d435dbacaf7d436107b Mon Sep 17 00:00:00 2001
From: Tanu Kaskinen <tanuk@iki.fi>
Date: Thu, 15 Jun 2017 18:38:30 +0300
Subject: [PATCH 6/6] common_audio: implement endianness conversion in wav file
handling
The code didn't build for big endian machines due to the missing
endianness conversions.
Upstream-Status: Pending
Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
---
webrtc/common_audio/wav_file.cc | 27 +++++++++++++++++++++------
webrtc/common_audio/wav_header.cc | 32 +++++++++++++++++++++++++++++++-
2 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/webrtc/common_audio/wav_file.cc b/webrtc/common_audio/wav_file.cc
index b14b620..e2f7738 100644
--- a/webrtc/common_audio/wav_file.cc
+++ b/webrtc/common_audio/wav_file.cc
@@ -64,9 +64,6 @@ WavReader::~WavReader() {
}
size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-#error "Need to convert samples to big-endian when reading from WAV file"
-#endif
// There could be metadata after the audio; ensure we don't read it.
num_samples = std::min(rtc::checked_cast<uint32_t>(num_samples),
num_samples_remaining_);
@@ -76,6 +73,13 @@ size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) {
RTC_CHECK(read == num_samples || feof(file_handle_));
RTC_CHECK_LE(read, num_samples_remaining_);
num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read);
+
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
+ // Convert the read samples from little-endian to big-endian.
+ for (size_t i = 0; i < read; i++)
+ samples[i] = ((uint16_t) samples[i] >> 8) | ((uint16_t) samples[i] << 8);
+#endif
+
return read;
}
@@ -119,11 +123,22 @@ WavWriter::~WavWriter() {
}
void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) {
-#ifndef WEBRTC_ARCH_LITTLE_ENDIAN
-#error "Need to convert samples to little-endian when writing to WAV file"
-#endif
+#ifdef WEBRTC_ARCH_BIG_ENDIAN
+ // Convert the samples from big-endian samples to little-endian.
+ int16_t* converted_samples = static_cast<int16_t*>(malloc(num_samples * sizeof(*samples)));
+ RTC_CHECK(converted_samples) << "Out of memory.";
+ for (int i = 0; i < num_samples; i++)
+ converted_samples[i] =
+ ((uint16_t) samples[i] >> 8) | ((uint16_t) samples[i] << 8);
+
+ const size_t written =
+ fwrite(converted_samples, sizeof(*converted_samples), num_samples,
+ file_handle_);
+ free(converted_samples);
+#else
const size_t written =
fwrite(samples, sizeof(*samples), num_samples, file_handle_);
+#endif
RTC_CHECK_EQ(num_samples, written);
num_samples_ += static_cast<uint32_t>(written);
RTC_CHECK(written <= std::numeric_limits<uint32_t>::max() ||
diff --git a/webrtc/common_audio/wav_header.cc b/webrtc/common_audio/wav_header.cc
index 61cfffe..382bfc7 100644
--- a/webrtc/common_audio/wav_header.cc
+++ b/webrtc/common_audio/wav_header.cc
@@ -129,7 +129,37 @@ static inline std::string ReadFourCC(uint32_t x) {
return std::string(reinterpret_cast<char*>(&x), 4);
}
#else
-#error "Write be-to-le conversion functions"
+static inline void WriteLE16(uint16_t* f, uint16_t x) {
+ *f = x >> 8 | x << 8;
+}
+static inline void WriteLE32(uint32_t* f, uint32_t x) {
+ *f = x >> 24
+ | (x && 0xFF0000) >> 8
+ | (x && 0xFF00) << 8
+ | x << 24;
+}
+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) {
+ *f = static_cast<uint32_t>(d)
+ | static_cast<uint32_t>(c) << 8
+ | static_cast<uint32_t>(b) << 16
+ | static_cast<uint32_t>(a) << 24;
+}
+
+static inline uint32_t ReadLE16(uint16_t x) {
+ return x >> 8 | x << 8;
+}
+
+static inline uint32_t ReadLE32(uint32_t x) {
+ return x >> 24
+ | (x && 0xFF0000) >> 8
+ | (x && 0xFF00) << 8
+ | x << 24;
+}
+
+static inline std::string ReadFourCC(uint32_t x) {
+ x = ReadLE32(x);
+ return std::string(reinterpret_cast<char*>(&x), 4);
+}
#endif
static inline uint32_t RiffChunkSize(uint32_t bytes_in_payload) {
--
2.11.0

View File

@@ -0,0 +1,33 @@
Add support for RISC-V
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/webrtc/base/basictypes.h
+++ b/webrtc/base/basictypes.h
@@ -29,6 +29,10 @@
#define CPU_ARM 1
#endif
+#if defined(__riscv) || defined(_M_RISCV)
+#define CPU_RISCV 1
+#endif
+
#if defined(CPU_X86) && defined(CPU_ARM)
#error CPU_X86 and CPU_ARM both defined.
#endif
--- a/webrtc/typedefs.h
+++ b/webrtc/typedefs.h
@@ -56,6 +56,13 @@
#elif defined(__powerpc__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_BIG_ENDIAN
+#elif defined(__riscv)
+#if __riscv_xlen == 64
+# define WEBRTC_ARCH_64_BITS
+#else
+# define WEBRTC_ARCH_32_BITS
+#endif
+#define WEBRTC_ARCH_LITTLE_ENDIAN
#elif defined(__pnacl__)
#define WEBRTC_ARCH_32_BITS
#define WEBRTC_ARCH_LITTLE_ENDIAN

View File

@@ -0,0 +1,23 @@
DESCRIPTION = "Audio processing bits of the WebRTC reference implementation"
HOMEPAGE = "https://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/"
SECTION = "audio"
DEPENDS:append:libc-musl = " libexecinfo"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=da08a38a32a340c5d91e13ee86a118f2 \
file://webrtc/common.h;beginline=1;endline=9;md5=41f7322d91deabaf0acbbd0b8d0bc548 \
"
SRC_URI = "http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/${BP}.tar.xz \
file://0004-typedefs.h-add-support-for-64-bit-and-big-endian-MIP.patch \
file://0005-typedefs.h-add-support-for-PowerPC.patch \
file://0006-common_audio-implement-endianness-conversion-in-wav-.patch \
file://riscv_support.patch \
"
SRC_URI[md5sum] = "6e10724ca34bcbc715a4c208273acb0c"
SRC_URI[sha256sum] = "a0fdd938fd85272d67e81572c5a4d9e200a0c104753cb3c209ded175ce3c5dbf"
LDFLAGS:append:libc-musl = " -lexecinfo"
inherit autotools pkgconfig