尝试在我的应用程序中进行实时相机视图时,我在 Galaxy nexus 上遇到了一个奇怪的问题。我在日志猫中收到此错误:
06-29 16:31:26.681 I/CameraClient(133): Opening camera 0
06-29 16:31:26.681 I/CameraHAL(133): camera_device open
06-29 16:31:26.970 D/DOMX (133): ERROR: failed check:(eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore) - returning error: 0x80001005 - Error returned from OMX API in ducati
06-29 16:31:26.970 E/CameraHAL(133): Error while configuring rotation 0x80001005
06-29 16:31:27.088 I/am_on_resume_called(21274): [0,digifynotes.Activity_Camera]
06-29 16:31:27.111 V/PhoneStatusBar(693): setLightsOn(true)
06-29 16:31:27.205 E/CameraHAL(133): OMX component is not in loaded state
06-29 16:31:27.205 E/CameraHAL(133): setNSF() failed -22
06-29 16:31:27.205 E/CameraHAL(133): Error: CAMERA_QUERY_RESOLUTION_PREVIEW -22
06-29 16:31:27.252 I/MonoDroid(21274): UNHANDLED EXCEPTION: Java.Lang.Exception: Exception of type 'Java.Lang.Exception' was thrown.
06-29 16:31:27.252 I/MonoDroid(21274): at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr) <0x00068>
06-29 16:31:27.252 I/MonoDroid(21274): at Android.Hardware.Camera.StartPreview () <0x0007f>
06-29 16:31:27.252 I/MonoDroid(21274): at DigifyNotes.CameraPreviewView.SurfaceChanged (Android.Views.ISurfaceHolder,Android.Graphics.Format,int,int) <0x000d7>
06-29 16:31:27.252 I/MonoDroid(21274): at Android.Views.ISurfaceHolderCallbackInvoker.n_SurfaceChanged_Landroid_view_SurfaceHolder_III (intptr,intptr,intptr,int,int,int) <0x0008b>
06-29 16:31:27.252 I/MonoDroid(21274): at (wrapper dynamic-method) object.4c65d912-497c-4a67-9046-4b33a55403df (intptr,intptr,intptr,int,int,int) <0x0006b>
相同的源代码可以在三星 Galaxy Ace 2X (4.0.4) 和 LG G2X (2.3.7) 上完美运行。如果我的朋友借给我,我稍后会在 Galaxy s4 上进行测试。
我相信 Galaxy Nexus 运行的是 Android 4.2.2。
有人有想法么?
编辑:这是我的相机课程:
[请注意我使用的是单声道] [如果您将其视为原始格式,则格式更具可读性]
相机活动: http: //pastebin.com/YPcGXJRB
相机预览视图: http: //pastebin.com/zNf8AWDf