首页 > 代码库 > HAL层Camera模块Dump图片--工作积累

HAL层Camera模块Dump图片--工作积累

导出YUN数据进行调试,分析问题:

 1 // dump图像数据  事列 2 void   dump(const int width, const int height, void *yBuf, void *uvBuf) 3 { 4        char buf[256] = {\0}; 5        FILE* file_fd = fopen(buf, "wb"); 6        snprintf(buf, sizeof(buf), "/data/Effect/%dx%dvideodenoiser%d.yuv",width,height,4); 7        file_fd = fopen(buf, "wb"); 8          if (file_fd != NULL) { 9         void *data =http://www.mamicode.com/ NULL;10         int written_len = 0;11         data = http://www.mamicode.com/(void *)((uint8_t *)yBuf);12          written_len += fwrite( data, width*height, 1, file_fd);13         if(NULL == uvBuf)14             data = http://www.mamicode.com/(void *)((uint8_t *)yBuf+ width*height);15         else16             data = http://www.mamicode.com/(void *)((uint8_t *)uvBuf);17         written_len += fwrite( data, width*height/2, 1, file_fd);18         fclose(file_fd);19         TSLOG("%s: dump-------sucess%d",__func__,4);20         } else {21         TSLOG("%s: fail t open file for image dumping", __func__); 22 }