Loading media/java/android/media/videoeditor/MediaArtistNativeHelper.java +2 −3 Original line number Diff line number Diff line Loading @@ -3065,8 +3065,7 @@ class MediaArtistNativeHelper { * This function is responsible for stopping the preview */ long stopPreview() { nativeStopPreview(); return mPreviewProgress; return nativeStopPreview(); } /** Loading Loading @@ -3999,7 +3998,7 @@ class MediaArtistNativeHelper { int framewidth, int frameheight, int surfacewidth, int surfaceheight, long timeMs) throws IllegalArgumentException, IllegalStateException, RuntimeException; private native void nativeStopPreview(); private native int nativeStopPreview(); private native int nativeGenerateAudioGraph(String pcmFilePath, String outGraphPath, int frameDuration, int channels, int sampleCount); Loading media/jni/mediaeditor/VideoEditorMain.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ videoEditor_populateSettings( jobject object, jobject audioSettingObject); static void videoEditor_stopPreview(JNIEnv* pEnv, static int videoEditor_stopPreview(JNIEnv* pEnv, jobject thiz); static jobject Loading Loading @@ -283,8 +283,8 @@ static JNINativeMethod gManualEditMethods[] = { {"nativeRenderMediaItemPreviewFrame", "(Landroid/view/Surface;Ljava/lang/String;IIIIJ)I", (int *)videoEditor_renderMediaItemPreviewFrame }, {"nativeStopPreview", "()V", (void *)videoEditor_stopPreview }, {"nativeStopPreview", "()I", (int *)videoEditor_stopPreview }, {"stopEncoding", "()V", (void *)videoEditor_stopEncoding }, {"release", "()V", Loading Loading @@ -482,11 +482,13 @@ static void jniPreviewProgressCallback (void* cookie, M4OSA_UInt32 msgType, pContext->pVM->DetachCurrentThread(); } static void videoEditor_stopPreview(JNIEnv* pEnv, static int videoEditor_stopPreview(JNIEnv* pEnv, jobject thiz) { ManualEditContext* pContext = M4OSA_NULL; bool needToBeLoaded = true; M4OSA_UInt32 lastProgressTimeMs = 0; // Get the context. pContext = (ManualEditContext*)videoEditClasses_getContext(&needToBeLoaded, pEnv, thiz); Loading @@ -495,12 +497,14 @@ static void videoEditor_stopPreview(JNIEnv* pEnv, videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv, (M4OSA_NULL == pContext), "not initialized"); pContext->mPreviewController->stopPreview(); lastProgressTimeMs = pContext->mPreviewController->stopPreview(); if (pContext->mOverlayFileName != NULL) { M4OSA_free((M4OSA_MemAddr32)pContext->mOverlayFileName); pContext->mOverlayFileName = NULL; } return lastProgressTimeMs; } static void videoEditor_clearSurface(JNIEnv* pEnv, Loading Loading
media/java/android/media/videoeditor/MediaArtistNativeHelper.java +2 −3 Original line number Diff line number Diff line Loading @@ -3065,8 +3065,7 @@ class MediaArtistNativeHelper { * This function is responsible for stopping the preview */ long stopPreview() { nativeStopPreview(); return mPreviewProgress; return nativeStopPreview(); } /** Loading Loading @@ -3999,7 +3998,7 @@ class MediaArtistNativeHelper { int framewidth, int frameheight, int surfacewidth, int surfaceheight, long timeMs) throws IllegalArgumentException, IllegalStateException, RuntimeException; private native void nativeStopPreview(); private native int nativeStopPreview(); private native int nativeGenerateAudioGraph(String pcmFilePath, String outGraphPath, int frameDuration, int channels, int sampleCount); Loading
media/jni/mediaeditor/VideoEditorMain.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ videoEditor_populateSettings( jobject object, jobject audioSettingObject); static void videoEditor_stopPreview(JNIEnv* pEnv, static int videoEditor_stopPreview(JNIEnv* pEnv, jobject thiz); static jobject Loading Loading @@ -283,8 +283,8 @@ static JNINativeMethod gManualEditMethods[] = { {"nativeRenderMediaItemPreviewFrame", "(Landroid/view/Surface;Ljava/lang/String;IIIIJ)I", (int *)videoEditor_renderMediaItemPreviewFrame }, {"nativeStopPreview", "()V", (void *)videoEditor_stopPreview }, {"nativeStopPreview", "()I", (int *)videoEditor_stopPreview }, {"stopEncoding", "()V", (void *)videoEditor_stopEncoding }, {"release", "()V", Loading Loading @@ -482,11 +482,13 @@ static void jniPreviewProgressCallback (void* cookie, M4OSA_UInt32 msgType, pContext->pVM->DetachCurrentThread(); } static void videoEditor_stopPreview(JNIEnv* pEnv, static int videoEditor_stopPreview(JNIEnv* pEnv, jobject thiz) { ManualEditContext* pContext = M4OSA_NULL; bool needToBeLoaded = true; M4OSA_UInt32 lastProgressTimeMs = 0; // Get the context. pContext = (ManualEditContext*)videoEditClasses_getContext(&needToBeLoaded, pEnv, thiz); Loading @@ -495,12 +497,14 @@ static void videoEditor_stopPreview(JNIEnv* pEnv, videoEditJava_checkAndThrowIllegalStateException(&needToBeLoaded, pEnv, (M4OSA_NULL == pContext), "not initialized"); pContext->mPreviewController->stopPreview(); lastProgressTimeMs = pContext->mPreviewController->stopPreview(); if (pContext->mOverlayFileName != NULL) { M4OSA_free((M4OSA_MemAddr32)pContext->mOverlayFileName); pContext->mOverlayFileName = NULL; } return lastProgressTimeMs; } static void videoEditor_clearSurface(JNIEnv* pEnv, Loading