|
|
|
@ -154,9 +154,9 @@ void posix_signal_handler(int sig, siginfo_t *siginfo, void *context)
|
|
|
|
|
class Runner
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static void RequestCapture(CTerminal* pTerminal, unsigned int channel, unsigned int preset, unsigned int type, unsigned long scheduleTime);
|
|
|
|
|
static void RequestCapture(CTerminal* pTerminal, unsigned int channel, unsigned int preset, unsigned int type, uint64_t scheduleTime);
|
|
|
|
|
};
|
|
|
|
|
void Runner::RequestCapture(CTerminal* pTerminal, unsigned int channel, unsigned int preset, unsigned int type, unsigned long scheduleTime)
|
|
|
|
|
void Runner::RequestCapture(CTerminal* pTerminal, unsigned int channel, unsigned int preset, unsigned int type, uint64_t scheduleTime)
|
|
|
|
|
{
|
|
|
|
|
pTerminal->RequestCapture(channel, preset, type, scheduleTime);
|
|
|
|
|
}
|
|
|
|
@ -369,17 +369,17 @@ Java_com_xypower_mpapp_MicroPhotoService_notifyToTakePhoto(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned char type = photoOrVideo ? 0 : 1;
|
|
|
|
|
// std::thread th(&Runner::RequestCapture, pTerminal, (unsigned int)channel, (unsigned int)preset, type, (unsigned long)scheduleTime, 0, true);
|
|
|
|
|
// std::thread th(&Runner::RequestCapture, pTerminal, (unsigned int)channel, (unsigned int)preset, type, (uint64_t)scheduleTime, 0, true);
|
|
|
|
|
// th.detach();
|
|
|
|
|
if (channel < 0x100)
|
|
|
|
|
{
|
|
|
|
|
pTerminal->RequestCapture((uint32_t)channel, (unsigned int)preset, type, (unsigned long)scheduleTime, 0, true);
|
|
|
|
|
pTerminal->RequestCapture((uint32_t)channel, (unsigned int)preset, type, (uint64_t)scheduleTime, 0, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
uint32_t packetType = channel;
|
|
|
|
|
packetType &= 0xFF;
|
|
|
|
|
pTerminal->RequestSampling(packetType, (unsigned long)scheduleTime, 0);
|
|
|
|
|
pTerminal->RequestSampling(packetType, (uint64_t)scheduleTime, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return JNI_TRUE;
|
|
|
|
@ -568,7 +568,7 @@ Java_com_xypower_mpapp_MicroPhotoService_getPhotoTimeData2(
|
|
|
|
|
vector<jlong> dataArray;
|
|
|
|
|
dataArray.reserve(numberOfData);
|
|
|
|
|
|
|
|
|
|
unsigned long val = 0;
|
|
|
|
|
uint64_t val = 0;
|
|
|
|
|
jint channel = 0;
|
|
|
|
|
for (map<unsigned char, vector<unsigned int>>::const_iterator it = photoTime.cbegin(); it != photoTime.cend(); ++it)
|
|
|
|
|
{
|
|
|
|
@ -585,11 +585,11 @@ Java_com_xypower_mpapp_MicroPhotoService_getPhotoTimeData2(
|
|
|
|
|
for (vector<unsigned int>::const_iterator it2 = it->second.cbegin(); it2 != it->second.cend(); ++it2)
|
|
|
|
|
{
|
|
|
|
|
// time
|
|
|
|
|
val = ((unsigned long)((*it2) & 0xFFFFFF00)) << 24;
|
|
|
|
|
val = ((uint64_t)((*it2) & 0xFFFFFF00)) << 24;
|
|
|
|
|
// channel
|
|
|
|
|
val |= ((unsigned long)channel) << 16;
|
|
|
|
|
val |= ((uint64_t)channel) << 16;
|
|
|
|
|
// preset
|
|
|
|
|
val |= ((unsigned long)((*it2) & 0xFF)) << 8;
|
|
|
|
|
val |= ((uint64_t)((*it2) & 0xFF)) << 8;
|
|
|
|
|
|
|
|
|
|
dataArray.push_back((jlong)val);
|
|
|
|
|
}
|
|
|
|
@ -639,14 +639,14 @@ Java_com_xypower_mpapp_MicroPhotoService_getPhotoTimeData(
|
|
|
|
|
dataArray.push_back((jlong)scheduleTime);
|
|
|
|
|
dataArray.push_back((jlong)channelsAndPresets.size());
|
|
|
|
|
|
|
|
|
|
unsigned long val = 0;
|
|
|
|
|
uint64_t val = 0;
|
|
|
|
|
for (std::vector<std::pair<uint16_t, uint8_t> >::const_iterator it = channelsAndPresets.cbegin(); it != channelsAndPresets.cend(); ++it)
|
|
|
|
|
{
|
|
|
|
|
val = (unsigned long)scheduleTime << 28;
|
|
|
|
|
val = (((uint64_t)scheduleTime) << 28);
|
|
|
|
|
// channel
|
|
|
|
|
val |= ((unsigned long)(it->first)) << 12;
|
|
|
|
|
val |= (((uint64_t)(it->first)) << 12);
|
|
|
|
|
// preset
|
|
|
|
|
val |= ((unsigned long)(it->second)) << 4;
|
|
|
|
|
val |= (((uint64_t)(it->second)) << 4);
|
|
|
|
|
|
|
|
|
|
dataArray.push_back((jlong)val);
|
|
|
|
|
}
|
|
|
|
@ -761,7 +761,7 @@ Java_com_xypower_mpapp_MicroPhotoService_captureFinished(
|
|
|
|
|
if (result == JNI_FALSE || bitmap == NULL)
|
|
|
|
|
{
|
|
|
|
|
cv::Mat mat;
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, mat, (unsigned long)photoId);
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, mat, (uint64_t)photoId);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
AndroidBitmapInfo info = { 0 };
|
|
|
|
@ -785,7 +785,7 @@ Java_com_xypower_mpapp_MicroPhotoService_captureFinished(
|
|
|
|
|
|
|
|
|
|
cv::cvtColor(mat, mat, cv::COLOR_RGB2BGR);
|
|
|
|
|
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, mat, (unsigned long)photoId);
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, mat, (uint64_t)photoId);
|
|
|
|
|
#endif // 0
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
@ -802,7 +802,7 @@ Java_com_xypower_mpapp_MicroPhotoService_captureFinished(
|
|
|
|
|
|
|
|
|
|
AndroidBitmap_unlockPixels(env, bitmap);
|
|
|
|
|
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, mat, (unsigned long)photoId);
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, mat, (uint64_t)photoId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -830,7 +830,7 @@ Java_com_xypower_mpapp_MicroPhotoService_burstCaptureFinished(
|
|
|
|
|
if (result == JNI_FALSE)
|
|
|
|
|
{
|
|
|
|
|
cv::Mat mat;
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(true, false, mat, (unsigned long)photoId);
|
|
|
|
|
((CPhoneDevice *)dev)->OnCaptureReady(true, false, mat, (uint64_t)photoId);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -863,7 +863,7 @@ Java_com_xypower_mpapp_MicroPhotoService_recordingFinished(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// camera->Open(pathStr, fileNameStr);
|
|
|
|
|
unsigned long photoId = videoId;
|
|
|
|
|
uint64_t photoId = videoId;
|
|
|
|
|
((CPhoneDevice *)dev)->OnVideoReady(photoOrVideo != JNI_FALSE, result != JNI_FALSE, pathStr, photoId);
|
|
|
|
|
if (path != NULL)
|
|
|
|
|
{
|
|
|
|
|