1 /*
2  * Copyright 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.hyphonate.megaaudio.player;
17 
18 /**
19  * Implements facility for wrapping a JavaAudioSource in a NativeAudioSource.
20  */
21 public class JavaSourceProxy {
22     /**
23      * Initializes the JNI required to use this class.
24      */
initN()25     public static native void initN();
26 
27     /**
28      * Creates and initializes a native audio source (NativeAudioSource) object
29      * and associates it with the specified Java AudioSource.
30      * @param javaSource the Java AudioSource to associate.
31      * @return A pointer to the native audio source object (cast as a long).
32      */
allocNativeSource(AudioSource javaSource)33     public static native long allocNativeSource(AudioSource javaSource);
34 }
35