Skip to content

Commit

Permalink
sdk: add privacy mask support
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 17, 2024
1 parent a87a88d commit 7e9c23b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sdk/types/scrypted_python/scrypted_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class ScryptedInterface(str, Enum):
VOCSensor = "VOCSensor"
VideoCamera = "VideoCamera"
VideoCameraConfiguration = "VideoCameraConfiguration"
VideoCameraMask = "VideoCameraMask"
VideoClips = "VideoClips"
VideoFrameGenerator = "VideoFrameGenerator"
VideoRecorder = "VideoRecorder"
Expand Down Expand Up @@ -319,6 +320,10 @@ class PictureDimensions(TypedDict):
height: float
width: float

class PrivacyMask(TypedDict):

points: list[Point]

class RequestMediaStreamAdaptiveOptions(TypedDict):

keyframe: bool
Expand Down Expand Up @@ -658,6 +663,10 @@ class Position(TypedDict):
latitude: float
longitude: float

class PrivacyMasks(TypedDict):

masks: list[PrivacyMask]

class RecordedEvent(TypedDict):

data: Any
Expand Down Expand Up @@ -1457,6 +1466,15 @@ async def setVideoStreamOptions(self, options: MediaStreamOptions) -> None:
pass


class VideoCameraMask:

async def getPrivacyMasks(self) -> PrivacyMasks:
pass

async def setPrivacyMasks(self, masks: PrivacyMasks) -> None:
pass


class VideoClips:

async def getVideoClip(self, videoId: str) -> MediaObject:
Expand Down Expand Up @@ -1793,6 +1811,8 @@ class ScryptedInterfaceMethods(str, Enum):
stopDisplay = "stopDisplay"
getVideoStream = "getVideoStream"
getVideoStreamOptions = "getVideoStreamOptions"
getPrivacyMasks = "getPrivacyMasks"
setPrivacyMasks = "setPrivacyMasks"
getRecordingStream = "getRecordingStream"
getRecordingStreamCurrentTime = "getRecordingStreamCurrentTime"
getRecordingStreamOptions = "getRecordingStreamOptions"
Expand Down Expand Up @@ -2587,6 +2607,14 @@ def applicationInfo(self, value: LauncherApplicationInfo):
],
"properties": []
},
"VideoCameraMask": {
"name": "VideoCameraMask",
"methods": [
"getPrivacyMasks",
"setPrivacyMasks"
],
"properties": []
},
"VideoRecorder": {
"name": "VideoRecorder",
"methods": [
Expand Down
14 changes: 14 additions & 0 deletions sdk/types/src/types.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,19 @@ export interface Intercom {
stopIntercom(): Promise<void>;
}

export interface PrivacyMask {
points: Point[];
}

export interface PrivacyMasks {
masks: PrivacyMask[];
}

export interface VideoCameraMask {
getPrivacyMasks(): Promise<PrivacyMasks>;
setPrivacyMasks(masks: PrivacyMasks): Promise<void>;
}

export enum PanTiltZoomMovement {
Absolute = "Absolute",
Relative = "Relative"
Expand Down Expand Up @@ -2022,6 +2035,7 @@ export enum ScryptedInterface {
Microphone = "Microphone",
Display = "Display",
VideoCamera = "VideoCamera",
VideoCameraMask = "VideoCameraMask",
VideoRecorder = "VideoRecorder",
VideoRecorderManagement = "VideoRecorderManagement",
PanTiltZoom = "PanTiltZoom",
Expand Down

0 comments on commit 7e9c23b

Please sign in to comment.