Merge "AArch64: Use long for pointers in audio effect classes"
This commit is contained in:
@ -315,8 +315,8 @@ public class AudioEffect {
|
|||||||
private int mId;
|
private int mId;
|
||||||
|
|
||||||
// accessed by native methods
|
// accessed by native methods
|
||||||
private int mNativeAudioEffect;
|
private long mNativeAudioEffect;
|
||||||
private int mJniData;
|
private long mJniData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Effect descriptor
|
* Effect descriptor
|
||||||
|
@ -184,8 +184,8 @@ public class Visualizer {
|
|||||||
private OnServerDiedListener mServerDiedListener = null;
|
private OnServerDiedListener mServerDiedListener = null;
|
||||||
|
|
||||||
// accessed by native methods
|
// accessed by native methods
|
||||||
private int mNativeVisualizer;
|
private long mNativeVisualizer;
|
||||||
private int mJniData;
|
private long mJniData;
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// Constructor, Finalize
|
// Constructor, Finalize
|
||||||
|
@ -214,7 +214,7 @@ android_media_AudioEffect_native_init(JNIEnv *env)
|
|||||||
// nativeTrackInJavaObj
|
// nativeTrackInJavaObj
|
||||||
fields.fidNativeAudioEffect = env->GetFieldID(
|
fields.fidNativeAudioEffect = env->GetFieldID(
|
||||||
fields.clazzEffect,
|
fields.clazzEffect,
|
||||||
"mNativeAudioEffect", "I");
|
"mNativeAudioEffect", "J");
|
||||||
if (fields.fidNativeAudioEffect == NULL) {
|
if (fields.fidNativeAudioEffect == NULL) {
|
||||||
ALOGE("Can't find AudioEffect.%s", "mNativeAudioEffect");
|
ALOGE("Can't find AudioEffect.%s", "mNativeAudioEffect");
|
||||||
return;
|
return;
|
||||||
@ -222,7 +222,7 @@ android_media_AudioEffect_native_init(JNIEnv *env)
|
|||||||
// fidJniData;
|
// fidJniData;
|
||||||
fields.fidJniData = env->GetFieldID(
|
fields.fidJniData = env->GetFieldID(
|
||||||
fields.clazzEffect,
|
fields.clazzEffect,
|
||||||
"mJniData", "I");
|
"mJniData", "J");
|
||||||
if (fields.fidJniData == NULL) {
|
if (fields.fidJniData == NULL) {
|
||||||
ALOGE("Can't find AudioEffect.%s", "mJniData");
|
ALOGE("Can't find AudioEffect.%s", "mJniData");
|
||||||
return;
|
return;
|
||||||
@ -388,11 +388,11 @@ android_media_AudioEffect_native_setup(JNIEnv *env, jobject thiz, jobject weak_t
|
|||||||
|
|
||||||
env->SetObjectArrayElement(javadesc, 0, jdesc);
|
env->SetObjectArrayElement(javadesc, 0, jdesc);
|
||||||
|
|
||||||
env->SetIntField(thiz, fields.fidNativeAudioEffect, (int)lpAudioEffect);
|
env->SetLongField(thiz, fields.fidNativeAudioEffect, (jlong)lpAudioEffect);
|
||||||
|
|
||||||
env->SetIntField(thiz, fields.fidJniData, (int)lpJniStorage);
|
env->SetLongField(thiz, fields.fidJniData, (jlong)lpJniStorage);
|
||||||
|
|
||||||
return AUDIOEFFECT_SUCCESS;
|
return (jint) AUDIOEFFECT_SUCCESS;
|
||||||
|
|
||||||
// failures:
|
// failures:
|
||||||
setup_failure:
|
setup_failure:
|
||||||
@ -404,12 +404,12 @@ setup_failure:
|
|||||||
if (lpAudioEffect) {
|
if (lpAudioEffect) {
|
||||||
delete lpAudioEffect;
|
delete lpAudioEffect;
|
||||||
}
|
}
|
||||||
env->SetIntField(thiz, fields.fidNativeAudioEffect, 0);
|
env->SetLongField(thiz, fields.fidNativeAudioEffect, 0);
|
||||||
|
|
||||||
if (lpJniStorage) {
|
if (lpJniStorage) {
|
||||||
delete lpJniStorage;
|
delete lpJniStorage;
|
||||||
}
|
}
|
||||||
env->SetIntField(thiz, fields.fidJniData, 0);
|
env->SetLongField(thiz, fields.fidJniData, 0);
|
||||||
|
|
||||||
if (uuidStr != NULL) {
|
if (uuidStr != NULL) {
|
||||||
env->ReleaseStringUTFChars(uuid, uuidStr);
|
env->ReleaseStringUTFChars(uuid, uuidStr);
|
||||||
@ -419,27 +419,27 @@ setup_failure:
|
|||||||
env->ReleaseStringUTFChars(type, typeStr);
|
env->ReleaseStringUTFChars(type, typeStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return lStatus;
|
return (jint)lStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
static void android_media_AudioEffect_native_finalize(JNIEnv *env, jobject thiz) {
|
static void android_media_AudioEffect_native_finalize(JNIEnv *env, jobject thiz) {
|
||||||
ALOGV("android_media_AudioEffect_native_finalize jobject: %x\n", (int)thiz);
|
ALOGV("android_media_AudioEffect_native_finalize jobject: %p\n", thiz);
|
||||||
|
|
||||||
// delete the AudioEffect object
|
// delete the AudioEffect object
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetIntField(
|
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetLongField(
|
||||||
thiz, fields.fidNativeAudioEffect);
|
thiz, fields.fidNativeAudioEffect);
|
||||||
if (lpAudioEffect) {
|
if (lpAudioEffect) {
|
||||||
ALOGV("deleting AudioEffect: %x\n", (int)lpAudioEffect);
|
ALOGV("deleting AudioEffect: %p\n", lpAudioEffect);
|
||||||
delete lpAudioEffect;
|
delete lpAudioEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the JNI data
|
// delete the JNI data
|
||||||
AudioEffectJniStorage* lpJniStorage = (AudioEffectJniStorage *)env->GetIntField(
|
AudioEffectJniStorage* lpJniStorage = (AudioEffectJniStorage *)env->GetLongField(
|
||||||
thiz, fields.fidJniData);
|
thiz, fields.fidJniData);
|
||||||
if (lpJniStorage) {
|
if (lpJniStorage) {
|
||||||
ALOGV("deleting pJniStorage: %x\n", (int)lpJniStorage);
|
ALOGV("deleting pJniStorage: %p\n", lpJniStorage);
|
||||||
delete lpJniStorage;
|
delete lpJniStorage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -451,15 +451,15 @@ static void android_media_AudioEffect_native_release(JNIEnv *env, jobject thiz)
|
|||||||
android_media_AudioEffect_native_finalize(env, thiz);
|
android_media_AudioEffect_native_finalize(env, thiz);
|
||||||
// + reset the native resources in the Java object so any attempt to access
|
// + reset the native resources in the Java object so any attempt to access
|
||||||
// them after a call to release fails.
|
// them after a call to release fails.
|
||||||
env->SetIntField(thiz, fields.fidNativeAudioEffect, 0);
|
env->SetLongField(thiz, fields.fidNativeAudioEffect, 0);
|
||||||
env->SetIntField(thiz, fields.fidJniData, 0);
|
env->SetLongField(thiz, fields.fidJniData, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_AudioEffect_native_setEnabled(JNIEnv *env, jobject thiz, jboolean enabled)
|
android_media_AudioEffect_native_setEnabled(JNIEnv *env, jobject thiz, jboolean enabled)
|
||||||
{
|
{
|
||||||
// retrieve the AudioEffect object
|
// retrieve the AudioEffect object
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetIntField(
|
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetLongField(
|
||||||
thiz, fields.fidNativeAudioEffect);
|
thiz, fields.fidNativeAudioEffect);
|
||||||
|
|
||||||
if (lpAudioEffect == NULL) {
|
if (lpAudioEffect == NULL) {
|
||||||
@ -468,23 +468,27 @@ android_media_AudioEffect_native_setEnabled(JNIEnv *env, jobject thiz, jboolean
|
|||||||
return AUDIOEFFECT_ERROR_NO_INIT;
|
return AUDIOEFFECT_ERROR_NO_INIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return translateError(lpAudioEffect->setEnabled(enabled));
|
return (jint) translateError(lpAudioEffect->setEnabled(enabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
static jboolean
|
static jboolean
|
||||||
android_media_AudioEffect_native_getEnabled(JNIEnv *env, jobject thiz)
|
android_media_AudioEffect_native_getEnabled(JNIEnv *env, jobject thiz)
|
||||||
{
|
{
|
||||||
// retrieve the AudioEffect object
|
// retrieve the AudioEffect object
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetIntField(
|
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetLongField(
|
||||||
thiz, fields.fidNativeAudioEffect);
|
thiz, fields.fidNativeAudioEffect);
|
||||||
|
|
||||||
if (lpAudioEffect == NULL) {
|
if (lpAudioEffect == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalStateException",
|
jniThrowException(env, "java/lang/IllegalStateException",
|
||||||
"Unable to retrieve AudioEffect pointer for getEnabled()");
|
"Unable to retrieve AudioEffect pointer for getEnabled()");
|
||||||
return false;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (jboolean)lpAudioEffect->getEnabled();
|
if (lpAudioEffect->getEnabled()) {
|
||||||
|
return JNI_TRUE;
|
||||||
|
} else {
|
||||||
|
return JNI_FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -492,24 +496,24 @@ static jboolean
|
|||||||
android_media_AudioEffect_native_hasControl(JNIEnv *env, jobject thiz)
|
android_media_AudioEffect_native_hasControl(JNIEnv *env, jobject thiz)
|
||||||
{
|
{
|
||||||
// retrieve the AudioEffect object
|
// retrieve the AudioEffect object
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetIntField(
|
AudioEffect* lpAudioEffect = (AudioEffect *)env->GetLongField(
|
||||||
thiz, fields.fidNativeAudioEffect);
|
thiz, fields.fidNativeAudioEffect);
|
||||||
|
|
||||||
if (lpAudioEffect == NULL) {
|
if (lpAudioEffect == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalStateException",
|
jniThrowException(env, "java/lang/IllegalStateException",
|
||||||
"Unable to retrieve AudioEffect pointer for hasControl()");
|
"Unable to retrieve AudioEffect pointer for hasControl()");
|
||||||
return false;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpAudioEffect->initCheck() == NO_ERROR) {
|
if (lpAudioEffect->initCheck() == NO_ERROR) {
|
||||||
return true;
|
return JNI_TRUE;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint android_media_AudioEffect_native_setParameter(JNIEnv *env,
|
static jint android_media_AudioEffect_native_setParameter(JNIEnv *env,
|
||||||
jobject thiz, int psize, jbyteArray pJavaParam, int vsize,
|
jobject thiz, jint psize, jbyteArray pJavaParam, jint vsize,
|
||||||
jbyteArray pJavaValue) {
|
jbyteArray pJavaValue) {
|
||||||
// retrieve the AudioEffect object
|
// retrieve the AudioEffect object
|
||||||
jbyte* lpValue = NULL;
|
jbyte* lpValue = NULL;
|
||||||
@ -518,7 +522,7 @@ static jint android_media_AudioEffect_native_setParameter(JNIEnv *env,
|
|||||||
effect_param_t *p;
|
effect_param_t *p;
|
||||||
int voffset;
|
int voffset;
|
||||||
|
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *) env->GetIntField(thiz,
|
AudioEffect* lpAudioEffect = (AudioEffect *) env->GetLongField(thiz,
|
||||||
fields.fidNativeAudioEffect);
|
fields.fidNativeAudioEffect);
|
||||||
|
|
||||||
if (lpAudioEffect == NULL) {
|
if (lpAudioEffect == NULL) {
|
||||||
@ -567,7 +571,7 @@ setParameter_Exit:
|
|||||||
if (lpValue != NULL) {
|
if (lpValue != NULL) {
|
||||||
env->ReleasePrimitiveArrayCritical(pJavaValue, lpValue, 0);
|
env->ReleasePrimitiveArrayCritical(pJavaValue, lpValue, 0);
|
||||||
}
|
}
|
||||||
return translateError(lStatus);
|
return (jint) translateError(lStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
@ -581,7 +585,7 @@ android_media_AudioEffect_native_getParameter(JNIEnv *env,
|
|||||||
effect_param_t *p;
|
effect_param_t *p;
|
||||||
int voffset;
|
int voffset;
|
||||||
|
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *) env->GetIntField(thiz,
|
AudioEffect* lpAudioEffect = (AudioEffect *) env->GetLongField(thiz,
|
||||||
fields.fidNativeAudioEffect);
|
fields.fidNativeAudioEffect);
|
||||||
|
|
||||||
if (lpAudioEffect == NULL) {
|
if (lpAudioEffect == NULL) {
|
||||||
@ -637,7 +641,7 @@ getParameter_Exit:
|
|||||||
if (lStatus == NO_ERROR) {
|
if (lStatus == NO_ERROR) {
|
||||||
return vsize;
|
return vsize;
|
||||||
}
|
}
|
||||||
return translateError(lStatus);
|
return (jint) translateError(lStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint android_media_AudioEffect_native_command(JNIEnv *env, jobject thiz,
|
static jint android_media_AudioEffect_native_command(JNIEnv *env, jobject thiz,
|
||||||
@ -648,7 +652,7 @@ static jint android_media_AudioEffect_native_command(JNIEnv *env, jobject thiz,
|
|||||||
jint lStatus = AUDIOEFFECT_ERROR_BAD_VALUE;
|
jint lStatus = AUDIOEFFECT_ERROR_BAD_VALUE;
|
||||||
|
|
||||||
// retrieve the AudioEffect object
|
// retrieve the AudioEffect object
|
||||||
AudioEffect* lpAudioEffect = (AudioEffect *) env->GetIntField(thiz,
|
AudioEffect* lpAudioEffect = (AudioEffect *) env->GetLongField(thiz,
|
||||||
fields.fidNativeAudioEffect);
|
fields.fidNativeAudioEffect);
|
||||||
|
|
||||||
if (lpAudioEffect == NULL) {
|
if (lpAudioEffect == NULL) {
|
||||||
|
@ -231,7 +231,7 @@ static void captureCallback(void* user,
|
|||||||
|
|
||||||
static Visualizer *getVisualizer(JNIEnv* env, jobject thiz)
|
static Visualizer *getVisualizer(JNIEnv* env, jobject thiz)
|
||||||
{
|
{
|
||||||
Visualizer *v = (Visualizer *)env->GetIntField(
|
Visualizer *v = (Visualizer *)env->GetLongField(
|
||||||
thiz, fields.fidNativeVisualizer);
|
thiz, fields.fidNativeVisualizer);
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalStateException",
|
jniThrowException(env, "java/lang/IllegalStateException",
|
||||||
@ -282,7 +282,7 @@ android_media_visualizer_native_init(JNIEnv *env)
|
|||||||
// nativeTrackInJavaObj
|
// nativeTrackInJavaObj
|
||||||
fields.fidNativeVisualizer = env->GetFieldID(
|
fields.fidNativeVisualizer = env->GetFieldID(
|
||||||
fields.clazzEffect,
|
fields.clazzEffect,
|
||||||
"mNativeVisualizer", "I");
|
"mNativeVisualizer", "J");
|
||||||
if (fields.fidNativeVisualizer == NULL) {
|
if (fields.fidNativeVisualizer == NULL) {
|
||||||
ALOGE("Can't find Visualizer.%s", "mNativeVisualizer");
|
ALOGE("Can't find Visualizer.%s", "mNativeVisualizer");
|
||||||
return;
|
return;
|
||||||
@ -290,7 +290,7 @@ android_media_visualizer_native_init(JNIEnv *env)
|
|||||||
// fidJniData;
|
// fidJniData;
|
||||||
fields.fidJniData = env->GetFieldID(
|
fields.fidJniData = env->GetFieldID(
|
||||||
fields.clazzEffect,
|
fields.clazzEffect,
|
||||||
"mJniData", "I");
|
"mJniData", "J");
|
||||||
if (fields.fidJniData == NULL) {
|
if (fields.fidJniData == NULL) {
|
||||||
ALOGE("Can't find Visualizer.%s", "mJniData");
|
ALOGE("Can't find Visualizer.%s", "mJniData");
|
||||||
return;
|
return;
|
||||||
@ -391,9 +391,9 @@ android_media_visualizer_native_setup(JNIEnv *env, jobject thiz, jobject weak_th
|
|||||||
env->ReleasePrimitiveArrayCritical(jId, nId, 0);
|
env->ReleasePrimitiveArrayCritical(jId, nId, 0);
|
||||||
nId = NULL;
|
nId = NULL;
|
||||||
|
|
||||||
env->SetIntField(thiz, fields.fidNativeVisualizer, (int)lpVisualizer);
|
env->SetLongField(thiz, fields.fidNativeVisualizer, (jlong)lpVisualizer);
|
||||||
|
|
||||||
env->SetIntField(thiz, fields.fidJniData, (int)lpJniStorage);
|
env->SetLongField(thiz, fields.fidJniData, (jlong)lpJniStorage);
|
||||||
|
|
||||||
return VISUALIZER_SUCCESS;
|
return VISUALIZER_SUCCESS;
|
||||||
|
|
||||||
@ -407,33 +407,33 @@ setup_failure:
|
|||||||
if (lpVisualizer) {
|
if (lpVisualizer) {
|
||||||
delete lpVisualizer;
|
delete lpVisualizer;
|
||||||
}
|
}
|
||||||
env->SetIntField(thiz, fields.fidNativeVisualizer, 0);
|
env->SetLongField(thiz, fields.fidNativeVisualizer, 0);
|
||||||
|
|
||||||
if (lpJniStorage) {
|
if (lpJniStorage) {
|
||||||
delete lpJniStorage;
|
delete lpJniStorage;
|
||||||
}
|
}
|
||||||
env->SetIntField(thiz, fields.fidJniData, 0);
|
env->SetLongField(thiz, fields.fidJniData, 0);
|
||||||
|
|
||||||
return lStatus;
|
return (jint) lStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
static void android_media_visualizer_native_finalize(JNIEnv *env, jobject thiz) {
|
static void android_media_visualizer_native_finalize(JNIEnv *env, jobject thiz) {
|
||||||
ALOGV("android_media_visualizer_native_finalize jobject: %x\n", (int)thiz);
|
ALOGV("android_media_visualizer_native_finalize jobject: %p\n", thiz);
|
||||||
|
|
||||||
// delete the Visualizer object
|
// delete the Visualizer object
|
||||||
Visualizer* lpVisualizer = (Visualizer *)env->GetIntField(
|
Visualizer* lpVisualizer = (Visualizer *)env->GetLongField(
|
||||||
thiz, fields.fidNativeVisualizer);
|
thiz, fields.fidNativeVisualizer);
|
||||||
if (lpVisualizer) {
|
if (lpVisualizer) {
|
||||||
ALOGV("deleting Visualizer: %x\n", (int)lpVisualizer);
|
ALOGV("deleting Visualizer: %p\n", lpVisualizer);
|
||||||
delete lpVisualizer;
|
delete lpVisualizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete the JNI data
|
// delete the JNI data
|
||||||
visualizerJniStorage* lpJniStorage = (visualizerJniStorage *)env->GetIntField(
|
visualizerJniStorage* lpJniStorage = (visualizerJniStorage *)env->GetLongField(
|
||||||
thiz, fields.fidJniData);
|
thiz, fields.fidJniData);
|
||||||
if (lpJniStorage) {
|
if (lpJniStorage) {
|
||||||
ALOGV("deleting pJniStorage: %x\n", (int)lpJniStorage);
|
ALOGV("deleting pJniStorage: %p\n", lpJniStorage);
|
||||||
delete lpJniStorage;
|
delete lpJniStorage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -445,8 +445,8 @@ static void android_media_visualizer_native_release(JNIEnv *env, jobject thiz)
|
|||||||
android_media_visualizer_native_finalize(env, thiz);
|
android_media_visualizer_native_finalize(env, thiz);
|
||||||
// + reset the native resources in the Java object so any attempt to access
|
// + reset the native resources in the Java object so any attempt to access
|
||||||
// them after a call to release fails.
|
// them after a call to release fails.
|
||||||
env->SetIntField(thiz, fields.fidNativeVisualizer, 0);
|
env->SetLongField(thiz, fields.fidNativeVisualizer, 0);
|
||||||
env->SetIntField(thiz, fields.fidJniData, 0);
|
env->SetLongField(thiz, fields.fidJniData, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
@ -460,7 +460,7 @@ android_media_visualizer_native_setEnabled(JNIEnv *env, jobject thiz, jboolean e
|
|||||||
jint retVal = translateError(lpVisualizer->setEnabled(enabled));
|
jint retVal = translateError(lpVisualizer->setEnabled(enabled));
|
||||||
|
|
||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
visualizerJniStorage* lpJniStorage = (visualizerJniStorage *)env->GetIntField(
|
visualizerJniStorage* lpJniStorage = (visualizerJniStorage *)env->GetLongField(
|
||||||
thiz, fields.fidJniData);
|
thiz, fields.fidJniData);
|
||||||
|
|
||||||
if (NULL != lpJniStorage)
|
if (NULL != lpJniStorage)
|
||||||
@ -475,10 +475,14 @@ android_media_visualizer_native_getEnabled(JNIEnv *env, jobject thiz)
|
|||||||
{
|
{
|
||||||
Visualizer* lpVisualizer = getVisualizer(env, thiz);
|
Visualizer* lpVisualizer = getVisualizer(env, thiz);
|
||||||
if (lpVisualizer == NULL) {
|
if (lpVisualizer == NULL) {
|
||||||
return false;
|
return JNI_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (jboolean)lpVisualizer->getEnabled();
|
if (lpVisualizer->getEnabled()) {
|
||||||
|
return JNI_TRUE;
|
||||||
|
} else {
|
||||||
|
return JNI_FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static jintArray
|
static jintArray
|
||||||
@ -496,7 +500,7 @@ android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject thiz)
|
|||||||
static jint
|
static jint
|
||||||
android_media_visualizer_native_getMaxCaptureRate(JNIEnv *env, jobject thiz)
|
android_media_visualizer_native_getMaxCaptureRate(JNIEnv *env, jobject thiz)
|
||||||
{
|
{
|
||||||
return Visualizer::getMaxCaptureRate();
|
return (jint) Visualizer::getMaxCaptureRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
@ -517,7 +521,7 @@ android_media_visualizer_native_getCaptureSize(JNIEnv *env, jobject thiz)
|
|||||||
if (lpVisualizer == NULL) {
|
if (lpVisualizer == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return lpVisualizer->getCaptureSize();
|
return (jint) lpVisualizer->getCaptureSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
@ -538,7 +542,7 @@ android_media_visualizer_native_getScalingMode(JNIEnv *env, jobject thiz)
|
|||||||
if (lpVisualizer == NULL) {
|
if (lpVisualizer == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return lpVisualizer->getScalingMode();
|
return (jint)lpVisualizer->getScalingMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
@ -568,7 +572,7 @@ android_media_visualizer_native_getSamplingRate(JNIEnv *env, jobject thiz)
|
|||||||
if (lpVisualizer == NULL) {
|
if (lpVisualizer == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return lpVisualizer->getSamplingRate();
|
return (jint) lpVisualizer->getSamplingRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
@ -634,7 +638,7 @@ android_media_setPeriodicCapture(JNIEnv *env, jobject thiz, jint rate, jboolean
|
|||||||
if (lpVisualizer == NULL) {
|
if (lpVisualizer == NULL) {
|
||||||
return VISUALIZER_ERROR_NO_INIT;
|
return VISUALIZER_ERROR_NO_INIT;
|
||||||
}
|
}
|
||||||
visualizerJniStorage* lpJniStorage = (visualizerJniStorage *)env->GetIntField(thiz,
|
visualizerJniStorage* lpJniStorage = (visualizerJniStorage *)env->GetLongField(thiz,
|
||||||
fields.fidJniData);
|
fields.fidJniData);
|
||||||
if (lpJniStorage == NULL) {
|
if (lpJniStorage == NULL) {
|
||||||
return VISUALIZER_ERROR_NO_INIT;
|
return VISUALIZER_ERROR_NO_INIT;
|
||||||
|
Reference in New Issue
Block a user