[jira] [Commented] (CB-5052) Andorid's media capture doesn't use ThreadPool

2013-10-22 Thread Mike Billau (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-5052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13802218#comment-13802218
 ] 

Mike Billau commented on CB-5052:
-

The workaround in the stack overflow post just disables threadChecking before 
calling out to  webView.getResourceApi().mapUriToFile(data); then re-enables 
threadChecking, so I'm not sure that this is an actual solution (the workaround 
DOES work fine btw.) Regardless we can't take photos or videos on Android 
(well, Nexus 7 and S4)...not sure how this slipped through the release testing. 

 Andorid's media capture doesn't use ThreadPool
 --

 Key: CB-5052
 URL: https://issues.apache.org/jira/browse/CB-5052
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android, Plugin Media Capture
 Environment: Windows 7
Reporter: Mike Billau
Assignee: David Kemp

 From: 
 http://stackoverflow.com/questions/19282318/phongap-capture-plugin-crashes-android
 Taking a picture with media-capture plugin will crash the app when the plugin 
 returns from the camera app. Reproduced with Nexus 7 on 4.2, I used the 
 simple Full Example from the docs.
 Got this in logcat:
 {noformat}
 I/ActivityManager(  476): Displayed 
 com.google.android.gallery3d/com.android.camera.CameraActivity: +1s80ms
 W/IInputConnectionWrapper(31792): showStatusIcon on inactive InputConnection
 V/CAM_PhotoModule(29129): Preview size is 960x720
 V/CAM_PhotoModule(29129): onShutterButtonClick: mCameraState=1
 E/NvOmxCamera(  128): OMX_ERRORTYPE 
 android::NvOmxCamera::getCameraStereoMode(NvxComponent*, 
 NvOmxCameraUserStereoMode): Error: invalid NVX mode 0.
 E/NvOmxCamera(  128): OMX_ERRORTYPE 
 android::NvOmxCamera::getCameraStereoModeAndCaptureInfo(NvxComponent*, 
 NvOmxCameraUserStereoMode, NVX_STEREOCAPTUREINFO): getCameraStereoMode 
 failed with 0x
 D/NvOsDebugPrintf(  128): NvMMLiteJPEGEncSetAttribute: Incorrect value 0 for 
 stereo capture type
 E/NvOmxCameraSettings(  128): OMX_ERRORTYPE 
 android::programStereoInfo(OMX_HANDLETYPE, const NVX_STEREOCAPTUREINFO, 
 android::NvxWrappers*): pNvxWrappers-OMX_SetConfigIL failed with 0x80001005
 V/CAM_PhotoModule(29129): mShutterToRawCallbackTime = 1381355622457ms
 V/CAM_PhotoModule(29129): mShutterLag = 422ms
 D/dalvikvm(29129): GC_FOR_ALLOC freed 679K, 15% free 1K/14236K, paused 
 27ms, total 28ms
 I/dalvikvm-heap(29129): Grow heap (frag case) to 13.063MB for 1036816-byte 
 allocation
 D/NvOsDebugPrintf(  128): Tryproc: INBuffer-Values of Width and Height 1280 
 960
 D/dalvikvm(29129): GC_FOR_ALLOC freed 1K, 14% free 13233K/15252K, paused 
 33ms, total 33ms
 V/CAM_PhotoModule(29129): mShutterToPostViewCallbackTime = 88ms
 V/CAM_PhotoModule(29129): mShutterToRawCallbackTime = 109ms
 V/CAM_PhotoModule(29129): mPictureDisplayedToJpegCallbackTime = 25ms
 D/CameraStorage(29129): External storage state=mounted
 V/CAM_PhotoModule(29129): mJpegCallbackFinishTime = 2ms
 I/MPL-storeload(  476): mpl state size = 5512
 E/MPL-storeload(  476): calData from inv_save_mpl_states, size=2
 I/MPL-storeload(  476): cal data size to write = 5512
 I/MPL-storeload(  476): Bytes written = 5512
 V/CAM_PhotoModule(29129): stopPreview
 D/(  128): Camera fd close (MI1040)
 E/NvOmxCamera(  128): Already called release()
 I/CameraClient(  128): Destroying camera 0
 W/NvOmxCamera(  128): Already called release()
 D/MediaProvider(27296): object removed 2270
 W/AudioFlinger(  128): session id 453 not found for pid 128
 W/AudioFlinger(  128): session id 454 not found for pid 128
 D/CordovaActivity(31792): Request code = 1
 D/AndroidRuntime(31792): Shutting down VM
 W/dalvikvm(31792): threadid=1: thread exiting with uncaught exception 
 (group=0x410ee930)
 E/AndroidRuntime(31792): FATAL EXCEPTION: main
 E/AndroidRuntime(31792): java.lang.RuntimeException: Failure delivering 
 result ResultInfo{who=null, request=1, result=-1, data=null} to activity 
 {io.cordova.hellocordova/io.cordova.hellocordova.HelloCordova}: 
 java.lang.IllegalStateException: Do not perform IO operations on the UI 
 thread. Use Cordova
 Interface.getThreadPool() instead.
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.deliverResults(ActivityThread.java:3319)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.access$1100(ActivityThread.java:141)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
 E/AndroidRuntime(31792):at 
 android.os.Handler.dispatchMessage(Handler.java:99)
 E/AndroidRuntime(31792):at android.os.Looper.loop(Looper.java:137)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.main(ActivityThread.java:5041)
 E/AndroidRuntime(31792):  

[jira] [Commented] (CB-5052) Andorid's media capture doesn't use ThreadPool

2013-10-10 Thread Mike Billau (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-5052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13792133#comment-13792133
 ] 

Mike Billau commented on CB-5052:
-

Another report and potential fix here: 
http://stackoverflow.com/questions/19183174/phonegap-video-capture-crashes

 Andorid's media capture doesn't use ThreadPool
 --

 Key: CB-5052
 URL: https://issues.apache.org/jira/browse/CB-5052
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android, Plugin Media Capture
 Environment: Windows 7
Reporter: Mike Billau
Assignee: David Kemp

 From: 
 http://stackoverflow.com/questions/19282318/phongap-capture-plugin-crashes-android
 Taking a picture with media-capture plugin will crash the app when the plugin 
 returns from the camera app. Reproduced with Nexus 7 on 4.2, I used the 
 simple Full Example from the docs.
 Got this in logcat:
 {noformat}
 I/ActivityManager(  476): Displayed 
 com.google.android.gallery3d/com.android.camera.CameraActivity: +1s80ms
 W/IInputConnectionWrapper(31792): showStatusIcon on inactive InputConnection
 V/CAM_PhotoModule(29129): Preview size is 960x720
 V/CAM_PhotoModule(29129): onShutterButtonClick: mCameraState=1
 E/NvOmxCamera(  128): OMX_ERRORTYPE 
 android::NvOmxCamera::getCameraStereoMode(NvxComponent*, 
 NvOmxCameraUserStereoMode): Error: invalid NVX mode 0.
 E/NvOmxCamera(  128): OMX_ERRORTYPE 
 android::NvOmxCamera::getCameraStereoModeAndCaptureInfo(NvxComponent*, 
 NvOmxCameraUserStereoMode, NVX_STEREOCAPTUREINFO): getCameraStereoMode 
 failed with 0x
 D/NvOsDebugPrintf(  128): NvMMLiteJPEGEncSetAttribute: Incorrect value 0 for 
 stereo capture type
 E/NvOmxCameraSettings(  128): OMX_ERRORTYPE 
 android::programStereoInfo(OMX_HANDLETYPE, const NVX_STEREOCAPTUREINFO, 
 android::NvxWrappers*): pNvxWrappers-OMX_SetConfigIL failed with 0x80001005
 V/CAM_PhotoModule(29129): mShutterToRawCallbackTime = 1381355622457ms
 V/CAM_PhotoModule(29129): mShutterLag = 422ms
 D/dalvikvm(29129): GC_FOR_ALLOC freed 679K, 15% free 1K/14236K, paused 
 27ms, total 28ms
 I/dalvikvm-heap(29129): Grow heap (frag case) to 13.063MB for 1036816-byte 
 allocation
 D/NvOsDebugPrintf(  128): Tryproc: INBuffer-Values of Width and Height 1280 
 960
 D/dalvikvm(29129): GC_FOR_ALLOC freed 1K, 14% free 13233K/15252K, paused 
 33ms, total 33ms
 V/CAM_PhotoModule(29129): mShutterToPostViewCallbackTime = 88ms
 V/CAM_PhotoModule(29129): mShutterToRawCallbackTime = 109ms
 V/CAM_PhotoModule(29129): mPictureDisplayedToJpegCallbackTime = 25ms
 D/CameraStorage(29129): External storage state=mounted
 V/CAM_PhotoModule(29129): mJpegCallbackFinishTime = 2ms
 I/MPL-storeload(  476): mpl state size = 5512
 E/MPL-storeload(  476): calData from inv_save_mpl_states, size=2
 I/MPL-storeload(  476): cal data size to write = 5512
 I/MPL-storeload(  476): Bytes written = 5512
 V/CAM_PhotoModule(29129): stopPreview
 D/(  128): Camera fd close (MI1040)
 E/NvOmxCamera(  128): Already called release()
 I/CameraClient(  128): Destroying camera 0
 W/NvOmxCamera(  128): Already called release()
 D/MediaProvider(27296): object removed 2270
 W/AudioFlinger(  128): session id 453 not found for pid 128
 W/AudioFlinger(  128): session id 454 not found for pid 128
 D/CordovaActivity(31792): Request code = 1
 D/AndroidRuntime(31792): Shutting down VM
 W/dalvikvm(31792): threadid=1: thread exiting with uncaught exception 
 (group=0x410ee930)
 E/AndroidRuntime(31792): FATAL EXCEPTION: main
 E/AndroidRuntime(31792): java.lang.RuntimeException: Failure delivering 
 result ResultInfo{who=null, request=1, result=-1, data=null} to activity 
 {io.cordova.hellocordova/io.cordova.hellocordova.HelloCordova}: 
 java.lang.IllegalStateException: Do not perform IO operations on the UI 
 thread. Use Cordova
 Interface.getThreadPool() instead.
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.deliverResults(ActivityThread.java:3319)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.access$1100(ActivityThread.java:141)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
 E/AndroidRuntime(31792):at 
 android.os.Handler.dispatchMessage(Handler.java:99)
 E/AndroidRuntime(31792):at android.os.Looper.loop(Looper.java:137)
 E/AndroidRuntime(31792):at 
 android.app.ActivityThread.main(ActivityThread.java:5041)
 E/AndroidRuntime(31792):at 
 java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime(31792):at 
 java.lang.reflect.Method.invoke(Method.java:511)
 E/AndroidRuntime(31792):at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)