| | |
| | | |
| | | |
| | | |
| | | std::string devHttpServer_c::getAlarmImageByImageKeyAndDevId(const std::string& devId,const std::string& imgKey, |
| | | std::string devHttpServer_c::getAlarmImageByImageKeyAndDevId(const std::string& imgKey,const std::string& devId, |
| | | PResponse &response) { |
| | | try { |
| | | if (!devId.empty() && !imgKey.empty()) { |
| | |
| | | auto videoParseResult = VideoName_s_t::fromString(item); |
| | | if (videoParseResult.Valid()) { |
| | | if (videoParseResult.m_startFrameId <= imgSt.m_frameId && |
| | | imgSt.m_frameId < videoParseResult.m_endFrameId) { |
| | | imgSt.m_frameId <= videoParseResult.m_endFrameId) { |
| | | auto imgTm = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp); |
| | | auto videoTm = AppUtil::ParseFromHypenTimeStr(videoParseResult.m_timeStamp); |
| | | if (AppUtil::IsRightAfterLeft(imgTm, videoTm)) { |
| | |
| | | } |
| | | |
| | | //新的根据图片名称获取路径的方法 |
| | | std::string devHttpServer_c::getVideoPathByImgKey(const std::string &strImageName, const std::string &camId) |
| | | std::string devHttpServer_c::getVideoPathByImgKey(const std::string &imgKey, const std::string &camId) |
| | | { |
| | | INFO("GetVideoFor: "<<strImageName<<" CamID:"<<camId); |
| | | ImageName_s_t imgSt= ImageName_s_t::fromString(strImageName); |
| | | INFO("GetVideoFor: "<<imgKey<<" CamID:"<<camId); |
| | | ImageName_s_t imgSt= ImageName_s_t::fromString(imgKey); |
| | | |
| | | struct tm imgTime = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp); |
| | | char curFolder[128]={0}; |
| | |
| | | imgTime.tm_year+1900,imgTime.tm_mon+1,imgTime.tm_mday,imgTime.tm_hour); |
| | | std::string t_FilePath = appConfig.getStringProperty("cutPath"); |
| | | std::string videoPath = t_FilePath+"/"+camId+"/"+std::string(curFolder); |
| | | return GetVideoNameByImgKey(strImageName,videoPath); |
| | | return GetVideoNameByImgKey(imgKey,videoPath); |
| | | } |
| | | |
| | | |