增加摄像头控制命令

PtzNew
Matthew 3 months ago
parent 8f9fa84028
commit 4c426cf5ff

@ -1462,4 +1462,17 @@ Java_com_xypower_mpapp_MicroPhotoService_getCustomAppId(JNIEnv *env, jobject thi
#else
return 0;
#endif
}
}
extern "C" JNIEXPORT void JNICALL
Java_com_xypower_mpapp_MicroPhotoService_sendCameraCtrl(
JNIEnv* env, jobject pThis, jlong handle, jint channel, jint preset, jint cmd) {
CTerminal* pTerminal = reinterpret_cast<CTerminal *>(handle);
if (pTerminal == NULL)
{
return;
}
pTerminal->SendCameraCtrl(channel, preset, cmd);
}

@ -128,6 +128,9 @@ public class MicroPhotoService extends Service {
private static final String ACTION_IMP_PUBKRY = "com.xypower.mpapp.ACT_IMP_PUBKEY";
private static final String ACTION_TAKE_PHOTO_MANUALLY = "com.xypower.mpapp.ACT_TP_M";
private static final String ACTION_CAMERA_CTRL = "com.xypower.mpapp.ACT_CAM_CTRL";
private static final String ACTION_HEARTBEAT_MANUALLY = "com.xypower.mpapp.ACT_HB_M";
private static final String ACTION_UPDATE_CONFIGS = "com.xypower.mpapp.ACT_UPD_CFG";
public static final String ACTION_VIDEO_FINISHED = "com.xypower.mpapp.ACT_V_FINISHED";
@ -325,6 +328,7 @@ public class MicroPhotoService extends Service {
intentFilter.addAction(ACTION_UPDATE_CONFIGS);
intentFilter.addAction(ACTION_IMP_PUBKRY);
intentFilter.addAction(ACTION_TAKE_PHOTO_MANUALLY);
intentFilter.addAction(ACTION_CAMERA_CTRL);
intentFilter.addAction(ACTION_HEARTBEAT_MANUALLY);
intentFilter.addAction(ACTION_GPS_TIMEOUT);
intentFilter.addAction(ACTION_RESTART);
@ -559,6 +563,11 @@ public class MicroPhotoService extends Service {
Log.i(TAG, "Take Photo CH=" + channel + " PR=" + preset + " Mannually");
mService.notifyToTakePhoto(mService.mNativeHandle, channel, preset, 0, url, mediaType);
} else if (TextUtils.equals(ACTION_CAMERA_CTRL, action)) {
int channel = intent.getIntExtra("channel", 0);
int preset = intent.getIntExtra("preset", 0);
int cmd = intent.getIntExtra("cmd", 0);
mService.sendCameraCtrl(mService.mNativeHandle, channel, preset, cmd);
} else if (TextUtils.equals(ACTION_UPDATE_CONFIGS, action)) {
int restart = intent.getIntExtra("restart", 0);
Log.i(TAG, "UPD CFG Fired ACTION=" + action + " restart=" + restart);
@ -1635,6 +1644,9 @@ cellSignalStrengthGsm.getDbm();
protected native void burstCaptureFinished(long handler, boolean result, int numberOfCaptures, String pathsJoinedByTab, boolean frontCamera, int rotation, long photoId);
public static native long takePhoto(int channel, int preset, boolean photoOrVideo, String configFilePath, String path);
protected native void sendCameraCtrl(long handler, int channel, int preset, int cmd);
public static native void releaseDeviceHandle(long deviceHandle);
public static native boolean sendExternalPhoto(long deviceHandle, String path, long photoInfo);
public static native void infoLog(String log);

Loading…
Cancel
Save