|
|
|
@ -694,19 +694,19 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
else if (it->first == PROP_MODEL)
|
|
|
|
|
{
|
|
|
|
|
__system_property_get("ro.product.model", value);
|
|
|
|
|
it->second = value;
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == PROP_BS_MANU)
|
|
|
|
|
{
|
|
|
|
|
__system_property_get("ro.product.manufacturer", value);
|
|
|
|
|
it->second = value;
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == PROP_VERSION)
|
|
|
|
|
{
|
|
|
|
|
// FOR Protocol
|
|
|
|
|
snprintf(value, sizeof(value), "%u.%03u", (mVersionCode / 1000), (mVersionCode % 1000));
|
|
|
|
|
// __system_property_get("ro.build.version.release", value);
|
|
|
|
|
it->second = value;
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == (PROP_VERSION_ABBR))
|
|
|
|
|
{
|
|
|
|
@ -724,19 +724,19 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
else if (it->first == PROP_PROD_DATE)
|
|
|
|
|
{
|
|
|
|
|
__system_property_get("ro.build.date.utc", value);
|
|
|
|
|
it->second = value;
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == PROP_SN || it->first == PROP_BS_ID)
|
|
|
|
|
{
|
|
|
|
|
__system_property_get("ro.serialno", value);
|
|
|
|
|
it->second = value;
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == PROP_IMEI)
|
|
|
|
|
{
|
|
|
|
|
if (m_simcard.empty())
|
|
|
|
|
{
|
|
|
|
|
__system_property_get("phone.imei", value);
|
|
|
|
|
it->second = value;
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -756,9 +756,8 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
{
|
|
|
|
|
fs::space_info si = fs::space("/data");
|
|
|
|
|
double fr = ((double)si.available * 100.0f) / ((double)si.capacity);
|
|
|
|
|
char buf[12] = { 0 };
|
|
|
|
|
snprintf(buf, sizeof(buf), "%d%%", (int)fr);
|
|
|
|
|
it->second = buf;
|
|
|
|
|
snprintf(value, sizeof(value), "%d%%", (int)fr);
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == PROP_TOTAL_ROM)
|
|
|
|
|
{
|
|
|
|
@ -774,9 +773,8 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
long fm = android_os_Process_getFreeMemory();
|
|
|
|
|
long tm = android_os_Process_getTotalMemory();
|
|
|
|
|
double fmp = ((double)fm * 100.0f) / ((double)tm);
|
|
|
|
|
char buf[12] = { 0 };
|
|
|
|
|
snprintf(buf, sizeof(buf), "%d%%", (int)fmp);
|
|
|
|
|
it->second = buf; // Unit: M
|
|
|
|
|
snprintf(value, sizeof(value), "%d%%", (int)fmp);
|
|
|
|
|
it->second = std::string(value); // Unit: M
|
|
|
|
|
}
|
|
|
|
|
else if (it->first == PROP_TOTAL_MEMORY)
|
|
|
|
|
{
|
|
|
|
@ -807,7 +805,7 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
snprintf(str, sizeof(str), "%.1f", (val / 1000.0));
|
|
|
|
|
it->second = str;
|
|
|
|
|
it->second = std::string(str);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -821,9 +819,8 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
if (val > 0)
|
|
|
|
|
{
|
|
|
|
|
bv = val;
|
|
|
|
|
char str[32] = { 0 };
|
|
|
|
|
snprintf(str, sizeof(str), "%.1f", val / 1000.0);
|
|
|
|
|
it->second = str;
|
|
|
|
|
snprintf(value, sizeof(value), "%.1f", val / 1000.0);
|
|
|
|
|
it->second = std::string(value);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -865,7 +862,7 @@ bool CPhoneDevice::QuerySystemProperties(std::map<std::string, std::string>& pro
|
|
|
|
|
char str[32] = { 0 };
|
|
|
|
|
float batteryCurrent = STANDARD_CURRENT_64V / ((float)bv / 1000.0f / STANDARD_VOLTAGE_64V);
|
|
|
|
|
snprintf(str, sizeof(str), "%d", (int)batteryCurrent);
|
|
|
|
|
it->second = str;
|
|
|
|
|
it->second = std::string(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// __system_property_get("ro.telephony.default_network", value);
|
|
|
|
@ -1515,7 +1512,9 @@ void DrawOutlineText(cv::Ptr<cv::ft::FreeType2> ft2, cv::Mat& mat, const std::st
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics, std::vector<std::shared_ptr<ACameraMetadata> >& results, uint32_t ldr, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristics,
|
|
|
|
|
std::vector<std::shared_ptr<ACameraMetadata> >& results,
|
|
|
|
|
uint32_t ldr, std::vector<std::shared_ptr<AImage> >& frames)
|
|
|
|
|
{
|
|
|
|
|
time_t takingTime = time(NULL);
|
|
|
|
|
if (mPhotoInfo.remedy != 0)
|
|
|
|
@ -1533,7 +1532,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
std::string path;
|
|
|
|
|
path.swap(mPath);
|
|
|
|
|
|
|
|
|
|
std::string tmpPath = m_appPath + (APP_DIR_TMP DIR_SEP_STR) + std::to_string(photoInfo.photoId);
|
|
|
|
|
std::string tmpPath = m_appPath + std::string(APP_DIR_TMP DIR_SEP_STR) + std::to_string(photoInfo.photoId);
|
|
|
|
|
|
|
|
|
|
acamera_metadata_enum_android_lens_facing_t facing = ACAMERA_LENS_FACING_FRONT;
|
|
|
|
|
ACameraMetadata_const_entry e = { 0 };
|
|
|
|
@ -1583,11 +1582,11 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
media_status_t status = AImage_getNumberOfPlanes(spImage.get(), &planeCount);
|
|
|
|
|
AASSERT(status == AMEDIA_OK && planeCount == 1, "Error: getNumberOfPlanes() planeCount = %d", planeCount);
|
|
|
|
|
|
|
|
|
|
uint8_t *data = nullptr;
|
|
|
|
|
int len = 0;
|
|
|
|
|
mstatus = AImage_getPlaneData(spImage.get(), 0, &data, &len);
|
|
|
|
|
uint8_t *planeData = NULL;
|
|
|
|
|
int planeDataLen = 0;
|
|
|
|
|
mstatus = AImage_getPlaneData(spImage.get(), 0, &planeData, &planeDataLen);
|
|
|
|
|
DngCreator dngCreator(characteristics.get(), result.get());
|
|
|
|
|
dngCreator.writeInputBuffer(*it, data, len, width, height, 0);
|
|
|
|
|
dngCreator.writeInputBuffer(*it, planeData, planeDataLen, width, height, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -1617,7 +1616,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t format;
|
|
|
|
|
media_status_t mstatus = AImage_getFormat(frame.get(), &format);
|
|
|
|
|
mstatus = AImage_getFormat(frame.get(), &format);
|
|
|
|
|
|
|
|
|
|
if (format == AIMAGE_FORMAT_YUV_420_888)
|
|
|
|
|
{
|
|
|
|
@ -1759,7 +1758,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
std::vector<std::string> rawFilePaths;
|
|
|
|
|
for (auto it = rawFiles.cbegin(); it != rawFiles.cend(); ++it)
|
|
|
|
|
{
|
|
|
|
|
std::string dngFilePath = tmpPath + "-" + std::to_string(std::distance(rawFiles.cbegin(), it)) + ".dng";
|
|
|
|
|
std::string dngFilePath = tmpPath + std::string("-") + std::to_string(std::distance(rawFiles.cbegin(), it)) + std::string(".dng");
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
char log[256] = { 0 };
|
|
|
|
|
strcpy(log, dngFilePath.c_str());
|
|
|
|
@ -1768,7 +1767,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
if (file) {
|
|
|
|
|
if (!(*it).empty())
|
|
|
|
|
{
|
|
|
|
|
fwrite(&((*it)[0]), 1, (*it).size(), file);
|
|
|
|
|
fwrite((const void*)(&((*it)[0])), 1, (*it).size(), file);
|
|
|
|
|
}
|
|
|
|
|
fclose(file);
|
|
|
|
|
rawFilePaths.push_back(dngFilePath);
|
|
|
|
@ -1781,7 +1780,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr<ACameraMetadata> characteristi
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_ERROR, "Finish HDR CH=%u IMGID=%u", (uint32_t)mPhotoInfo.channel, (uint32_t)mPhotoInfo.photoId);
|
|
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
|
for (auto it = rawFilePaths.cbegin(); it != rawFiles.cend(); ++it)
|
|
|
|
|
for (auto it = rawFilePaths.cbegin(); it != rawFilePaths.cend(); ++it)
|
|
|
|
|
{
|
|
|
|
|
std::remove((*it).c_str());
|
|
|
|
|
}
|
|
|
|
|