增加流媒体接口定义

streaming
Matthew 4 months ago
parent 20736f0c56
commit 4e16d4ff74

@ -1362,7 +1362,6 @@ Java_com_xypower_mpapp_MicroPhotoService_updateEhernet(
return JNI_TRUE; return JNI_TRUE;
} }
extern "C" JNIEXPORT jboolean JNICALL extern "C" JNIEXPORT jboolean JNICALL
Java_com_xypower_mpapp_MicroPhotoService_updateActiveNetwork( Java_com_xypower_mpapp_MicroPhotoService_updateActiveNetwork(
JNIEnv* env, jobject pThis, jlong handle, jlong networkHandle, jboolean available) { JNIEnv* env, jobject pThis, jlong handle, jlong networkHandle, jboolean available) {
@ -1382,3 +1381,24 @@ Java_com_xypower_mpapp_MicroPhotoService_updateActiveNetwork(
return JNI_TRUE; return JNI_TRUE;
} }
extern "C" JNIEXPORT jlong JNICALL
Java_com_xypower_mpapp_MicroPhotoService_requestPowerControl(
JNIEnv* env, jclass cls, jint type) {
if (type == 1) // Net
{
NetCameraPowerCtrl* powerControl = new NetCameraPowerCtrl(2);
return reinterpret_cast<jlong>(powerControl);
}
return 0L;
}
extern "C" JNIEXPORT jlong JNICALL
Java_com_xypower_mpapp_MicroPhotoService_releasePowerControl(
JNIEnv* env, jclass cls, jlong powerControlHandle) {
PowerControl* powerControl = reinterpret_cast<PowerControl*>(powerControlHandle);
delete powerControl;
}

@ -1686,6 +1686,11 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
return true; return true;
} }
bool CPhoneDevice::StartPushStreaming(IDevice::PHOTO_INFO& localPhotoInfo, const std::string& url, std::vector<IDevice::OSD_INFO>& osds, std::shared_ptr<PowerControl> powerCtrlPtr)
{
return true;
}
bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path) bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path)
{ {
if (photoInfo.width == 0 || photoInfo.height == 0) if (photoInfo.width == 0 || photoInfo.height == 0)
@ -1973,6 +1978,24 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
t.detach(); t.detach();
} }
else if ((mPhotoInfo.mediaType == XY_MEDIA_TYPE_STREAM || mPhotoInfo.mediaType == XY_MEDIA_TYPE_STREAM_OFF) && (mPhotoInfo.cameraType == CAM_TYPE_NET || mPhotoInfo.cameraType == CAM_TYPE_PLZ))
{
XYLOG(XYLOG_SEVERITY_INFO, "Start TP(Streaming) CH=%u PR=%X PHOTOID=%u", (uint32_t)mPhotoInfo.channel, (uint32_t)mPhotoInfo.preset, mPhotoInfo.photoId);
// Start Thread
CPhoneDevice* pThis = this;
vector<IDevice::OSD_INFO> osds;
osds.swap(mOsds);
IDevice::PHOTO_INFO localPhotoInfo = mPhotoInfo;
std::thread t([localPhotoInfo, path, pThis, osds, powerCtrlPtr]() mutable
{
pThis->StartPushStreaming(localPhotoInfo, path, osds, powerCtrlPtr);
});
t.detach();
}
else if (mPhotoInfo.usingSysCamera == 1) else if (mPhotoInfo.usingSysCamera == 1)
{ {
JNIEnv* env = NULL; JNIEnv* env = NULL;
@ -3964,6 +3987,7 @@ int CPhoneDevice::GetSerialPhoto(int devno, D_IMAGE_DEF *photo)
return GetImage(devno, (IMAGE_DEF*)photo); return GetImage(devno, (IMAGE_DEF*)photo);
} }
void CPhoneDevice::InitSerialComm(D_SENSOR_PARAM *sensorParam, char *filedir,const char *logpath) void CPhoneDevice::InitSerialComm(D_SENSOR_PARAM *sensorParam, char *filedir,const char *logpath)
{ {
Gm_InitSerialComm((SENSOR_PARAM *)sensorParam, filedir, logpath); Gm_InitSerialComm((SENSOR_PARAM *)sensorParam, filedir, logpath);

@ -273,6 +273,7 @@ protected:
// bool MatchCaptureSizeRequest(ACameraManager *cameraManager, const char *selectedCameraId, unsigned int width, unsigned int height, uint32_t cameraOrientation_, // bool MatchCaptureSizeRequest(ACameraManager *cameraManager, const char *selectedCameraId, unsigned int width, unsigned int height, uint32_t cameraOrientation_,
bool TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, const std::string& path, std::vector<IDevice::OSD_INFO>& osds, std::shared_ptr<PowerControl> powerCtrlPtr); bool TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, const std::string& path, std::vector<IDevice::OSD_INFO>& osds, std::shared_ptr<PowerControl> powerCtrlPtr);
bool StartPushStreaming(IDevice::PHOTO_INFO& localPhotoInfo, const std::string& url, std::vector<IDevice::OSD_INFO>& osds, std::shared_ptr<PowerControl> powerCtrlPtr);
bool PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector<IDevice::OSD_INFO>& osds, const std::string& path, const std::string& cameraInfo, cv::Mat mat); bool PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector<IDevice::OSD_INFO>& osds, const std::string& path, const std::string& cameraInfo, cv::Mat mat);
inline bool TakePhotoCb(int res, const IDevice::PHOTO_INFO& photoInfo, const string& path, time_t photoTime, const std::vector<IDevice::RECOG_OBJECT>& objects) const inline bool TakePhotoCb(int res, const IDevice::PHOTO_INFO& photoInfo, const string& path, time_t photoTime, const std::vector<IDevice::RECOG_OBJECT>& objects) const
{ {

@ -1679,6 +1679,9 @@ cellSignalStrengthGsm.getDbm();
public static native boolean exportPublicKeyFile(int index, String outputPath); public static native boolean exportPublicKeyFile(int index, String outputPath);
public static native boolean exportPrivateFile(int index, String outputPath); public static native boolean exportPrivateFile(int index, String outputPath);
public static native long requestPowerControl(int type);
public static native long releasePowerControl(long powerControlHandle);
////////////////////////GPS//////////////////// ////////////////////////GPS////////////////////
// private static final String GPS_LOCATION_NAME = android.location.LocationManager.GPS_PROVIDER; // private static final String GPS_LOCATION_NAME = android.location.LocationManager.GPS_PROVIDER;
private LocationManager mLocationManager; private LocationManager mLocationManager;

Loading…
Cancel
Save