From 521e435d5d63fc76097e6667ba5ef9bcd1393a7b Mon Sep 17 00:00:00 2001 From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674> Date: 星期二, 25 四月 2017 16:35:32 +0800 Subject: [PATCH] bug fix --- VisitFace/RtspNativeCodec/app/src/main/cpp/FaceCache.cpp | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/FaceCache.cpp b/VisitFace/RtspNativeCodec/app/src/main/cpp/FaceCache.cpp index 719b236..4be9089 100644 --- a/VisitFace/RtspNativeCodec/app/src/main/cpp/FaceCache.cpp +++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/FaceCache.cpp @@ -191,7 +191,7 @@ cv::Mat roiMat(roiMat1.clone()); // #todo copy data should be avoid!!!! size_t s = roiMat.total() * roiMat.elemSize(); - PbFaceList_FaceListImage pbFaceListImage; + PbFaceList_FaceListImage& pbFaceListImage(*(pbFaceList.add_images())); pbFaceListImage.set_idx(i); pbFaceListImage.set_size(s); pbFaceListImage.set_type(PbFaceList_FaceListImage_ImageType_IT_Y); @@ -211,11 +211,32 @@ // fclose(pFile); // if (f > 20)exit(0); //} + + //{ + // static size_t f = 0; + // char fname[50]; + // sprintf(fname, "/sdcard/face-%u.yuv", ++f); + // FILE *pFile = fopen(fname, "wb"); + // const std::string* img(*pbFaceListImage.img().data()); + // fwrite(img->data(), 1, img->size(), pFile); + // fclose(pFile); + // if (f > 20)exit(0); + //} } size_t s = pbFaceList.ByteSize(); buffMaxSize = std::min(s, buffMaxSize); pbFaceList.SerializeToArray(buffer, buffMaxSize); + + //{ + // static size_t f = 0; + // char fname[50]; + // sprintf(fname, "/sdcard/facelist-%u.pb", ++f); + // FILE *pFile = fopen(fname, "wb"); + // fwrite(buffer, 1, buffMaxSize, pFile); + // fclose(pFile); + // if (f > 10)exit(0); + //} return buffMaxSize > 0; } @@ -355,7 +376,7 @@ //{ // static size_t f = 0; // char fname[50]; - // sprintf(fname, "/sdcard/face-%u.rgb565", ++f); + // sprintf(fname, "/sdcard/face-%u-w%d-h%d.rgb565", ++f, imgidx.width, imgidx.height); // FILE *pFile = fopen(fname, "wb"); // fwrite(pbuf, 1, imgidx.size, pFile); // fclose(pFile); -- Gitblit v1.8.0