adb shell setprop persist.vendor.camera.hal.debug 5
adb shell setprop persist.camera2.megvii.debug true
adb root
adb shell setprop persist.vendor.camera.logInfoMask 0x8000000
adb shell setprop persist.vendor.camera.logVerboseMask 0x8000000
1. jpeg dump for tuning
adb shell setprop persist.sys.camera.jpegcallback true
2. dump 算法 inYUV outYUV
int mWidth;
int mHeight;
int mStrideY;
int mStrideVU;
private CaptureController mController;
private static String TAG = "MegviiBeautyPicture";
private static boolean mIsSupported = true;
private Context mContext;
private byte[] mInYvuBytes = null;
private ByteBuffer mOutYvuBytes = null;
@Override
public void init(int width, int height, int strideY, int strideVU) {
mWidth = width;
mHeight = height;
mStrideY = strideY;
mStrideVU = strideVU;
initBeauty();
BeaurifyJniSdk.imageInstance().nativeReset(strideY,height,(360-getImageOrientation()));
initYvuBytes();
}
initYvuBytes(){
if(mOutYvuBytes==null ||mOutYvuBytes.capacity() <mHeight * mStrideY* 3 / 2){
mOutYvuBytes = ByteBuffer.allocate(mStrideY*mHeight*3/2);
}
if(mInYvuBytes==null ||mInYvuBytes.length<mHeight* mStrideY* 3 / 2){
mInYvuBytes = new byte[mHeight* mStrideY* 3 / 2];
}
}
public void setImageSize(int width, int height, int strideY, int strideVU) {
mWidth = width;
mHeight = height;
mStrideY = strideY;
mStrideVU = strideVU;
}
@Override
public void addImage(ByteBuffer bY, ByteBuffer bVU, int imageNum, Object isPreview) {
bY.get(mInYvuBytes, 0, bY.remaining());
bVU.get(mInYvuBytes, mStrideY*mHeight, bVU.remaining());
mOutYvuBytes.clear();
//---------------------dump inYUV--------------------
if(DEBUG){
//dump input file
long now = System.currentTimeMillis();
String path = "/sdcard/beauty/"+now+"_beauty_input.yuv";
CameraUtil.writeBytesToFile(path,mInYvuBytes);
}
}
public static void writeBytesToFile(String path,byte[] data){
ByteBuffer byteBuffer = ByteBuffer.wrap(data);
FileChannel fileChannel = null;
try {
fileChannel = new FileOutputStream(path).getChannel();
fileChannel.write(byteBuffer);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
//SVACE 70478
try {
fileChannel.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@Override
public void deinit() {
uninitBeauty();
mInYvuBytes = null;
mOutYvuBytes = null;
}
3. hdr debug
adb shell setprop persist.sys.camera.hdrdebug true
adb shell setprop persist.sys.camera.hdr.low -2 默认-4
adb shell setprop persist.sys.camera.hdr.normal 0 默认0
adb shell setprop persist.sys.camera.hdr.high
setprop persist.camera2.anc.debug true
cd sdcard
mkdir xxxxx
当persist.vendor.memory.leak.flag读取出来为1时会有个提示内存溢出的弹框