camera app image dump

 

 

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时会有个提示内存溢出的弹框

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

空白的泡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值