Toshaan Bharvani
3 years ago
commit
0e797f3953
3 changed files with 295 additions and 0 deletions
@ -0,0 +1,90 @@ |
|||||||
|
diff -up webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc.than webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc |
||||||
|
--- webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc.than 2016-05-24 08:28:45.749940095 -0400 |
||||||
|
+++ webrtc-audio-processing-0.2/webrtc/common_audio/wav_file.cc 2016-05-24 08:50:30.361020010 -0400 |
||||||
|
@@ -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,12 @@ size_t WavReader::ReadSamples(size_t num |
||||||
|
RTC_CHECK(read == num_samples || feof(file_handle_)); |
||||||
|
RTC_CHECK_LE(read, num_samples_remaining_); |
||||||
|
num_samples_remaining_ -= rtc::checked_cast<uint32_t>(read); |
||||||
|
+#ifndef WEBRTC_ARCH_LITTLE_ENDIAN |
||||||
|
+ //convert to big-endian |
||||||
|
+ for(size_t idx = 0; idx < num_samples; idx++) { |
||||||
|
+ samples[idx] = (samples[idx]<<8) | (samples[idx]>>8); |
||||||
|
+ } |
||||||
|
+#endif |
||||||
|
return read; |
||||||
|
} |
||||||
|
|
||||||
|
@@ -120,10 +123,17 @@ 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 |
||||||
|
+ int16_t * le_samples = new int16_t[num_samples]; |
||||||
|
+ for(size_t idx = 0; idx < num_samples; idx++) { |
||||||
|
+ le_samples[idx] = (samples[idx]<<8) | (samples[idx]>>8); |
||||||
|
+ } |
||||||
|
+ const size_t written = |
||||||
|
+ fwrite(le_samples, sizeof(*le_samples), num_samples, file_handle_); |
||||||
|
+ delete []le_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 -up webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc.than webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc |
||||||
|
--- webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc.than 2016-05-24 08:50:52.591379263 -0400 |
||||||
|
+++ webrtc-audio-processing-0.2/webrtc/common_audio/wav_header.cc 2016-05-24 08:52:08.552606848 -0400 |
||||||
|
@@ -129,7 +129,39 @@ static inline std::string ReadFourCC(uin |
||||||
|
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) & 0xff00) | ( ( x >> 8) & 0x00ff); |
||||||
|
+} |
||||||
|
+ |
||||||
|
+static inline void WriteLE32(uint32_t* f, uint32_t x) { |
||||||
|
+ *f = ( (x & 0x000000ff) << 24 ) |
||||||
|
+ | ((x & 0x0000ff00) << 8) |
||||||
|
+ | ((x & 0x00ff0000) >> 8) |
||||||
|
+ | ((x & 0xff000000) >> 24 ); |
||||||
|
+} |
||||||
|
+ |
||||||
|
+static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) { |
||||||
|
+ *f = (static_cast<uint32_t>(a) << 24 ) |
||||||
|
+ | (static_cast<uint32_t>(b) << 16) |
||||||
|
+ | (static_cast<uint32_t>(c) << 8) |
||||||
|
+ | (static_cast<uint32_t>(d) ); |
||||||
|
+} |
||||||
|
+ |
||||||
|
+static inline uint16_t ReadLE16(uint16_t x) { |
||||||
|
+ return (( x & 0x00ff) << 8 )| ((x & 0xff00)>>8); |
||||||
|
+} |
||||||
|
+ |
||||||
|
+static inline uint32_t ReadLE32(uint32_t x) { |
||||||
|
+ return ( (x & 0x000000ff) << 24 ) |
||||||
|
+ | ( (x & 0x0000ff00) << 8 ) |
||||||
|
+ | ( (x & 0x00ff0000) >> 8) |
||||||
|
+ | ( (x & 0xff000000) >> 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) { |
@ -0,0 +1,24 @@ |
|||||||
|
diff -up webrtc-audio-processing-0.2/webrtc/typedefs.h.typedef webrtc-audio-processing-0.2/webrtc/typedefs.h |
||||||
|
--- webrtc-audio-processing-0.2/webrtc/typedefs.h.typedef 2016-05-12 09:08:53.885000410 -0500 |
||||||
|
+++ webrtc-audio-processing-0.2/webrtc/typedefs.h 2016-05-12 09:12:38.006851953 -0500 |
||||||
|
@@ -48,7 +48,19 @@ |
||||||
|
#define WEBRTC_ARCH_32_BITS |
||||||
|
#define WEBRTC_ARCH_LITTLE_ENDIAN |
||||||
|
#else |
||||||
|
-#error Please add support for your architecture in typedefs.h |
||||||
|
+/* instead of failing, use typical unix defines... */ |
||||||
|
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
||||||
|
+#define WEBRTC_ARCH_LITTLE_ENDIAN |
||||||
|
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
||||||
|
+#define WEBRTC_ARCH_BIG_ENDIAN |
||||||
|
+#else |
||||||
|
+#error __BYTE_ORDER__ is not defined |
||||||
|
+#endif |
||||||
|
+#if defined(__LP64__) |
||||||
|
+#define WEBRTC_ARCH_64_BITS |
||||||
|
+#else |
||||||
|
+#define WEBRTC_ARCH_32_BITS |
||||||
|
+#endif |
||||||
|
#endif |
||||||
|
|
||||||
|
#if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN)) |
@ -0,0 +1,181 @@ |
|||||||
|
Name: webrtc-audio-processing |
||||||
|
Version: 0.3.1 |
||||||
|
Release: 8%{?dist} |
||||||
|
Summary: Library for echo cancellation |
||||||
|
|
||||||
|
License: BSD and MIT |
||||||
|
URL: http://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing/ |
||||||
|
Source0: http://freedesktop.org/software/pulseaudio/webrtc-audio-processing/%{name}-%{version}.tar.xz |
||||||
|
|
||||||
|
## upstream patches |
||||||
|
|
||||||
|
Patch100: webrtc-fix-typedefs-on-other-arches.patch |
||||||
|
# bz#1336466, https://bugs.freedesktop.org/show_bug.cgi?id=95738 |
||||||
|
Patch104: webrtc-audio-processing-0.2-big-endian.patch |
||||||
|
|
||||||
|
BuildRequires: make |
||||||
|
BuildRequires: autoconf automake libtool |
||||||
|
BuildRequires: gcc gcc-c++ |
||||||
|
|
||||||
|
%description |
||||||
|
%{name} is a library derived from Google WebRTC project that |
||||||
|
provides echo cancellation functionality. This library is used by for example |
||||||
|
PulseAudio to provide echo cancellation. |
||||||
|
|
||||||
|
%package devel |
||||||
|
Summary: Development files for %{name} |
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release} |
||||||
|
|
||||||
|
%description devel |
||||||
|
The %{name}-devel package contains libraries and header |
||||||
|
files for developing applications that use %{name}. |
||||||
|
|
||||||
|
%prep |
||||||
|
%autosetup -p1 |
||||||
|
|
||||||
|
%build |
||||||
|
# for patch1 |
||||||
|
autoreconf -vif |
||||||
|
|
||||||
|
%configure \ |
||||||
|
%ifarch %{arm} aarch64 |
||||||
|
--enable-neon=no \ |
||||||
|
%endif |
||||||
|
--disable-silent-rules \ |
||||||
|
--disable-static |
||||||
|
|
||||||
|
%make_build |
||||||
|
|
||||||
|
|
||||||
|
%install |
||||||
|
%make_install |
||||||
|
|
||||||
|
# remove libtool archives |
||||||
|
find %{buildroot} -type f -name "*.la" -delete |
||||||
|
|
||||||
|
|
||||||
|
%ldconfig_scriptlets |
||||||
|
|
||||||
|
%files |
||||||
|
%doc NEWS AUTHORS README.md |
||||||
|
%license COPYING |
||||||
|
%{_libdir}/libwebrtc_audio_processing.so.1* |
||||||
|
|
||||||
|
%files devel |
||||||
|
%{_libdir}/libwebrtc_audio_processing.so |
||||||
|
%{_libdir}/pkgconfig/webrtc-audio-processing.pc |
||||||
|
%{_includedir}/webrtc_audio_processing/ |
||||||
|
|
||||||
|
|
||||||
|
%changelog |
||||||
|
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.1-8 |
||||||
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags |
||||||
|
Related: rhbz#1991688 |
||||||
|
|
||||||
|
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.1-7 |
||||||
|
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 |
||||||
|
|
||||||
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-6 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild |
||||||
|
|
||||||
|
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-5 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild |
||||||
|
|
||||||
|
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-4 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild |
||||||
|
|
||||||
|
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-3 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild |
||||||
|
|
||||||
|
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-2 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild |
||||||
|
|
||||||
|
* Wed Jul 25 2018 Rex Dieter <rdieter@fedoraproject.org> - 0.3.1-1 |
||||||
|
- 0.3.1 |
||||||
|
- use %%make_build %%make_install %%ldconfig_scriptlets |
||||||
|
|
||||||
|
* Mon Jul 23 2018 Debarshi Ray <rishi@fedoraproject.org> 0.3-9 |
||||||
|
- Update License |
||||||
|
|
||||||
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-8 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild |
||||||
|
|
||||||
|
* Sat Mar 3 2018 Peter Robinson <pbrobinson@fedoraproject.org> 0.3-7 |
||||||
|
- Add gcc/gcc-c++ build requires |
||||||
|
- Add aarch64 to NEON exception |
||||||
|
|
||||||
|
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-6 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild |
||||||
|
|
||||||
|
* Mon Jan 22 2018 Rex Dieter <rdieter@fedoraproject.org> - 0.3-5 |
||||||
|
- pull in upstream fixes, use %%autosetup |
||||||
|
|
||||||
|
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-4 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild |
||||||
|
|
||||||
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-3 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild |
||||||
|
|
||||||
|
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3-2 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild |
||||||
|
|
||||||
|
* Mon Jul 18 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.3-1 |
||||||
|
- 0.3 |
||||||
|
|
||||||
|
* Fri May 27 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-7 |
||||||
|
- better/upstreamable x86_msse2.patch |
||||||
|
|
||||||
|
* Fri May 27 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-6 |
||||||
|
- simpler/upstreamable no_undefined.patch (fdo#96244) |
||||||
|
|
||||||
|
* Wed May 25 2016 Than Ngo <than@redhat.com> - 0.2-5 |
||||||
|
- add url to upstream bug report |
||||||
|
|
||||||
|
* Tue May 24 2016 Than Ngo <than@redhat.com> - 0.2-4 |
||||||
|
- add support big endian |
||||||
|
|
||||||
|
* Mon May 16 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-3 |
||||||
|
- ExclusiveArch primary archs, FTBFS on big endian arches (#1336466) |
||||||
|
|
||||||
|
* Mon May 16 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-2 |
||||||
|
- link w/ --no-undefined |
||||||
|
- fix x86 sse2 runtime detection |
||||||
|
|
||||||
|
* Thu May 12 2016 Rex Dieter <rdieter@fedoraproject.org> - 0.2-1 |
||||||
|
- webrtc-audio-processing-0.2 (#1335536) |
||||||
|
- %%files: track ABI/API closer |
||||||
|
|
||||||
|
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-11 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild |
||||||
|
|
||||||
|
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-10 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild |
||||||
|
|
||||||
|
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.1-9 |
||||||
|
- Rebuilt for GCC 5 C++11 ABI change |
||||||
|
|
||||||
|
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-8 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild |
||||||
|
|
||||||
|
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-7 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild |
||||||
|
|
||||||
|
* Tue Jan 28 2014 Kyle McMartin <kyle@fedoraproject.org> - 0.1-6 |
||||||
|
- webrtc-fix-typedefs-on-other-arches.patch: fix ftbfs on non-x86/arm due to |
||||||
|
a build #error in typedefs.h, however, the defines are not used anywhere in |
||||||
|
the code. Fixes build on ppc{,64}, s390x, and aarch64. |
||||||
|
|
||||||
|
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-5 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild |
||||||
|
|
||||||
|
* Thu Jul 11 2013 Debarshi Ray <rishi@fedoraproject.org> 0.1-4 |
||||||
|
- Rebuilt to fix broken binary possibly caused by broken toolchain |
||||||
|
|
||||||
|
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-3 |
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild |
||||||
|
|
||||||
|
* Tue Oct 9 2012 Dan Horák <dan[at]danny.cz> 0.1-2 |
||||||
|
- set ExclusiveArch x86 and ARM for now |
||||||
|
|
||||||
|
* Fri Oct 5 2012 Christian Schaller <christian.schaller@gmail.com> 0.1-1 |
||||||
|
- Initial Fedora spec. |
Loading…
Reference in new issue