diff options
author | Narayan Kamath <narayan@google.com> | 2014-01-07 05:00:53 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-01-07 05:00:53 -0800 |
commit | 568cde557abfaaa5bf584cf7c3396f9efd990e6c (patch) | |
tree | 5664d65af6ca8c7aaa5e9f9201552cc14e61a3f3 /media | |
parent | c47b7d377c4785f84a22c42c6a99716cceb5973c (diff) | |
parent | 80cff94478a39914012df816179ea57c53040903 (diff) | |
download | frameworks_base-568cde557abfaaa5bf584cf7c3396f9efd990e6c.zip frameworks_base-568cde557abfaaa5bf584cf7c3396f9efd990e6c.tar.gz frameworks_base-568cde557abfaaa5bf584cf7c3396f9efd990e6c.tar.bz2 |
am 80cff944: am 74675f29: Merge "AArch64: Use long for pointers in AmrInputStream"
* commit '80cff94478a39914012df816179ea57c53040903':
AArch64: Use long for pointers in AmrInputStream
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AmrInputStream.java | 12 | ||||
-rw-r--r-- | media/jni/android_media_AmrInputStream.cpp | 28 |
2 files changed, 20 insertions, 20 deletions
diff --git a/media/java/android/media/AmrInputStream.java b/media/java/android/media/AmrInputStream.java index 8b7eee2..e2115e4 100644 --- a/media/java/android/media/AmrInputStream.java +++ b/media/java/android/media/AmrInputStream.java @@ -41,7 +41,7 @@ public final class AmrInputStream extends InputStream private InputStream mInputStream; // native handle - private int mGae; + private long mGae; // result amr stream private final byte[] mBuf = new byte[SAMPLES_PER_FRAME * 2]; @@ -130,11 +130,11 @@ public final class AmrInputStream extends InputStream // // AudioRecord JNI interface // - private static native int GsmAmrEncoderNew(); - private static native void GsmAmrEncoderInitialize(int gae); - private static native int GsmAmrEncoderEncode(int gae, + private static native long GsmAmrEncoderNew(); + private static native void GsmAmrEncoderInitialize(long gae); + private static native int GsmAmrEncoderEncode(long gae, byte[] pcm, int pcmOffset, byte[] amr, int amrOffset) throws IOException; - private static native void GsmAmrEncoderCleanup(int gae); - private static native void GsmAmrEncoderDelete(int gae); + private static native void GsmAmrEncoderCleanup(long gae); + private static native void GsmAmrEncoderDelete(long gae); } diff --git a/media/jni/android_media_AmrInputStream.cpp b/media/jni/android_media_AmrInputStream.cpp index b5220fe..3df6530 100644 --- a/media/jni/android_media_AmrInputStream.cpp +++ b/media/jni/android_media_AmrInputStream.cpp @@ -49,17 +49,17 @@ struct GsmAmrEncoderState { int32_t mLastModeUsed; }; -static jint android_media_AmrInputStream_GsmAmrEncoderNew +static jlong android_media_AmrInputStream_GsmAmrEncoderNew (JNIEnv *env, jclass clazz) { GsmAmrEncoderState* gae = new GsmAmrEncoderState(); if (gae == NULL) { jniThrowRuntimeException(env, "Out of memory"); } - return (jint)gae; + return (jlong)gae; } static void android_media_AmrInputStream_GsmAmrEncoderInitialize - (JNIEnv *env, jclass clazz, jint gae) { + (JNIEnv *env, jclass clazz, jlong gae) { GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae; int32_t nResult = AMREncodeInit(&state->mEncState, &state->mSidState, false); if (nResult != OK) { @@ -70,7 +70,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderInitialize static jint android_media_AmrInputStream_GsmAmrEncoderEncode (JNIEnv *env, jclass clazz, - jint gae, jbyteArray pcm, jint pcmOffset, jbyteArray amr, jint amrOffset) { + jlong gae, jbyteArray pcm, jint pcmOffset, jbyteArray amr, jint amrOffset) { jbyte inBuf[BYTES_PER_FRAME]; jbyte outBuf[MAX_OUTPUT_BUFFER_SIZE]; @@ -86,7 +86,7 @@ static jint android_media_AmrInputStream_GsmAmrEncoderEncode if (length < 0) { jniThrowExceptionFmt(env, "java/io/IOException", "Failed to encode a frame with error code: %d", length); - return -1; + return (jint)-1; } // The 1st byte of PV AMR frames are WMF (Wireless Multimedia Forum) @@ -101,30 +101,30 @@ static jint android_media_AmrInputStream_GsmAmrEncoderEncode env->SetByteArrayRegion(amr, amrOffset, length, outBuf); - return length; + return (jint)length; } static void android_media_AmrInputStream_GsmAmrEncoderCleanup - (JNIEnv *env, jclass clazz, jint gae) { - GsmAmrEncoderState *state = (GsmAmrEncoderState *)gae; + (JNIEnv *env, jclass clazz, jlong gae) { + GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae; AMREncodeExit(&state->mEncState, &state->mSidState); state->mEncState = NULL; state->mSidState = NULL; } static void android_media_AmrInputStream_GsmAmrEncoderDelete - (JNIEnv *env, jclass clazz, jint gae) { + (JNIEnv *env, jclass clazz, jlong gae) { delete (GsmAmrEncoderState*)gae; } // ---------------------------------------------------------------------------- static JNINativeMethod gMethods[] = { - {"GsmAmrEncoderNew", "()I", (void*)android_media_AmrInputStream_GsmAmrEncoderNew}, - {"GsmAmrEncoderInitialize", "(I)V", (void*)android_media_AmrInputStream_GsmAmrEncoderInitialize}, - {"GsmAmrEncoderEncode", "(I[BI[BI)I", (void*)android_media_AmrInputStream_GsmAmrEncoderEncode}, - {"GsmAmrEncoderCleanup", "(I)V", (void*)android_media_AmrInputStream_GsmAmrEncoderCleanup}, - {"GsmAmrEncoderDelete", "(I)V", (void*)android_media_AmrInputStream_GsmAmrEncoderDelete}, + {"GsmAmrEncoderNew", "()J", (void*)android_media_AmrInputStream_GsmAmrEncoderNew}, + {"GsmAmrEncoderInitialize", "(J)V", (void*)android_media_AmrInputStream_GsmAmrEncoderInitialize}, + {"GsmAmrEncoderEncode", "(J[BI[BI)I", (void*)android_media_AmrInputStream_GsmAmrEncoderEncode}, + {"GsmAmrEncoderCleanup", "(J)V", (void*)android_media_AmrInputStream_GsmAmrEncoderCleanup}, + {"GsmAmrEncoderDelete", "(J)V", (void*)android_media_AmrInputStream_GsmAmrEncoderDelete}, }; |