异常 lock buffer failed for format 0x23

Posted lipeineng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了异常 lock buffer failed for format 0x23相关的知识,希望对你有一定的参考价值。

 

02-11 21:21:45.669625 14804 14815 W Monkey  : // java.lang.RuntimeException: lock buffer failed for format 0x23
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at android.media.ImageReader$SurfaceImage.nativeCreatePlanes(Native Method)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at android.media.ImageReader$SurfaceImage.getPlanes(ImageReader.java:896)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.camera2proxy.AndroidImageProxy.<init>(AndroidImageProxy.java:112)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.camera2proxy.AndroidImageReaderProxy.acquireNextImage(AndroidImageReaderProxy.java:135)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.camera2proxy.ForwardingImageReader.acquireNextImage(ForwardingImageReader.java:67)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.LoggingImageReader.acquireNextImage(LoggingImageReader.java:61)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.camera2proxy.ForwardingImageReader.acquireNextImage(ForwardingImageReader.java:67)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.CloseWhenDoneImageReader.acquireNextImage(CloseWhenDoneImageReader.java:86)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.sharedimagereader.imagedistributor.ImageDistributorOnImageAvailableListener.onImageAvailable(ImageDistributorOnImageAvailableListener.java:46)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at com.android.camera.one.v2.camera2proxy.AndroidImageReaderProxy$1.onImageAvailable(AndroidImageReaderProxy.java:149)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:800)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at android.os.Handler.dispatchMessage(Handler.java:106)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at android.os.Looper.loop(Looper.java:193)
02-11 21:21:45.669625 14804 14815 W Monkey  : // 	at android.os.HandlerThread.run(HandlerThread.java:65)

  

 

 

/home/lipn/Android/Sdk/sources/android-29/android/media/ImageReader.java
getPlanes---->nativeCreatePlanes

/android_mtk_p0_mp1/frameworks/base/media/jni/android_media_ImageReader.cpp
{"nativeCreatePlanes", "(II)[Landroid/media/ImageReader$SurfaceImage$SurfacePlane;", (void*)Image_createSurfacePlanes },
Image_createSurfacePlanes------>Image_getLockedImage------->lockImageFromBuffer
// jniThrowExceptionFmt(env, "java/lang/RuntimeException", "lock buffer failed for format 0x%x",buffer->mGraphicBuffer->getPixelFormat());

/android_mtk_p0_mp1/frameworks/base/media/jni/android_media_Utils.cpp
lockImageFromBuffer----->lockAsync
// ALOGE("Lock buffer failed!");

/android_mtk_p0_mp1/frameworks/native/libs/ui/GraphicBufferMapper.cpp
lockAsync------>mMapper->lock
// ALOGW_IF(error != Gralloc2::Error::NONE, "lock(%p, ...) failed: %d", handle, error);

 

02-11 21:21:45.640455 20126 25973 W GraphicBufferMapper: lock(0x634cee80, ...) failed: 3
02-11 21:21:45.640587 20126 25973 E AndroidMediaUtils: Lock buffer failed!
02-11 21:21:45.640661 20126 25973 E AndroidMediaUtils: lockImageFromBuffer: lock graphic buffer failed

 

YCbCr模型来源于yuv模型。
lock buffer failed for format 0x23 // 0x23是HAL_PIXEL_FORMAT_YCbCr_420_888;

lockAsyncYCbCr for YUV is unsuccessful. // YCbCr和YUV异步转换锁定失败

nativeCreatePlanes(ImageReader.this.mNumPlanes, ImageReader.this.mFormat); // mNumPlanes = 3; mFormat = 0x23

以上是关于异常 lock buffer failed for format 0x23的主要内容,如果未能解决你的问题,请参考以下文章

Gradle sync failed: Gradle sync failed: Timeout waiting to lock cp_init remapped class cache for a2h

Ambari安装过程的错误-hdfs初始化错误-initialization failed for block pool

kafka启动报错:kafka.common.KafkaException: Failed to acquire lock on file .lock

Android异常篇 Error:Execution failed for task ‘:app:validateSigningDebug‘.

Waiting for another flutter command to release the startup lock... 异常解决

“Validation failed for one or more entities”异常的解决办法