|
|
|
@ -1,6 +1,5 @@
|
|
|
|
package com.zhehekeji.web.lib;
|
|
|
|
package com.zhehekeji.web.lib;
|
|
|
|
|
|
|
|
|
|
|
|
import com.sun.jna.*;
|
|
|
|
|
|
|
|
import com.sun.jna.ptr.IntByReference;
|
|
|
|
import com.sun.jna.ptr.IntByReference;
|
|
|
|
import com.zhehekeji.common.util.PathUtil;
|
|
|
|
import com.zhehekeji.common.util.PathUtil;
|
|
|
|
import com.zhehekeji.core.util.Assert;
|
|
|
|
import com.zhehekeji.core.util.Assert;
|
|
|
|
@ -13,7 +12,8 @@ import java.time.LocalDateTime;
|
|
|
|
* 主要有 :八个方向控制、变倍、变焦、光圈功能
|
|
|
|
* 主要有 :八个方向控制、变倍、变焦、光圈功能
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
public class PtzControlModule {
|
|
|
|
public class ZWPtzControlModule {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static CallBack.Mp4ReceiveCB mp4ReceiveCB = new CallBack.Mp4ReceiveCB();
|
|
|
|
private static CallBack.Mp4ReceiveCB mp4ReceiveCB = new CallBack.Mp4ReceiveCB();
|
|
|
|
|
|
|
|
|
|
|
|
@ -21,13 +21,14 @@ public class PtzControlModule {
|
|
|
|
* 向上
|
|
|
|
* 向上
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlUpStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlUpStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_UP_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_UP_CONTROL,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlUpEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlUpEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_UP_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_UP_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -36,13 +37,13 @@ public class PtzControlModule {
|
|
|
|
* 向下
|
|
|
|
* 向下
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlDownStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlDownStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_DOWN_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_DOWN_CONTROL,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlDownEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlDownEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_DOWN_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_DOWN_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -51,13 +52,13 @@ public class PtzControlModule {
|
|
|
|
* 向左
|
|
|
|
* 向左
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlLeftStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlLeftStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_LEFT_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_LEFT_CONTROL,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlLeftEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlLeftEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_LEFT_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_LEFT_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -66,13 +67,13 @@ public class PtzControlModule {
|
|
|
|
* 向右
|
|
|
|
* 向右
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlRightStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlRightStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_RIGHT_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_RIGHT_CONTROL,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlRightEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlRightEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_RIGHT_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_RIGHT_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -81,13 +82,13 @@ public class PtzControlModule {
|
|
|
|
* 向左上
|
|
|
|
* 向左上
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlLeftUpStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlLeftUpStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTTOP,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTTOP,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlLeftUpEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlLeftUpEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTTOP,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTTOP,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -96,13 +97,13 @@ public class PtzControlModule {
|
|
|
|
* 向右上
|
|
|
|
* 向右上
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlRightUpStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlRightUpStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTTOP,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTTOP,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlRightUpEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlRightUpEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTTOP,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTTOP,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -111,13 +112,13 @@ public class PtzControlModule {
|
|
|
|
* 向左下
|
|
|
|
* 向左下
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlLeftDownStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlLeftDownStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTDOWN,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTDOWN,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlLeftDownEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlLeftDownEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTDOWN,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_LEFTDOWN,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -126,13 +127,13 @@ public class PtzControlModule {
|
|
|
|
* 向右下
|
|
|
|
* 向右下
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlRightDownStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
public static boolean ptzControlRightDownStart(Integer cameraId, int nChannelID, int lParam1, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTDOWN,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTDOWN,
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
lParam1, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlRightDownEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlRightDownEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTDOWN,
|
|
|
|
NetSDKLib.NET_EXTPTZ_ControlType.NET_EXTPTZ_RIGHTDOWN,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -141,13 +142,13 @@ public class PtzControlModule {
|
|
|
|
* 变倍+
|
|
|
|
* 变倍+
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlZoomAddStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
public static boolean ptzControlZoomAddStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_ADD_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_ADD_CONTROL,
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlZoomAddEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlZoomAddEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_ADD_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_ADD_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -156,13 +157,13 @@ public class PtzControlModule {
|
|
|
|
* 变倍-
|
|
|
|
* 变倍-
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlZoomDecStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
public static boolean ptzControlZoomDecStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_DEC_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_DEC_CONTROL,
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlZoomDecEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlZoomDecEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_DEC_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_ZOOM_DEC_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -171,13 +172,13 @@ public class PtzControlModule {
|
|
|
|
* 变焦+
|
|
|
|
* 变焦+
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlFocusAddStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
public static boolean ptzControlFocusAddStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_ADD_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_ADD_CONTROL,
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlFocusAddEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlFocusAddEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_ADD_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_ADD_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -186,13 +187,13 @@ public class PtzControlModule {
|
|
|
|
* 变焦-
|
|
|
|
* 变焦-
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlFocusDecStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
public static boolean ptzControlFocusDecStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_DEC_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_DEC_CONTROL,
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlFocusDecEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlFocusDecEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_DEC_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_FOCUS_DEC_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -201,13 +202,13 @@ public class PtzControlModule {
|
|
|
|
* 光圈+
|
|
|
|
* 光圈+
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlIrisAddStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
public static boolean ptzControlIrisAddStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_ADD_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_ADD_CONTROL,
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlIrisAddEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlIrisAddEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_ADD_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_ADD_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -216,13 +217,13 @@ public class PtzControlModule {
|
|
|
|
* 光圈-
|
|
|
|
* 光圈-
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static boolean ptzControlIrisDecStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
public static boolean ptzControlIrisDecStart(Integer cameraId, int nChannelID, int lParam2) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_DEC_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_DEC_CONTROL,
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
0, lParam2, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean ptzControlIrisDecEnd(Integer cameraId, int nChannelID) {
|
|
|
|
public static boolean ptzControlIrisDecEnd(Integer cameraId, int nChannelID) {
|
|
|
|
return LoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_DHPTZControlEx(CameraConnMap.getConnId(cameraId), nChannelID,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_DEC_CONTROL,
|
|
|
|
NetSDKLib.NET_PTZ_ControlType.NET_PTZ_APERTURE_DEC_CONTROL,
|
|
|
|
0, 0, 0, 1);
|
|
|
|
0, 0, 0, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -236,7 +237,7 @@ public class PtzControlModule {
|
|
|
|
stuSnapParams.CmdSerial = OrderCmdSerial.nextSerial();
|
|
|
|
stuSnapParams.CmdSerial = OrderCmdSerial.nextSerial();
|
|
|
|
OrderCmdSerial.put(stuSnapParams.CmdSerial, orderInfo);
|
|
|
|
OrderCmdSerial.put(stuSnapParams.CmdSerial, orderInfo);
|
|
|
|
IntByReference reserved = new IntByReference(0);
|
|
|
|
IntByReference reserved = new IntByReference(0);
|
|
|
|
return LoginModule.netsdk.CLIENT_SnapPictureEx(CameraConnMap.getConnId(cameraId), stuSnapParams, reserved);
|
|
|
|
return ZWLoginModule.netsdk.CLIENT_SnapPictureEx(CameraConnMap.getConnId(cameraId), stuSnapParams, reserved);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -260,7 +261,7 @@ public class PtzControlModule {
|
|
|
|
NetSDKLib.NET_OUT_DOWNLOAD_BY_DATA_TYPE net_out_download_by_data_type = new NetSDKLib.NET_OUT_DOWNLOAD_BY_DATA_TYPE();
|
|
|
|
NetSDKLib.NET_OUT_DOWNLOAD_BY_DATA_TYPE net_out_download_by_data_type = new NetSDKLib.NET_OUT_DOWNLOAD_BY_DATA_TYPE();
|
|
|
|
net_out_download_by_data_type.write();
|
|
|
|
net_out_download_by_data_type.write();
|
|
|
|
log.info("start download mp4 path:{},startTime:{} ,endTime:{},now:{}", path, startTime.toString(), endTime.toString(), LocalDateTime.now());
|
|
|
|
log.info("start download mp4 path:{},startTime:{} ,endTime:{},now:{}", path, startTime.toString(), endTime.toString(), LocalDateTime.now());
|
|
|
|
NetSDKLib.LLong l = LoginModule.netsdk.CLIENT_DownloadByDataType(CameraConnMap.getConnId(cameraId), download_by_data_type.getPointer(), net_out_download_by_data_type.getPointer(), 8000);
|
|
|
|
NetSDKLib.LLong l = ZWLoginModule.netsdk.CLIENT_DownloadByDataType(CameraConnMap.getConnId(cameraId), download_by_data_type.getPointer(), net_out_download_by_data_type.getPointer(), 8000);
|
|
|
|
if (l.longValue() == 0) {
|
|
|
|
if (l.longValue() == 0) {
|
|
|
|
log.error("download error :{}", ToolKits.getErrorCodePrint());
|
|
|
|
log.error("download error :{}", ToolKits.getErrorCodePrint());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -277,7 +278,7 @@ public class PtzControlModule {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static void ptz(Integer ptzId, String name, Integer cameraId) {
|
|
|
|
public static void ptz(Integer ptzId, String name, Integer cameraId) {
|
|
|
|
int dwzCommand = NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_SET_CONTROL;
|
|
|
|
int dwzCommand = NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_SET_CONTROL;
|
|
|
|
Boolean ok = LoginModule.netsdk.CLIENT_DHPTZControlEx2(CameraConnMap.getConnId(cameraId), 0, dwzCommand, 0, ptzId, 0, 0, ToolKits.GetGBKStringToPointer(name));
|
|
|
|
Boolean ok = ZWLoginModule.netsdk.CLIENT_DHPTZControlEx2(CameraConnMap.getConnId(cameraId), 0, dwzCommand, 0, ptzId, 0, 0, ToolKits.GetGBKStringToPointer(name));
|
|
|
|
Assert.isTrue(ok, "设置失败");
|
|
|
|
Assert.isTrue(ok, "设置失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -289,7 +290,7 @@ public class PtzControlModule {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static void toPtz(Integer ptzId, Integer cameraId) {
|
|
|
|
public static void toPtz(Integer ptzId, Integer cameraId) {
|
|
|
|
int dwPTZCommand = NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_MOVE_CONTROL;
|
|
|
|
int dwPTZCommand = NetSDKLib.NET_PTZ_ControlType.NET_PTZ_POINT_MOVE_CONTROL;
|
|
|
|
Boolean ok = LoginModule.netsdk.CLIENT_DHPTZControlEx2(CameraConnMap.getConnId(cameraId), 0, dwPTZCommand, 0, ptzId, 0, 0, null);
|
|
|
|
Boolean ok = ZWLoginModule.netsdk.CLIENT_DHPTZControlEx2(CameraConnMap.getConnId(cameraId), 0, dwPTZCommand, 0, ptzId, 0, 0, null);
|
|
|
|
if (!ok) {
|
|
|
|
if (!ok) {
|
|
|
|
log.error("转至预置点 失败 cameraId:{},ptzId:{},error:{}", cameraId, ptzId,ToolKits.getErrorCodePrint());
|
|
|
|
log.error("转至预置点 失败 cameraId:{},ptzId:{},error:{}", cameraId, ptzId,ToolKits.getErrorCodePrint());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -310,7 +311,7 @@ public class PtzControlModule {
|
|
|
|
absolutely.stuSpeed.fPositionY = 0.2f;
|
|
|
|
absolutely.stuSpeed.fPositionY = 0.2f;
|
|
|
|
absolutely.write();
|
|
|
|
absolutely.write();
|
|
|
|
//absolutely.stuSpeed.fZoom = 0.5f;
|
|
|
|
//absolutely.stuSpeed.fZoom = 0.5f;
|
|
|
|
Boolean ok = LoginModule.netsdk.CLIENT_DHPTZControlEx2(CameraConnMap.getConnId(cameraId), 0, dwPTZCommand,
|
|
|
|
Boolean ok = ZWLoginModule.netsdk.CLIENT_DHPTZControlEx2(CameraConnMap.getConnId(cameraId), 0, dwPTZCommand,
|
|
|
|
0, 0, 0, 0, absolutely.getPointer());
|
|
|
|
0, 0, 0, 0, absolutely.getPointer());
|
|
|
|
if (!ok) {
|
|
|
|
if (!ok) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -332,7 +333,7 @@ public class PtzControlModule {
|
|
|
|
|
|
|
|
|
|
|
|
ptzLocationInfo.write();
|
|
|
|
ptzLocationInfo.write();
|
|
|
|
System.out.println("size:"+ptzLocationInfo.size());
|
|
|
|
System.out.println("size:"+ptzLocationInfo.size());
|
|
|
|
boolean bRet = LoginModule.netsdk.CLIENT_QueryDevState(CameraConnMap.getConnId(cameraId), nType, ptzLocationInfo.getPointer(), ptzLocationInfo.size(), intRetLen, 3000);
|
|
|
|
boolean bRet = ZWLoginModule.netsdk.CLIENT_QueryDevState(CameraConnMap.getConnId(cameraId), nType, ptzLocationInfo.getPointer(), ptzLocationInfo.size(), intRetLen, 3000);
|
|
|
|
ptzLocationInfo.read();
|
|
|
|
ptzLocationInfo.read();
|
|
|
|
|
|
|
|
|
|
|
|
if (bRet) {
|
|
|
|
if (bRet) {
|