Dump YUV 函数

一般camera dumpYUV都会到hal层进行

int DumpYUV(char *frame)

{

    time_t current_time;
    struct tm * timeinfo;
    time (¤t_time);
    timeinfo = localtime (¤t_time);     //获取当前系统时间

char path[]="./sdcard/XXXX/";   //设置存储目录

ret = CreateDir(path1);    //创建目录

 

char buf[128];

snprintf(buf, sizeof(buf), "/sdcard/IsBackLight/isbacklight_%d_%d_%d_%d_%d_%d_%d.yuv",timeinfo->tm_year,timeinfo->tm_mon,timeinfo->tm_mday,timeinfo->tm_hour,timeinfo->tm_min,timeinfo->tm_sec,frame_index_temp);

//把dump的文件名赋给buf

file_fd = open(buf, O_RDWR | O_CREAT, 0777); 打开buf命名的文件(如果没有就创建一个)

        write(file_fd, (void *)(frame), sizeof(frame)); 对文件进行写入操作
        close(file_fd); 关闭文件

}

 

MTK 拍照时dump YUV 一般在各种shot.cpp文件中进行:

例如:

vendor\mediatek\proprietary\hardware\mtkcam\middleware\v1\adapter\Scenario\Shot\HDRShot\HDRShot.cpp

preview想要dump YUV一般在文件:

vendor\mediatek\proprietary\hardware\mtkcam\legacy\v1\client\CamClient\PreviewCallback\PreviewClient.BufOps.cpp

HAL3

如何 dump Jpeg ?以及 dump 后的保存路径在哪里?

adb root 
adb remount
adb shell rm -rf /data/vendor/camera_dump/* 
adb shell setprop vendor.debug.camera.dump.JpegNode 1 
adb shell stop camerahalserver
adb shell start camerahalserver

dump 完后,dump 出来的 buffer 都放到 /data/vendor/camera_dump 这个目录下了

 

高通dump otp data

persist.camera.cal.dump 1

 

你可能感兴趣的:(android_camera,dumpYUV)