Repository navigation
Expand file tree
/
Copy pathreplay.py
More file actions
60 lines (47 loc) · 2.18 KB
/
Copy pathreplay.py
File metadata and controls
60 lines (47 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
"""Replay service implementation."""
from onvif.operator import ONVIFOperator
from onvif.utils.service import ONVIFService
from onvif.utils.wsdl import ONVIFWSDL
# pylint: disable=invalid-name
class Replay(ONVIFService):
"""Recording service client.
| Property | Details |
| --- | --- |
| **First introduced** | ONVIF Release 2.1 (June 2011) Split from Core 2.0 |
| **Binding name** | `ReplayBinding` (`ver10/replay.wsdl`) |
| **Operations** | [replay.wsdl](https://developer.onvif.org/pub/specs/branches/development/wsdl/ver10/replay.wsdl) |
| **Specification** | [Replay.xml](https://developer.onvif.org/pub/specs/branches/development/doc/Replay.xml) |
"""
def __init__(self, xaddr=None, **kwargs):
definition = ONVIFWSDL.get_definition("replay")
self.operator = ONVIFOperator(
definition["path"],
binding=f"{{{definition['namespace']}}}{definition['binding']}",
service_path="Replay", # fallback
xaddr=xaddr,
**kwargs,
)
def GetServiceCapabilities(self):
"""Returns the capabilities of the replay service.
The result is returned in a typed answer.
"""
return self.operator.call("GetServiceCapabilities")
def GetReplayUri(self, StreamSetup, RecordingToken):
"""Requests a URI that can be used to initiate playback of a recorded stream
using RTSP as the control protocol.
The URI is valid only as it is specified in the response. A device supporting
the Replay Service shall support the GetReplayUri command.
"""
return self.operator.call(
"GetReplayUri", StreamSetup=StreamSetup, RecordingToken=RecordingToken
)
def GetReplayConfiguration(self):
"""Returns the current configuration of the replay service.
This operation is mandatory.
"""
return self.operator.call("GetReplayConfiguration")
def SetReplayConfiguration(self, Configuration):
"""Changes the current configuration of the replay service.
This operation is mandatory.
"""
return self.operator.call("SetReplayConfiguration", Configuration=Configuration)