chenke
2017-07-27 d475c7ab0b4bd6781c6f312b153a4f5bc780d57a
VisitFace/RtspNativeCodec/app/src/main/cpp/RtspNativeCodecJNI.cpp
@@ -15,6 +15,7 @@
#include <face_daemon_proto.h>
#include <stdlib.h>
#include <endian.h>
#include "DebugNetwork.h"
#include "TeleWrapper.h"
@@ -46,7 +47,7 @@
    cpu_sched();
#ifdef USE_ST_SDK
    PipeLine::register_global_elem_creator("PL_SensetimeFaceTrack", create_PL_SensetimeFaceTrack);
    PipeLine::register_global_elem_creator("PL_SensetimeFaceTrackMitiTrd", create_PL_SensetimeFaceTrackMultiTrd);
#endif
    for (size_t i = 0; i < CAMERA_COUNT; i++)
@@ -792,13 +793,16 @@
    assert(cameraIdx > 0 && cameraIdx <= CAMERA_COUNT);
    cameraIdx -= 1;
    CameraWrapper &cameraWrapper(g_CameraWrappers[cameraIdx]);
    const jchar* jchars = env->GetStringChars(label, nullptr);
    std::wstring wstr;
    int lenth = env->GetStringLength(label);
    const char *utfChars = env->GetStringUTFChars(label, NULL);
    std::string labelstr(utfChars);
    std::wstring wlabelstr;
    wlabelstr.assign(labelstr.begin(), labelstr.end());
    env->ReleaseStringUTFChars(label, utfChars);
    cameraWrapper.setFaceLabel(stTrackId, wlabelstr);
    for (int i = 0; i < lenth; ++i) {
        jchar jc = *(jchars + i);
        wchar_t wt = (wchar_t)jc;
        wstr.push_back(wt);
    }
    env->ReleaseStringChars(label,jchars);
    cameraWrapper.setFaceLabel(stTrackId, wstr);
}
} // extern C