异常 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.(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)