ptz.controllers package
Submodules
ptz.controllers.controller module
Base class for the controllers
- class ptz.controllers.controller.Controller
Bases:
ABC
This class is the base for the controller
- abstract add_rules(app)
Add rules to flask server
- response(data, code: int = 200, mimetype: str = 'application/json')
Builds and returns Response for a request
- Parameters:
data – the data to be sent
code (int, optional) – HTTPStatus code. Defaults to 200.
mimetype (str, optional) – Response mimetype. Defaults to “application/json”.
- Returns:
A Flask Response object with the given data.
- Return type:
Flask.Response
ptz.controllers.positioncontroller module
Controller for PTZ position
- class ptz.controllers.positioncontroller.PositionController(ptz: PTZ)
Bases:
Controller
Controller for PTZ position
- add_rules(app)
Add rules
- Parameters:
app (Flask) – Flask application
- get_position()
Get the current PTZ position
- Returns:
json with the current position, or json with an error if there is an exception.
- Return type:
json
- position()
Defines the action based in the type of method in the request
- Returns:
get or put position
- Return type:
method
- put_position()
Set the current position according to the json included in request content
- Returns:
json with the position to set in the pipeline, or with an error if there is an exception.
- Return type:
json
ptz.controllers.streamcontroller module
Controller for input stream
- class ptz.controllers.streamcontroller.StreamController(ptz: PTZ)
Bases:
Controller
Controller for input stream
- add_rules(app)
Add rules
- Parameters:
app (Flask) – Flask application
- get_stream()
Get the current stream
- Returns:
json with the current in_uri, out_port, and out_mapping, or json with error if there is an exception.
- Return type:
json
- put_stream()
Set the current stream according to the json included in request content
- Returns:
json with the in_uri, out_port, and out_mapping to set in the pipeline, or json with error if there is an exception.
- Return type:
json
- stream()
Defines the action based in the type of method in the request
- Returns:
get or put stream
- Return type:
method
ptz.controllers.zoomcontroller module
Controller for Zoom
- class ptz.controllers.zoomcontroller.ZoomController(ptz: PTZ)
Bases:
Controller
Controller for Zoom
- add_rules(app)
Add rules
- Parameters:
app (Flask) – Flask application
- get_zoom()
Get the current Zoom
- Returns:
json with the current zoom, or json with an error if there is an exception.
- Return type:
json
- put_zoom()
Set the current Zoom according to the json included in request content
- Returns:
json with the zoom to set in the pipeline, or with an error message.
- Return type:
json
- zoom()
Defines the action based in the type of method in the request
- Returns:
get or put zoom
- Return type:
method