This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a859645
commit 08813e7
Showing
120 changed files
with
4,892 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | ||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | ||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="gen"/> | ||
<classpathentry kind="output" path="bin/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Patchfield</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ApkBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 | ||
org.eclipse.jdt.core.compiler.compliance=1.6 | ||
org.eclipse.jdt.core.compiler.source=1.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.noisepages.nettoyeur.patchfield" | ||
android:versionCode="1" | ||
android:versionName="1.0" > | ||
|
||
<uses-sdk | ||
android:minSdkVersion="14" | ||
android:targetSdkVersion="18" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme" > | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
all: | ||
javah -classpath bin/classes -o jni/internal/audio_module_java.h \ | ||
com.noisepages.nettoyeur.patchfield.AudioModule | ||
javah -classpath bin/classes -o jni/internal/patchfield.h \ | ||
com.noisepages.nettoyeur.patchfield.Patchfield | ||
javah -classpath bin/classes -o jni/internal/shared_memory_utils.h \ | ||
com.noisepages.nettoyeur.patchfield.internal.SharedMemoryUtils | ||
javah -classpath bin/classes -o jni/modules/javamodule.h \ | ||
com.noisepages.nettoyeur.patchfield.modules.JavaModule | ||
ndk-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
# Public libraries. | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := audiomodule | ||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) | ||
LOCAL_EXPORT_CFLAGS := -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast | ||
LOCAL_SRC_FILES := internal/audio_module.c | ||
include $(BUILD_STATIC_LIBRARY) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := buffersizeadapter | ||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) | ||
LOCAL_SRC_FILES := utils/buffer_size_adapter.c | ||
LOCAL_STATIC_LIBRARIES := audiomodule | ||
include $(BUILD_STATIC_LIBRARY) | ||
|
||
|
||
# Java Audio module. | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := javamodule | ||
LOCAL_LDLIBS := -llog | ||
LOCAL_SRC_FILES := modules/javamodule.c internal/simple_barrier.c | ||
LOCAL_STATIC_LIBRARIES := audiomodule buffersizeadapter | ||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
|
||
# Internal libraries. | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := audiomoduleinternal | ||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) | ||
LOCAL_EXPORT_CFLAGS := -Wno-int-to-pointer-cast -Wno-pointer-to-int-cast | ||
LOCAL_EXPORT_LDLIBS := -lOpenSLES -llog | ||
LOCAL_SRC_FILES := internal/audio_module_internal.c \ | ||
internal/simple_barrier.c internal/shared_memory_internal.c \ | ||
opensl_stream/opensl_stream.c | ||
include $(BUILD_STATIC_LIBRARY) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := audiomodulejava | ||
LOCAL_STATIC_LIBRARIES := audiomoduleinternal | ||
LOCAL_SRC_FILES := internal/audio_module_java.c | ||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := patchfield | ||
LOCAL_STATIC_LIBRARIES := audiomoduleinternal | ||
LOCAL_SRC_FILES := internal/patchfield.c | ||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE := shared_memory_utils | ||
LOCAL_LDLIBS := -llog | ||
LOCAL_SRC_FILES := internal/shared_memory_utils.c \ | ||
internal/shared_memory_internal.c | ||
include $(BUILD_SHARED_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_OPTIM := release | ||
APP_ABI := armeabi armeabi-v7a x86 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright 2013 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy | ||
* of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Native library for use with the native components of subclasses of | ||
* AudioModule.java. Audio modules must implement a process callback of type | ||
* audio_module_process_t and hook up the am_configure function in this library | ||
* to the corresponding configure method in the Java class. See | ||
* LowpassModule.java and lowpass.{h,c} for an example of this interaction. | ||
*/ | ||
|
||
#ifndef __AUDIO_MODULE_H__ | ||
#define __AUDIO_MODULE_H__ | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/* | ||
* Processing callback; takes a processing context (which is just a pointer to | ||
* whatever data you want to pass to the callback), the sample rate, the buffer | ||
* size in frames, the number of input and output channels, as well as input | ||
* and output buffers whose size is the number of channels times the number of | ||
* frames per buffer. Buffers are non-interleaved. | ||
* | ||
* This function will be invoked on a dedicated audio thread, and so any data | ||
* in the context that may be modified concurrently must be protected (e.g., by | ||
* gcc atomics) to prevent race conditions. | ||
*/ | ||
typedef void (*audio_module_process_t) | ||
(void *context, int sample_rate, int buffer_frames, | ||
int input_channels, const float *input_buffer, | ||
int output_channels, float *output_buffer); | ||
|
||
/* | ||
* Configures the audio module with a native audio processing method and | ||
* its context. The handle parameter is the handle that the AudioModule class | ||
* passes to the protected configure method. On the Java side, this handle is | ||
* of type long, and so in C it must be cast from jlong to void*. | ||
*/ | ||
void am_configure(void *handle, audio_module_process_t process, void *context); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2013 Google Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy | ||
* of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
#include "audio_module.h" | ||
|
||
#include "internal/audio_module_internal.h" | ||
|
||
void am_configure(void *handle, audio_module_process_t process, void *context) { | ||
audio_module_runner *amr = (audio_module_runner *) handle; | ||
amr->process = process; | ||
amr->context = context; | ||
} |
Oops, something went wrong.