![]() |
AXptz
|
The movement handler and its functions. More...
Go to the source code of this file.
Data Structures | |
struct | AXPTZMonotonicTimestamp |
A structure for keeping time stamp information. More... | |
struct | AXPTZStatus |
A structure with the current pan, tilt and zoom coordinates and move statuses. The coordinates are given in the requested pan, tilt and zoom spaces. More... | |
struct | AXPTZLimits |
A structure with the lower and upper limits for the pan, tilt and zoom coordinates. The limits are given in the requested pan, tilt and zoom spaces. Unsupported coordinates are set to zero. More... | |
Functions | |
gboolean | ax_ptz_movement_handler_set_absolute_spaces (AXPTZMovementPanTiltSpace pan_tilt_space, AXPTZMovementPanTiltSpeedSpace pan_tilt_speed_space, AXPTZMovementZoomSpace zoom_space, GError **error) |
Sets the spaces for the absolute movements. More... | |
gboolean | ax_ptz_movement_handler_absolute_move (const AXPTZControlQueueGroup *group, gint video_channel, const AXPTZAbsoluteMovement *movement, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error) |
Performs an absolute movement. More... | |
gboolean | ax_ptz_movement_handler_set_relative_spaces (AXPTZMovementPanTiltSpace pan_tilt_space, AXPTZMovementPanTiltSpeedSpace pan_tilt_speed_space, AXPTZMovementZoomSpace zoom_space, GError **error) |
Sets the spaces for the relative movements. More... | |
gboolean | ax_ptz_movement_handler_relative_move (const AXPTZControlQueueGroup *group, gint video_channel, const AXPTZRelativeMovement *movement, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error) |
Performs a relative movement. More... | |
gboolean | ax_ptz_movement_handler_set_continuous_spaces (AXPTZMovementPanTiltSpeedSpace pan_tilt_speed_space, GError **error) |
Sets the spaces for the continuous movements. More... | |
gboolean | ax_ptz_movement_handler_continuous_start (const AXPTZControlQueueGroup *group, gint video_channel, const AXPTZContinuousMovement *movement, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error) |
Starts a continuous movement. More... | |
gboolean | ax_ptz_movement_handler_continuous_stop (const AXPTZControlQueueGroup *group, gint video_channel, gboolean stop_pan_tilt, gboolean stop_zoom, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error) |
Stops a continuous movement. More... | |
gboolean | ax_ptz_movement_handler_get_ptz_status (gint video_channel, AXPTZMovementPanTiltSpace pan_tilt_space, AXPTZMovementZoomSpace zoom_space, AXPTZStatus **status, GError **error) |
Gets the current pan, tilt and zoom coordinates and movement statuses. More... | |
gboolean | ax_ptz_movement_handler_get_ptz_limits (gint video_channel, AXPTZMovementPanTiltSpace pan_tilt_space, AXPTZMovementZoomSpace zoom_space, AXPTZLimits **limits, GError **error) |
Gets the pan, tilt and zoom limits. More... | |
gboolean | ax_ptz_movement_handler_get_fov (gint video_channel, fixed_t *h_fov, fixed_t *v_fov, GError **error) |
Gets the horizontal and vertical field of view in degrees. More... | |
gboolean | ax_ptz_movement_handler_is_ptz_moving (gint video_channel, gboolean *is_moving, GError **error) |
Checks if the camera is panning, tilting, zooming, focusing, adjusting brightness or adjusting iris. More... | |
GList * | ax_ptz_movement_handler_get_move_capabilities (gint video_channel, GError **error) |
Gets the supported PTZ move capabilities. More... | |
The movement handler and its functions.
AXPTZMovmentHandler
handles absolute, relative and continuous PTZ movements (AXPTZAbsoluteMovement
, AXPTZRelativeMovement
, AXPTZContinuousMovement
). For each type of PTZ movement, spaces for the pan/tilt coordinates, the pan/tilt speed and the zoom coordinate can be defined. In addition, status of the current PTZ coordinates, coordinate limits, supported move capabilities and “is PTZ moving” can be requested.
The spaces can be set to different values for absolute, relative and continuous PTZ movements. Available space types and spaces are:
AXPTZMovementPanTiltSpace
for the pan and tilt coordinates.AX_PTZ_MOVEMENT_PAN_TILT_UNITLESS
In this space, unitless pan and tilt coordinates is used.AX_PTZ_MOVEMENT_PAN_TILT_DEGREE
In this space, the unit for the pan and tilt coordinates is degrees.AXPTZMovementPanTiltSpeedSpace
for the pan and tilt speed.AX_PTZ_MOVEMENT_PAN_TILT_SPEED_UNITLESS
In this space, unitless pan and tilt speed are used.AXPTZMovementZoomSpace
for the zoom coordinate.AX_PTZ_MOVEMENT_ZOOM_UNITLESS
In this space, unitless zoom is used.AX_PTZ_MOVEMENT_ZOOM_MAGNIFICATION
In this space, the unit for the zoom coordinate is magnification ratio.Here, unitless means a normalized range from 0 to 1, from -1 to 1 or from -0.5 to 0.5. The following table shows the ranges for the different movement types and spaces:
Unitless space | Degree space | Magnification space | |
Absolute pan/tilt coordinates | -0.5 ... 0.5 | -180.0 ... 180.0 | N/A |
Absolute pan/tilt speed | 0.0 ... 1.0 | N/A | N/A |
Absolute zoom coordinate | 0.0 ... 1.0 | N/A | Camera unique. |
Relative pan/tilt coordinates | -1.0 ... 1.0 | -360.0 ... 360.0 | N/A |
Relative pan/tilt speed | 0.0 ... 1.0 | N/A | N/A |
Relative zoom coordinate | 0.0 ... 1.0 | N/A | Camera unique. |
Continuous pan/tilt speed | -1.0 ... 1.0 | N/A | N/A |
enum AXPTZMoveStatus |
gboolean ax_ptz_movement_handler_set_absolute_spaces | ( | AXPTZMovementPanTiltSpace | pan_tilt_space, |
AXPTZMovementPanTiltSpeedSpace | pan_tilt_speed_space, | ||
AXPTZMovementZoomSpace | zoom_space, | ||
GError ** | error | ||
) |
Sets the spaces for the absolute movements.
pan_tilt_space | The space for the pan and tilt coordinates. Supported: AX_PTZ_MOVEMENT_PAN_TILT_UNITLESS , AX_PTZ_MOVEMENT_PAN_TILT_DEGREE Default: AX_PTZ_MOVEMENT_PAN_TILT_DEGREE |
pan_tilt_speed_space | The space for the pan and tilt speed. Supported: AX_PTZ_MOVEMENT_PAN_TILT_SPEED_UNITLESS |
zoom_space | The space for the zoom coordinate. Supported: AX_PTZ_MOVEMENT_ZOOM_UNITLESS |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. Critical section Important!!! See ax_ptz.c for the thread safety rules in this library.
References AX_PTZ_MOVEMENT_PAN_TILT_UNKNOWN.
gboolean ax_ptz_movement_handler_absolute_move | ( | const AXPTZControlQueueGroup * | group, |
gint | video_channel, | ||
const AXPTZAbsoluteMovement * | movement, | ||
AXPTZInvoke | invoke, | ||
void * | callback_func, | ||
void * | user_data, | ||
GError ** | error | ||
) |
Performs an absolute movement.
group | A group in the PTZ control queue. |
video_channel | A video channel. Starts from video channel 1. |
movement | An absolute movement. |
invoke | The invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC . |
callback_func | Future use. Must be set to NULL . |
user_data | Future use. Must be set to NULL . |
error | Return location for a GError or NULL . |
TRUE
if the movement command was successfully sent to the underlying PTZ framework, FALSE
on failure. gboolean ax_ptz_movement_handler_set_relative_spaces | ( | AXPTZMovementPanTiltSpace | pan_tilt_space, |
AXPTZMovementPanTiltSpeedSpace | pan_tilt_speed_space, | ||
AXPTZMovementZoomSpace | zoom_space, | ||
GError ** | error | ||
) |
Sets the spaces for the relative movements.
pan_tilt_space | The space for the pan and tilt coordinates. Supported: AX_PTZ_MOVEMENT_PAN_TILT_UNITLESS , AX_PTZ_MOVEMENT_PAN_TILT_DEGREE Default: AX_PTZ_MOVEMENT_PAN_TILT_DEGREE |
pan_tilt_speed_space | The space for the pan and tilt speed. Supported: AX_PTZ_MOVEMENT_PAN_TILT_SPEED_UNITLESS |
zoom_space | The space for the zoom coordinate. Supported: AX_PTZ_MOVEMENT_ZOOM_UNITLESS |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. Critical section Important!!! See ax_ptz.c for the thread safety rules in this library.
References AX_PTZ_MOVEMENT_PAN_TILT_UNKNOWN.
gboolean ax_ptz_movement_handler_relative_move | ( | const AXPTZControlQueueGroup * | group, |
gint | video_channel, | ||
const AXPTZRelativeMovement * | movement, | ||
AXPTZInvoke | invoke, | ||
void * | callback_func, | ||
void * | user_data, | ||
GError ** | error | ||
) |
Performs a relative movement.
group | A group in the PTZ control queue. |
video_channel | A video channel. Starts from video channel 1. |
movement | A relative movement. |
invoke | The invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC . |
callback_func | Future use. Must be set to NULL . |
user_data | Future use. Must be set to NULL . |
error | Return location for a GError or NULL . |
TRUE
if the movement command was successfully sent to the underlying PTZ framework, FALSE
on failure. gboolean ax_ptz_movement_handler_set_continuous_spaces | ( | AXPTZMovementPanTiltSpeedSpace | pan_tilt_speed_space, |
GError ** | error | ||
) |
Sets the spaces for the continuous movements.
pan_tilt_speed_space | The space for the pan and tilt speed. Supported: AX_PTZ_MOVEMENT_PAN_TILT_SPEED_UNITLESS |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. Critical section Important!!! See ax_ptz.c for the thread safety rules in this library.
References AX_PTZ_MOVEMENT_PAN_TILT_SPEED_UNKNOWN.
gboolean ax_ptz_movement_handler_continuous_start | ( | const AXPTZControlQueueGroup * | group, |
gint | video_channel, | ||
const AXPTZContinuousMovement * | movement, | ||
AXPTZInvoke | invoke, | ||
void * | callback_func, | ||
void * | user_data, | ||
GError ** | error | ||
) |
Starts a continuous movement.
group | A group in the PTZ control queue. |
video_channel | A video channel. Starts from video channel 1. |
movement | A continuous movement. |
invoke | The invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC . |
callback_func | Future use. Must be set to NULL . |
user_data | Future use. Must be set to NULL . |
error | Return location for a GError or NULL . |
TRUE
if the movement command was successfully sent to the underlying PTZ framework, FALSE
on failure. gboolean ax_ptz_movement_handler_continuous_stop | ( | const AXPTZControlQueueGroup * | group, |
gint | video_channel, | ||
gboolean | stop_pan_tilt, | ||
gboolean | stop_zoom, | ||
AXPTZInvoke | invoke, | ||
void * | callback_func, | ||
void * | user_data, | ||
GError ** | error | ||
) |
Stops a continuous movement.
group | A group in the PTZ control queue. |
video_channel | A video channel. Starts from video channel 1. |
stop_pan_tilt | Stop pan and tilt. |
stop_zoom | Stop zoom. |
invoke | The invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC . |
callback_func | Future use. Must be set to NULL . |
user_data | Future use. Must be set to NULL . |
error | Return location for a GError or NULL . |
TRUE
if the movement command was successfully sent to the underlying PTZ framework, FALSE
on failure. gboolean ax_ptz_movement_handler_get_ptz_status | ( | gint | video_channel, |
AXPTZMovementPanTiltSpace | pan_tilt_space, | ||
AXPTZMovementZoomSpace | zoom_space, | ||
AXPTZStatus ** | status, | ||
GError ** | error | ||
) |
Gets the current pan, tilt and zoom coordinates and movement statuses.
video_channel | A video channel. Starts from video channel 1. |
pan_tilt_space | The space for the pan and tilt coordinates. Supported: AX_PTZ_MOVEMENT_PAN_TILT_UNITLESS , AX_PTZ_MOVEMENT_PAN_TILT_DEGREE . |
zoom_space | The space for the zoom coordinate. Supported: AX_PTZ_MOVEMENT_ZOOM_UNITLESS , AX_PTZ_MOVEMENT_ZOOM_MAGNIFICATION |
status | Returns a struct with pan, tilt and zoom coordinates and statuses. |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. gboolean ax_ptz_movement_handler_get_ptz_limits | ( | gint | video_channel, |
AXPTZMovementPanTiltSpace | pan_tilt_space, | ||
AXPTZMovementZoomSpace | zoom_space, | ||
AXPTZLimits ** | limits, | ||
GError ** | error | ||
) |
Gets the pan, tilt and zoom limits.
video_channel | A video channel. Starts from video channel 1. |
pan_tilt_space | The space for the pan and tilt coordinates. Supported: AX_PTZ_MOVEMENT_PAN_TILT_UNITLESS , AX_PTZ_MOVEMENT_PAN_TILT_DEGREE . |
zoom_space | The space for the zoom coordinate. Supported: AX_PTZ_MOVEMENT_ZOOM_UNITLESS |
limits | Returns a struct with the PTZ limits. |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. gboolean ax_ptz_movement_handler_get_fov | ( | gint | video_channel, |
fixed_t * | h_fov, | ||
fixed_t * | v_fov, | ||
GError ** | error | ||
) |
Gets the horizontal and vertical field of view in degrees.
video_channel | A video channel. Starts from video channel 1. |
h_fov | Returns the horizontal field of view in degrees. |
v_fov | Returns the vertical field of view in degrees. |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. gboolean ax_ptz_movement_handler_is_ptz_moving | ( | gint | video_channel, |
gboolean * | is_moving, | ||
GError ** | error | ||
) |
Checks if the camera is panning, tilting, zooming, focusing, adjusting brightness or adjusting iris.
video_channel | A video channel. Starts from video channel 1. |
is_moving | Returns TRUE if the camera is panning, tilting, zooming, focusing, adjusting brightness or adjusting iris, otherwise FALSE . |
error | Return location for a GError or NULL . |
TRUE
on success, FALSE
on failure. GList* ax_ptz_movement_handler_get_move_capabilities | ( | gint | video_channel, |
GError ** | error | ||
) |
Gets the supported PTZ move capabilities.
Possible capabilities: AX_PTZ_MOVE_ABS_PAN
Absolute pan. AX_PTZ_MOVE_REL_PAN
Relative pan. AX_PTZ_MOVE_CONT_PAN
Continuous pan. AX_PTZ_MOVE_ABS_TILT
Absolute tilt. AX_PTZ_MOVE_REL_TILT
Relative tilt. AX_PTZ_MOVE_CONT_TILT
Continuous tilt. AX_PTZ_MOVE_ABS_ZOOM
Absolute zoom. AX_PTZ_MOVE_REL_ZOOM
Relative zoom. AX_PTZ_MOVE_CONT_ZOOM
Continuous zoom.
video_channel | A video channel. Starts from video channel 1. |
error | Return location for a GError or NULL . |
GList
of allocated strings with the move capabilities on success, NULL
on failure. Destroy it by using g_free on the elements and g_list_free on the list.