diff options
| -rw-r--r-- | core/java/android/inputmethodservice/KeyboardView.java | 33 | ||||
| -rw-r--r-- | libs/rs/driver/rsdGL.cpp | 6 | ||||
| -rw-r--r-- | libs/rs/driver/rsdRuntimeStubs.cpp | 1 | ||||
| -rwxr-xr-x | media/jni/mediaeditor/VideoBrowserMain.c | 6 | ||||
| -rwxr-xr-x | media/jni/mediaeditor/VideoEditorJava.cpp | 2 | ||||
| -rwxr-xr-x | media/jni/mediaeditor/VideoEditorMain.cpp | 57 | ||||
| -rwxr-xr-x | media/jni/mediaeditor/VideoEditorOsal.cpp | 2 | ||||
| -rwxr-xr-x | media/jni/mediaeditor/VideoEditorPropertiesMain.cpp | 10 | ||||
| -rwxr-xr-x | media/jni/mediaeditor/VideoEditorThumbnailMain.cpp | 4 |
9 files changed, 59 insertions, 62 deletions
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java index ab5c78a92078..dfc70ef416af 100644 --- a/core/java/android/inputmethodservice/KeyboardView.java +++ b/core/java/android/inputmethodservice/KeyboardView.java @@ -142,7 +142,8 @@ public class KeyboardView extends View implements View.OnClickListener { private int mPreviewTextSizeLarge; private int mPreviewOffset; private int mPreviewHeight; - private int[] mOffsetInWindow; + // Working variable + private final int[] mCoordinates = new int[2]; private PopupWindow mPopupKeyboard; private View mMiniKeyboardContainer; @@ -152,7 +153,6 @@ public class KeyboardView extends View implements View.OnClickListener { private int mMiniKeyboardOffsetX; private int mMiniKeyboardOffsetY; private Map<Key,View> mMiniKeyboardCache; - private int[] mWindowOffset; private Key[] mKeys; /** Listener for {@link OnKeyboardActionListener}. */ @@ -905,23 +905,19 @@ public class KeyboardView extends View implements View.OnClickListener { mPopupPreviewY = - mPreviewText.getMeasuredHeight(); } mHandler.removeMessages(MSG_REMOVE_PREVIEW); - if (mOffsetInWindow == null) { - mOffsetInWindow = new int[2]; - getLocationInWindow(mOffsetInWindow); - mOffsetInWindow[0] += mMiniKeyboardOffsetX; // Offset may be zero - mOffsetInWindow[1] += mMiniKeyboardOffsetY; // Offset may be zero - int[] mWindowLocation = new int[2]; - getLocationOnScreen(mWindowLocation); - mWindowY = mWindowLocation[1]; - } + getLocationInWindow(mCoordinates); + mCoordinates[0] += mMiniKeyboardOffsetX; // Offset may be zero + mCoordinates[1] += mMiniKeyboardOffsetY; // Offset may be zero + // Set the preview background state mPreviewText.getBackground().setState( key.popupResId != 0 ? LONG_PRESSABLE_STATE_SET : EMPTY_STATE_SET); - mPopupPreviewX += mOffsetInWindow[0]; - mPopupPreviewY += mOffsetInWindow[1]; + mPopupPreviewX += mCoordinates[0]; + mPopupPreviewY += mCoordinates[1]; // If the popup cannot be shown above the key, put it on the side - if (mPopupPreviewY + mWindowY < 0) { + getLocationOnScreen(mCoordinates); + if (mPopupPreviewY + mCoordinates[1] < 0) { // If the key you're pressing is on the left side of the keyboard, show the popup on // the right, offset by enough to see at least one key to the left/right. if (key.x + key.width <= getWidth() / 2) { @@ -1057,16 +1053,13 @@ public class KeyboardView extends View implements View.OnClickListener { mMiniKeyboard = (KeyboardView) mMiniKeyboardContainer.findViewById( com.android.internal.R.id.keyboardView); } - if (mWindowOffset == null) { - mWindowOffset = new int[2]; - getLocationInWindow(mWindowOffset); - } + getLocationInWindow(mCoordinates); mPopupX = popupKey.x + mPaddingLeft; mPopupY = popupKey.y + mPaddingTop; mPopupX = mPopupX + popupKey.width - mMiniKeyboardContainer.getMeasuredWidth(); mPopupY = mPopupY - mMiniKeyboardContainer.getMeasuredHeight(); - final int x = mPopupX + mMiniKeyboardContainer.getPaddingRight() + mWindowOffset[0]; - final int y = mPopupY + mMiniKeyboardContainer.getPaddingBottom() + mWindowOffset[1]; + final int x = mPopupX + mMiniKeyboardContainer.getPaddingRight() + mCoordinates[0]; + final int y = mPopupY + mMiniKeyboardContainer.getPaddingBottom() + mCoordinates[1]; mMiniKeyboard.setPopupOffset(x < 0 ? 0 : x, y); mMiniKeyboard.setShifted(isShifted()); mPopupKeyboard.setContentView(mMiniKeyboardContainer); diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index 6238edd6f642..26e1bdf4fa27 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -197,7 +197,9 @@ bool rsdGLInit(const Context *rsc) { LOGE("%p, couldn't find an EGLConfig matching the screen format\n", rsc); } //if (props.mLogVisual) { + if (0) { printEGLConfiguration(dc->gl.egl.display, dc->gl.egl.config); + } //} dc->gl.egl.context = eglCreateContext(dc->gl.egl.display, dc->gl.egl.config, @@ -281,7 +283,9 @@ bool rsdGLInit(const Context *rsc) { glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &dc->gl.gl.EXT_texture_max_aniso); } - DumpDebug(dc); + if (0) { + DumpDebug(dc); + } LOGV("initGLThread end %p", rsc); return true; diff --git a/libs/rs/driver/rsdRuntimeStubs.cpp b/libs/rs/driver/rsdRuntimeStubs.cpp index c16dd314539c..e384713b94e6 100644 --- a/libs/rs/driver/rsdRuntimeStubs.cpp +++ b/libs/rs/driver/rsdRuntimeStubs.cpp @@ -43,7 +43,6 @@ using namespace android::renderscript; ////////////////////////////////////////////////////////////////////////////// static uint32_t SC_allocGetDimX(Allocation *a) { - LOGE("SC_allocGetDimX %p", a); return a->mHal.state.dimensionX; } diff --git a/media/jni/mediaeditor/VideoBrowserMain.c b/media/jni/mediaeditor/VideoBrowserMain.c index caf44975d54e..cddab601a57c 100755 --- a/media/jni/mediaeditor/VideoBrowserMain.c +++ b/media/jni/mediaeditor/VideoBrowserMain.c @@ -159,15 +159,15 @@ M4OSA_ERR videoBrowserCreate( VIDEOBROWSER, (M4OSA_Char*)"Video browser context"); CHECK_PTR(videoBrowserCreate, pContext,err, M4ERR_ALLOC); - M4OSA_memset((M4OSA_MemAddr8)pContext, sizeof(VideoBrowserContext), 0); + memset((void *)pContext, 0,sizeof(VideoBrowserContext)); /*--- Initialize the context parameters ---*/ pContext->m_state = VideoBrowser_kVBCreating ; pContext->m_frameColorType = clrType; /*--- Copy the file reader functions ---*/ - M4OSA_memcpy((M4OSA_MemAddr8)&pContext->m_fileReadPtr, - (M4OSA_MemAddr8)ptrF, + memcpy((void *)&pContext->m_fileReadPtr, + (void *)ptrF, sizeof(M4OSA_FileReadPointer)) ; /* PR#SP00013 DGR bug 13 : first frame is not visible */ diff --git a/media/jni/mediaeditor/VideoEditorJava.cpp b/media/jni/mediaeditor/VideoEditorJava.cpp index 884256ae5ddb..13f63505484b 100755 --- a/media/jni/mediaeditor/VideoEditorJava.cpp +++ b/media/jni/mediaeditor/VideoEditorJava.cpp @@ -339,7 +339,7 @@ videoEditJava_getString( { // Determine the length of the path // (add one extra character for the zero terminator). - length = M4OSA_chrLength(pLocal) + 1; + length = strlen((const char *)pLocal) + 1; // Allocate memory for the string. pString = videoEditOsal_alloc(pResult, pEnv, length, "String"); diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp index 11e2a5eb076a..b79229539eeb 100755 --- a/media/jni/mediaeditor/VideoEditorMain.cpp +++ b/media/jni/mediaeditor/VideoEditorMain.cpp @@ -780,7 +780,7 @@ static int videoEditor_renderPreviewFrame(JNIEnv* pEnv, { M4OSA_Context fileContext; M4OSA_Char* fileName = (M4OSA_Char*)"/mnt/sdcard/FirstRGB565.raw"; - M4OSA_fileExtraDelete((const M4OSA_Char *)fileName); + remove((const char *)fileName); M4OSA_fileWriteOpen(&fileContext, (M4OSA_Void*) fileName,\ M4OSA_kFileWrite|M4OSA_kFileCreate); M4OSA_fileWriteData(fileContext, (M4OSA_MemAddr8) pixelArray, @@ -826,7 +826,7 @@ static int videoEditor_renderPreviewFrame(JNIEnv* pEnv, { M4OSA_Context fileContext; M4OSA_Char* fileName = (M4OSA_Char*)"/mnt/sdcard/ConvertedYuv.yuv"; - M4OSA_fileExtraDelete((const M4OSA_Char *)fileName); + remove((const char *)fileName); M4OSA_fileWriteOpen(&fileContext, (M4OSA_Void*) fileName,\ M4OSA_kFileWrite|M4OSA_kFileCreate); M4OSA_fileWriteData(fileContext, @@ -1188,19 +1188,19 @@ M4OSA_ERR videoEditor_generateAudio(JNIEnv* pEnv,ManualEditContext* pContext, // generate the path for temp 3gp output file pTemp3gpFilePath = (M4OSA_Char*) M4OSA_malloc ( - (M4OSA_chrLength((M4OSA_Char*)pContext->initParams.pTempPath) - + M4OSA_chrLength ((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH)) + 1 /* for null termination */ , 0x0, - (M4OSA_Char*) "Malloc for temp 3gp file"); - if ( pTemp3gpFilePath != M4OSA_NULL ) + (strlen((const char*)pContext->initParams.pTempPath) + + strlen((const char*)TEMP_MCS_OUT_FILE_PATH)) + 1 /* for null termination */ , 0x0, + (M4OSA_Char*)"Malloc for temp 3gp file"); + if (pTemp3gpFilePath != M4OSA_NULL) { - M4OSA_memset(pTemp3gpFilePath , - M4OSA_chrLength((M4OSA_Char*)pContext->initParams.pTempPath) - + M4OSA_chrLength((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH) + 1, 0); - M4OSA_chrNCat ( (M4OSA_Char*)pTemp3gpFilePath, - (M4OSA_Char*)pContext->initParams.pTempPath , - M4OSA_chrLength ((M4OSA_Char*)pContext->initParams.pTempPath)); - M4OSA_chrNCat ( pTemp3gpFilePath , (M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH, - M4OSA_chrLength ((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH)); + memset((void *)pTemp3gpFilePath ,0, + strlen((const char*)pContext->initParams.pTempPath) + + strlen((const char*)TEMP_MCS_OUT_FILE_PATH) + 1); + strncat((char *)pTemp3gpFilePath, + (const char *)pContext->initParams.pTempPath , + (size_t) ((M4OSA_Char*)pContext->initParams.pTempPath)); + strncat((char *)pTemp3gpFilePath , (const char *)TEMP_MCS_OUT_FILE_PATH, + (size_t)strlen ((const char*)TEMP_MCS_OUT_FILE_PATH)); } else { M4MCS_abort(mcsContext); @@ -1219,7 +1219,7 @@ M4OSA_ERR videoEditor_generateAudio(JNIEnv* pEnv,ManualEditContext* pContext, pInputFileType = (M4VIDEOEDITING_FileType)pContext->mAudioSettings->fileType; VIDEOEDIT_LOG_API(ANDROID_LOG_INFO, "VIDEO_EDITOR", "TEMP_MCS_OUT_FILE_PATH len %d", - M4OSA_chrLength ((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH)); + strlen ((const char*)TEMP_MCS_OUT_FILE_PATH)); VIDEOEDIT_LOG_API(ANDROID_LOG_INFO, "VIDEO_EDITOR", "pTemp3gpFilePath %s", pOutputFile); @@ -1395,7 +1395,7 @@ M4OSA_ERR videoEditor_generateAudio(JNIEnv* pEnv,ManualEditContext* pContext, (M4NO_ERROR != result), result); //pContext->mAudioSettings->pFile = pOutputParams->pOutputPCMfile; - M4OSA_fileExtraDelete((const M4OSA_Char *) pTemp3gpFilePath); + remove((const char *) pTemp3gpFilePath); VIDEOEDIT_LOG_FUNCTION(ANDROID_LOG_INFO, "VIDEO_EDITOR", "videoEditor_generateAudio() EXIT "); if (pTemp3gpFilePath != M4OSA_NULL) { @@ -1709,9 +1709,9 @@ videoEditor_populateSettings( goto videoEditor_populateSettings_cleanup; } - M4OSA_memcpy((M4OSA_Int8 *)&pContext->pEditSettings->\ + memcpy((void *)&pContext->pEditSettings->\ Effects[j].xVSS.pFramingBuffer->\ - pac_data[0],(M4OSA_Int8 *)&aFramingCtx->FramingRgb->pac_data[0],(width*height*2)); + pac_data[0],(void *)&aFramingCtx->FramingRgb->pac_data[0],(width*height*2)); //As of now rgb type is 565 pContext->pEditSettings->Effects[j].xVSS.rgbType = @@ -1854,8 +1854,8 @@ videoEditor_populateSettings( (M4OSA_UInt32)(strlen((const char*)pTempChar))+1 /* +1 for NULL termination */, 0, (M4OSA_Char*)"strPath allocation " ); if (pContext->mAudioSettings->pFile != M4OSA_NULL) { - M4OSA_memcpy((M4OSA_Int8 *)pContext->mAudioSettings->pFile , - (M4OSA_Int8 *)pTempChar , strlen((const char*)pTempChar)); + memcpy((void *)pContext->mAudioSettings->pFile , + (void *)pTempChar , strlen((const char*)pTempChar)); ((M4OSA_Int8 *)(pContext->mAudioSettings->pFile))[strlen((const char*)pTempChar)] = '\0'; pEnv->ReleaseStringUTFChars(strPath,(const char *)pTempChar); } else { @@ -1879,8 +1879,8 @@ videoEditor_populateSettings( (M4OSA_UInt32)(strlen((const char*)pTempChar))+1 /* +1 for NULL termination */, 0, (M4OSA_Char*)"strPCMPath allocation " ); if (pContext->mAudioSettings->pPCMFilePath != M4OSA_NULL) { - M4OSA_memcpy((M4OSA_Int8 *)pContext->mAudioSettings->pPCMFilePath , - (M4OSA_Int8 *)pTempChar , strlen((const char*)pTempChar)); + memcpy((void *)pContext->mAudioSettings->pPCMFilePath , + (void *)pTempChar , strlen((const char*)pTempChar)); ((M4OSA_Int8 *)(pContext->mAudioSettings->pPCMFilePath))[strlen((const char*)pTempChar)] = '\0'; pEnv->ReleaseStringUTFChars(strPCMPath,(const char *)pTempChar); } else { @@ -2237,7 +2237,7 @@ videoEditor_toUTF8Fct( // Determine the length of the input buffer. if (M4OSA_NULL != pBufferIn) { - length = M4OSA_chrLength((M4OSA_Char *)pBufferIn); + length = strlen((const char *)pBufferIn); } // Check if the output buffer is large enough to hold the input buffer. @@ -2282,7 +2282,7 @@ videoEditor_fromUTF8Fct( // Determine the length of the input buffer. if (M4OSA_NULL != pBufferIn) { - length = M4OSA_chrLength((M4OSA_Char *)pBufferIn); + length = strlen((const char *)pBufferIn); } // Check if the output buffer is large enough to hold the input buffer. @@ -2498,13 +2498,14 @@ videoEditor_init( (M4OSA_Char *)videoEditJava_getString(&initialized, pEnv, tempPath, NULL, M4OSA_NULL); pContext->initParams.pTempPath = (M4OSA_Char *) - M4OSA_malloc(M4OSA_chrLength(tmpString) + 1, 0x0, + M4OSA_malloc(strlen((const char *)tmpString) + 1, 0x0, (M4OSA_Char *)"tempPath"); //initialize the first char. so that strcat works. M4OSA_Char *ptmpChar = (M4OSA_Char*)pContext->initParams.pTempPath; ptmpChar[0] = 0x00; - M4OSA_chrNCat((M4OSA_Char*)pContext->initParams.pTempPath, tmpString, M4OSA_chrLength(tmpString)); - M4OSA_chrNCat((M4OSA_Char*)pContext->initParams.pTempPath, (M4OSA_Char*)"/", 1); + strncat((char *)pContext->initParams.pTempPath, (const char *)tmpString, + (size_t)strlen((const char *)tmpString)); + strncat((char *)pContext->initParams.pTempPath, (const char *)"/", (size_t)1); M4OSA_free((M4OSA_MemAddr32)tmpString); pContext->mIsUpdateOverlay = false; pContext->mOverlayFileName = NULL; @@ -3286,7 +3287,7 @@ M4OSA_ERR M4MA_generateAudioGraphFile(JNIEnv* pEnv, M4OSA_Char* pInputFileURL, /* loop until EOF */ do { - M4OSA_memset((M4OSA_MemAddr8)bufferIn.m_dataAddress,bufferIn.m_bufferSize, 0); + memset((void *)bufferIn.m_dataAddress,0,bufferIn.m_bufferSize); numBytesToRead = samplesCountInBytes; diff --git a/media/jni/mediaeditor/VideoEditorOsal.cpp b/media/jni/mediaeditor/VideoEditorOsal.cpp index 035f59a4799f..339c0d168261 100755 --- a/media/jni/mediaeditor/VideoEditorOsal.cpp +++ b/media/jni/mediaeditor/VideoEditorOsal.cpp @@ -280,7 +280,7 @@ videoEditOsal_alloc( if (M4OSA_NULL != pData) { // Reset the allocated memory. - M4OSA_memset((M4OSA_MemAddr8)pData, size, 0); + memset((void *)pData, 0,size); #ifdef OSAL_MEM_LEAK_DEBUG // Update the allocated block count. gAllocatedBlockCount++; diff --git a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp index 3b795ceedbb0..39221f3071ef 100755 --- a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp +++ b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp @@ -147,8 +147,8 @@ jobject videoEditProp_getProperties( if (gotten) { // Retrieve the extension. - result = M4OSA_chrReverseFindChar(pFile, '.', &pExtension); - if ((M4NO_ERROR == result) && (M4OSA_NULL != pExtension)) + pExtension = (M4OSA_Char *)strrchr((const char *)pFile, (int)'.'); + if (M4OSA_NULL != pExtension) { // Skip the dot. pExtension++; @@ -341,7 +341,7 @@ static void getFileAndMediaTypeFromExtension ( M4OSA_UInt32 index = 0; M4OSA_ERR result = M4NO_ERROR; M4OSA_Int32 cmpResult = 0; - M4OSA_UInt32 extLength = M4OSA_chrLength(pExtension); + M4OSA_UInt32 extLength = strlen((const char *)pExtension); // Assign default *pFileType = VideoEditClasses_kFileType_Unsupported; @@ -353,7 +353,7 @@ static void getFileAndMediaTypeFromExtension ( // Convert the extension to lowercase. for (index = 0; index < extLength ; index++) { - extension[index] = M4OSA_chrToLower(pExtension[index]); + extension[index] = tolower((int)pExtension[index]); } // Check if the extension is ".mp3". @@ -539,7 +539,7 @@ VideoEdit_chrCompare(M4OSA_Char* pStrIn1, M4OSA_Char* pStrIn2, M4OSA_Int32* pCmpResult) { - M4OSA_chrCompare(pStrIn1, pStrIn2, pCmpResult); + *pCmpResult = strcmp((const char *)pStrIn1, (const char *)pStrIn2); return *pCmpResult; } diff --git a/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp b/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp index b1f9fe465401..461bdd0ab41e 100755 --- a/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp +++ b/media/jni/mediaeditor/VideoEditorThumbnailMain.cpp @@ -134,7 +134,7 @@ M4OSA_Void VBcallback( M4OSA_Context pInstance, for (j = 0; j < pPlane->u_height; j++) { - M4OSA_memcpy((M4OSA_MemAddr8 )dst, (M4OSA_MemAddr8 )src, pPlane->u_stride); + memcpy((void * )dst, (void * )src, pPlane->u_stride); for (i = pPlane->u_width; i < pC->m_width; i++) { dst[i] = 0; @@ -170,7 +170,7 @@ M4OSA_ERR ThumbnailOpen(M4OSA_Context *pPContext, M4OSA_TRACE3_1("context value is = %d",pContext); CHECK_PTR(ThumbnailOpen, pContext, err, M4ERR_ALLOC); - M4OSA_memset((M4OSA_MemAddr8)pContext, sizeof(ThumbnailContext), 0); + memset((void *)pContext, 0,sizeof(ThumbnailContext)); M4OSA_FileReadPointer optFP; M4OSA_FileReadPointer llFP; |