Add PTZ functionality

This commit is contained in:
MrDave
2021-03-16 19:10:04 -06:00
committed by Mr-Dave
parent b6a44fd52c
commit e5e76548d3
5 changed files with 242 additions and 42 deletions

View File

@@ -210,11 +210,11 @@ static void mlp_detected_trigger(struct ctx_cam *cam, struct ctx_image_data *img
static void mlp_track_center(struct ctx_cam *cam)
{
if ((cam->conf->track_auto) && (cam->conf->track_move_command != "")) {
if ((cam->conf->ptz_auto_track) && (cam->conf->ptz_move_track != "")) {
cam->track_posx = 0;
cam->track_posy = 0;
util_exec_command(cam, cam->conf->track_move_command.c_str(), NULL, 0);
cam->frame_skip = cam->conf->track_move_wait;
util_exec_command(cam, cam->conf->ptz_move_track.c_str(), NULL, 0);
cam->frame_skip = cam->conf->ptz_wait;
}
}
@@ -222,11 +222,11 @@ static void mlp_track_center(struct ctx_cam *cam)
static void mlp_track_move(struct ctx_cam *cam, struct ctx_coord *cent)
{
if ((cam->conf->track_auto) && (cam->conf->track_move_command != "")) {
if ((cam->conf->ptz_auto_track) && (cam->conf->ptz_move_track != "")) {
cam->track_posx += cent->x;
cam->track_posy += cent->y;
util_exec_command(cam, cam->conf->track_move_command.c_str(), NULL, 0);
cam->frame_skip = cam->conf->track_move_wait;
util_exec_command(cam, cam->conf->ptz_move_track.c_str(), NULL, 0);
cam->frame_skip = cam->conf->ptz_wait;
}
}