MediaCodec createInputSurface failed with -38

Deadly 提交于 2019-12-13 02:29:41

问题


I launch the grafika, a dialog turned out and said "Failed to generate cotent. Some features may be unavailable. Can't use input surface with software codec: OMX.google.h264.encoder"

Then I click OK button and entered the continuous caputure activity, the app crashed.

My device infomation is as follows:

Model: Lenovo A560

Android version: 4.3

I am sure this is the key log:

    06-29 21:27:50.267 E/OMXMaster(17347): A component of name 'OMX.qcom.audio.decoder.aac' already exists, ignoring this one.
06-29 21:27:50.267 I/SoftAVCEncoder(17347): Construct SoftAVCEncoder
06-29 21:27:50.267 D/ResourceManager(17347): findUseCaseAndSetParameter - mime=video/avc,componentName=OMX.google.h264.encoder,isDecoder=0
06-29 21:27:50.267 D/ResourceManager(17347): findUseCaseAndSetParameter-useCase =,useCaseFlag = 0, codecFlags = 0
06-29 21:27:50.267 D/ResourceManager(17347): mime = video/avc, componentName = OMX.google.h264.encoder, isDecoder = 0
06-29 21:27:50.267 D/ResourceManager(17347): software video useCase =
06-29 21:27:50.267 I/ACodec (17347): setupVideoEncoder succeeded
06-29 21:27:50.267 E/OMXNodeInstance(17347): createInputSurface requires AndroidOpaque color format
06-29 21:27:50.267 E/ACodec (17347): [OMX.google.h264.encoder] onCreateInputSurface returning error -38
06-29 21:27:50.267 W/MediaCodec(17347): createInputSurface failed, err=-38
06-29 21:27:50.277 D/KeyguardUpdateMonitor( 1249): sendKeyguardVisibilityChanged(true)
06-29 21:27:50.277 D/KeyguardUpdateMonitor( 1249): handleKeyguardVisibilityChanged(1)
06-29 21:27:50.277 D/AndroidRuntime(17347): Shutting down VM
06-29 21:27:50.277 W/dalvikvm(17347): threadid=1: thread exiting with uncaught exception (group=0x415ac8b0)
06-29 21:27:50.297 E/AndroidRuntime(17347): FATAL EXCEPTION: main
06-29 21:27:50.297 E/AndroidRuntime(17347): java.lang.IllegalStateException
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.media.MediaCodec.createInputSurface(Native Method)
06-29 21:27:50.297 E/AndroidRuntime(17347): at com.android.grafika.CircularEncoder.(CircularEncoder.java:124)
06-29 21:27:50.297 E/AndroidRuntime(17347): at com.android.grafika.ContinuousCaptureActivity.surfaceCreated(ContinuousCaptureActivity.java:383)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.SurfaceView.updateWindow(SurfaceView.java:571)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.SurfaceView.access$000(SurfaceView.java:86)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:175)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:833)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1860)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.Choreographer.doFrame(Choreographer.java:532)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.os.Handler.handleCallback(Handler.java:730)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.os.Handler.dispatchMessage(Handler.java:92)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.os.Looper.loop(Looper.java:137)
06-29 21:27:50.297 E/AndroidRuntime(17347): at android.app.ActivityThread.main(ActivityThread.java:5136)
06-29 21:27:50.297 E/AndroidRuntime(17347): at java.lang.reflect.Method.invokeNative(Native Method)
06-29 21:27:50.297 E/AndroidRuntime(17347): at java.lang.reflect.Method.invoke(Method.java:525)
06-29 21:27:50.297 E/AndroidRuntime(17347): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
06-29 21:27:50.297 E/AndroidRuntime(17347): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
06-29 21:27:50.297 E/AndroidRuntime(17347): at dalvik.system.NativeStart.main(Native Method)
06-29 21:27:50.317 I/ActivityManager( 1249): Notify an ApplicationCrash

How to fix this issue?

来源:https://stackoverflow.com/questions/38101354/mediacodec-createinputsurface-failed-with-38

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!