summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAshok Bhat <ashok.bhat@arm.com>2013-12-17 14:13:08 +0000
committerNarayan Kamath <narayan@google.com>2014-01-07 12:49:41 +0000
commit44ba5c1b4ef33ff50dacb2eb5553d01405e77f4d (patch)
tree1c84566cb6974d644a0771efadc085a74329ab0b /media
parent670327544184dbd6274de9127ceaf20dfd5801b4 (diff)
downloadframeworks_base-44ba5c1b4ef33ff50dacb2eb5553d01405e77f4d.zip
frameworks_base-44ba5c1b4ef33ff50dacb2eb5553d01405e77f4d.tar.gz
frameworks_base-44ba5c1b4ef33ff50dacb2eb5553d01405e77f4d.tar.bz2
AArch64: Use long for pointers in VideoEditor classes
For storing pointers, long is used in VideoEditor classes, as native pointers can be 64-bit. In addition, some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Change-Id: Ifff3a28f2ab6774ee89d31770ad63451c8726431 Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/videoeditor/MediaArtistNativeHelper.java2
-rw-r--r--media/jni/mediaeditor/VideoEditorClasses.cpp16
-rw-r--r--media/jni/mediaeditor/VideoEditorMain.cpp56
3 files changed, 37 insertions, 37 deletions
diff --git a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
index f4fccbe..2b0b3e2 100644
--- a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
+++ b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java
@@ -118,7 +118,7 @@ class MediaArtistNativeHelper {
private boolean mErrorFlagSet = false;
@SuppressWarnings("unused")
- private int mManualEditContext;
+ private long mManualEditContext;
/* Listeners */
diff --git a/media/jni/mediaeditor/VideoEditorClasses.cpp b/media/jni/mediaeditor/VideoEditorClasses.cpp
index d8099dd..d29fad3 100644
--- a/media/jni/mediaeditor/VideoEditorClasses.cpp
+++ b/media/jni/mediaeditor/VideoEditorClasses.cpp
@@ -609,7 +609,7 @@ VIDEOEDIT_JAVA_DEFINE_FIELD_CLASS(EffectSettings, EFFECT_SETTINGS_CLASS_NAME)
VIDEOEDIT_JAVA_DEFINE_FIELDS(Engine)
{
- VIDEOEDIT_JAVA_FIELD_INIT("mManualEditContext", "I")
+ VIDEOEDIT_JAVA_FIELD_INIT("mManualEditContext", "J")
};
VIDEOEDIT_JAVA_DEFINE_FIELD_CLASS(Engine, MANUAL_EDIT_ENGINE_CLASS_NAME)
@@ -3096,7 +3096,7 @@ videoEditClasses_getContext(
if (*pResult)
{
// Retrieve the context pointer.
- pContext = (void *)pEnv->GetIntField(object, fieldIds.context);
+ pContext = (void *)pEnv->GetLongField(object, fieldIds.context);
}
// Return the context pointer.
@@ -3132,15 +3132,15 @@ videoEditClasses_setContext(
{
// Set the context field.
VIDEOEDIT_LOG_FUNCTION(ANDROID_LOG_INFO, "VIDEO_EDITOR_CLASSES",
- "The context value from JAVA before setting is = 0x%x",
- pEnv->GetIntField(object, fieldIds.context));
+ "The context value from JAVA before setting is = %p",
+ (void *)pEnv->GetLongField(object, fieldIds.context));
- pEnv->SetIntField(object, fieldIds.context, (int)pContext);
- M4OSA_TRACE1_1("The context value in JNI is = 0x%x",pContext);
+ pEnv->SetLongField(object, fieldIds.context, (jlong)pContext);
+ M4OSA_TRACE1_1("The context value in JNI is = %p",pContext);
VIDEOEDIT_LOG_FUNCTION(ANDROID_LOG_INFO, "VIDEO_EDITOR_CLASSES",
- "The context value from JAVA after setting is = 0x%x",
- pEnv->GetIntField(object, fieldIds.context));
+ "The context value from JAVA after setting is = %p",
+ (void *)pEnv->GetLongField(object, fieldIds.context));
}
}
diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp
index c1ad516..058012b 100644
--- a/media/jni/mediaeditor/VideoEditorMain.cpp
+++ b/media/jni/mediaeditor/VideoEditorMain.cpp
@@ -170,7 +170,7 @@ static void videoEditor_stopEncoding(
static void videoEditor_release(
JNIEnv* pEnv,
jobject thiz);
-static int videoEditor_getPixels(
+static jint videoEditor_getPixels(
JNIEnv* env,
jobject thiz,
jstring path,
@@ -178,7 +178,7 @@ static int videoEditor_getPixels(
M4OSA_UInt32 width,
M4OSA_UInt32 height,
M4OSA_UInt32 timeMS);
-static int videoEditor_getPixelsList(
+static jint videoEditor_getPixelsList(
JNIEnv* env,
jobject thiz,
jstring path,
@@ -209,7 +209,7 @@ videoEditor_populateSettings(
jobject object,
jobject audioSettingObject);
-static int videoEditor_stopPreview(JNIEnv* pEnv,
+static jint videoEditor_stopPreview(JNIEnv* pEnv,
jobject thiz);
static jobject
@@ -218,7 +218,7 @@ videoEditor_getProperties(
jobject thiz,
jstring file);
-static int videoEditor_renderPreviewFrame(JNIEnv* pEnv,
+static jint videoEditor_renderPreviewFrame(JNIEnv* pEnv,
jobject thiz,
jobject mSurface,
jlong fromMs,
@@ -231,7 +231,7 @@ static int videoEditor_registerManualEditMethods(
static void jniPreviewProgressCallback(void* cookie, M4OSA_UInt32 msgType,
void *argc);
-static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
+static jint videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
jobject thiz,
jobject mSurface,
jstring filePath,
@@ -241,7 +241,7 @@ static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
jint surfaceHeight,
jlong fromMs);
-static int videoEditor_generateAudioWaveFormSync ( JNIEnv* pEnv,
+static jint videoEditor_generateAudioWaveFormSync ( JNIEnv* pEnv,
jobject thiz,
jstring pcmfilePath,
jstring outGraphfilePath,
@@ -258,7 +258,7 @@ M4OSA_ERR videoEditor_generateAudio(JNIEnv* pEnv,ManualEditContext* pContext,
M4OSA_Char* infilePath,
M4OSA_Char* pcmfilePath );
-static int
+static jint
videoEditor_generateClip(
JNIEnv* pEnv,
jobject thiz,
@@ -572,7 +572,7 @@ static M4OSA_ERR checkClipVideoProfileAndLevel(M4DECODER_VideoDecoders *pDecoder
return result;
}
-static int videoEditor_stopPreview(JNIEnv* pEnv,
+static jint videoEditor_stopPreview(JNIEnv* pEnv,
jobject thiz)
{
ManualEditContext* pContext = M4OSA_NULL;
@@ -594,7 +594,7 @@ static int videoEditor_stopPreview(JNIEnv* pEnv,
pContext->mOverlayFileName = NULL;
}
- return lastProgressTimeMs;
+ return (jint)lastProgressTimeMs;
}
static void videoEditor_clearSurface(JNIEnv* pEnv,
@@ -654,7 +654,7 @@ static void videoEditor_clearSurface(JNIEnv* pEnv,
}
-static int videoEditor_renderPreviewFrame(JNIEnv* pEnv,
+static jint videoEditor_renderPreviewFrame(JNIEnv* pEnv,
jobject thiz,
jobject mSurface,
jlong fromMs,
@@ -976,10 +976,10 @@ static int videoEditor_renderPreviewFrame(JNIEnv* pEnv,
free(yuvPlane);
}
- return tnTimeMs;
+ return (jint)tnTimeMs;
}
-static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
+static jint videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
jobject thiz,
jobject mSurface,
jstring filePath,
@@ -1033,7 +1033,7 @@ static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
/* get thumbnail*/
result = ThumbnailOpen(&tnContext,(const M4OSA_Char*)pString, M4OSA_TRUE);
if (result != M4NO_ERROR || tnContext == M4OSA_NULL) {
- return timeMs;
+ return (jint)timeMs;
}
framesizeYuv = ((frameWidth)*(frameHeight)*1.5);
@@ -1046,7 +1046,7 @@ static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
ThumbnailClose(tnContext);
pMessage = videoEditJava_getErrorName(M4ERR_ALLOC);
jniThrowException(pEnv, "java/lang/RuntimeException", pMessage);
- return timeMs;
+ return (jint)timeMs;
}
result = ThumbnailGetPixels16(tnContext, (M4OSA_Int16 *)pixelArray,
@@ -1055,7 +1055,7 @@ static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
if (result != M4NO_ERROR) {
free(pixelArray);
ThumbnailClose(tnContext);
- return fromMs;
+ return (jint)fromMs;
}
#ifdef DUMPTOFILESYSTEM
@@ -1131,10 +1131,10 @@ static int videoEditor_renderMediaItemPreviewFrame(JNIEnv* pEnv,
pEnv->ReleaseStringUTFChars(filePath, pString);
}
- return timeMs;
+ return (jint)timeMs;
}
-int videoEditor_generateAudioRawFile( JNIEnv* pEnv,
+jint videoEditor_generateAudioRawFile( JNIEnv* pEnv,
jobject thiz,
jstring infilePath,
jstring pcmfilePath)
@@ -1178,7 +1178,7 @@ int videoEditor_generateAudioRawFile( JNIEnv* pEnv,
pEnv->ReleaseStringUTFChars(pcmfilePath, pStringOutPCMFilePath);
}
- return result;
+ return (jint)result;
}
M4OSA_ERR videoEditor_generateAudio(JNIEnv* pEnv,ManualEditContext* pContext,
@@ -2182,7 +2182,7 @@ videoEditor_getProperties(
return object;
}
-static int videoEditor_getPixels(
+static jint videoEditor_getPixels(
JNIEnv* env,
jobject thiz,
jstring path,
@@ -2234,10 +2234,10 @@ static int videoEditor_getPixels(
env->ReleaseStringUTFChars(path, pString);
}
- return timeMS;
+ return (jint)timeMS;
}
-static int videoEditor_getPixelsList(
+static jint videoEditor_getPixelsList(
JNIEnv* env,
jobject thiz,
jstring path,
@@ -2257,7 +2257,7 @@ static int videoEditor_getPixelsList(
const char *pString = env->GetStringUTFChars(path, NULL);
if (pString == M4OSA_NULL) {
jniThrowException(env, "java/lang/RuntimeException", "Input string null");
- return M4ERR_ALLOC;
+ return (jint)M4ERR_ALLOC;
}
err = ThumbnailOpen(&mContext,(const M4OSA_Char*)pString, M4OSA_FALSE);
@@ -2266,7 +2266,7 @@ static int videoEditor_getPixelsList(
if (pString != NULL) {
env->ReleaseStringUTFChars(path, pString);
}
- return err;
+ return (jint)err;
}
jlong duration = (endTime - startTime);
@@ -2307,7 +2307,7 @@ static int videoEditor_getPixelsList(
"ThumbnailGetPixels32 failed");
}
- return err;
+ return (jint)err;
}
static M4OSA_ERR
@@ -2892,7 +2892,7 @@ M4OSA_ERR videoEditor_processClip(
}
/*+ PROGRESS CB */
-static int
+static jint
videoEditor_generateClip(
JNIEnv* pEnv,
jobject thiz,
@@ -2934,7 +2934,7 @@ videoEditor_generateClip(
}
ALOGV("videoEditor_generateClip END 0x%x", (unsigned int) result);
- return result;
+ return (jint)result;
}
static void
@@ -3556,7 +3556,7 @@ M4OSA_ERR M4MA_generateAudioGraphFile(JNIEnv* pEnv, M4OSA_Char* pInputFileURL,
return err;
}
-static int videoEditor_generateAudioWaveFormSync (JNIEnv* pEnv, jobject thiz,
+static jint videoEditor_generateAudioWaveFormSync (JNIEnv* pEnv, jobject thiz,
jstring pcmfilePath,
jstring outGraphfilePath,
jint frameDuration, jint channels,
@@ -3619,7 +3619,7 @@ out:
VIDEOEDIT_LOG_FUNCTION(ANDROID_LOG_INFO, "VIDEO_EDITOR",
"videoEditor_generateAudioWaveFormSync pContext->bSkipState ");
- return result;
+ return (jint)result;
}
/******** End Audio Graph *******/