mirror of
https://github.com/koush/scrypted.git
synced 2026-05-30 16:20:30 +01:00
sdk: image support
This commit is contained in:
@@ -36,6 +36,10 @@ class MediaPlayerState(Enum):
|
||||
Paused = "Paused"
|
||||
Playing = "Playing"
|
||||
|
||||
class PanTiltZoomMovement(Enum):
|
||||
Absolute = "Absolute"
|
||||
Relative = "Relative"
|
||||
|
||||
class ScryptedDeviceType(Enum):
|
||||
API = "API"
|
||||
Automation = "Automation"
|
||||
@@ -149,6 +153,7 @@ class ScryptedInterface(Enum):
|
||||
class ScryptedMimeTypes(Enum):
|
||||
FFmpegInput = "x-scrypted/x-ffmpeg-input"
|
||||
FFmpegTranscodeStream = "x-scrypted/x-ffmpeg-transcode-stream"
|
||||
Image = "x-scrypted/x-scrypted-image"
|
||||
InsecureLocalUrl = "text/x-insecure-local-uri"
|
||||
LocalUrl = "text/x-local-uri"
|
||||
MediaObject = "x-scrypted/x-scrypted-media-object"
|
||||
@@ -161,8 +166,6 @@ class ScryptedMimeTypes(Enum):
|
||||
RequestMediaObject = "x-scrypted/x-scrypted-request-media-object"
|
||||
RequestMediaStream = "x-scrypted/x-scrypted-request-stream"
|
||||
SchemePrefix = "x-scrypted/x-scrypted-scheme-"
|
||||
ScryptedDevice = "x-scrypted/x-scrypted-device"
|
||||
ScryptedDeviceId = "x-scrypted/x-scrypted-device-id"
|
||||
Url = "text/x-uri"
|
||||
|
||||
class SecuritySystemMode(Enum):
|
||||
@@ -228,6 +231,7 @@ class HttpResponseOptions(TypedDict):
|
||||
pass
|
||||
|
||||
class ImageOptions(TypedDict):
|
||||
crop: Any
|
||||
format: str
|
||||
resize: Any
|
||||
pass
|
||||
@@ -508,7 +512,9 @@ class PanTiltZoomCapabilities(TypedDict):
|
||||
pass
|
||||
|
||||
class PanTiltZoomCommand(TypedDict):
|
||||
movement: PanTiltZoomMovement
|
||||
pan: float
|
||||
speed: Any
|
||||
tilt: float
|
||||
zoom: float
|
||||
pass
|
||||
@@ -2401,7 +2407,7 @@ class VideoFrame:
|
||||
sourceId: str
|
||||
timestamp: float
|
||||
width: float
|
||||
async def read(self, options: ImageOptions = None) -> bytearray:
|
||||
async def toBuffer(self, options: ImageOptions = None) -> bytearray:
|
||||
pass
|
||||
pass
|
||||
|
||||
|
||||
@@ -1317,14 +1317,19 @@ export interface ImageOptions {
|
||||
width: number,
|
||||
height: number,
|
||||
};
|
||||
crop?: {
|
||||
left: number;
|
||||
top: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
format?: string;
|
||||
}
|
||||
export interface Image extends MediaObject {
|
||||
timestamp: number;
|
||||
width: number;
|
||||
height: number;
|
||||
format: string;
|
||||
read(options?: ImageOptions): Promise<Buffer>;
|
||||
toBuffer(options?: ImageOptions): Promise<Buffer>;
|
||||
}
|
||||
export interface VideoFrame extends Image {
|
||||
timestamp: number;
|
||||
@@ -2041,8 +2046,6 @@ export enum ScryptedMimeTypes {
|
||||
RequestMediaObject = 'x-scrypted/x-scrypted-request-media-object',
|
||||
RequestMediaStream = 'x-scrypted/x-scrypted-request-stream',
|
||||
MediaStreamFeedback = 'x-scrypted/x-media-stream-feedback',
|
||||
ScryptedDevice = 'x-scrypted/x-scrypted-device',
|
||||
ScryptedDeviceId = 'x-scrypted/x-scrypted-device-id',
|
||||
|
||||
FFmpegInput = 'x-scrypted/x-ffmpeg-input',
|
||||
FFmpegTranscodeStream = 'x-scrypted/x-ffmpeg-transcode-stream',
|
||||
@@ -2050,6 +2053,8 @@ export enum ScryptedMimeTypes {
|
||||
RTCSignalingChannel = 'x-scrypted/x-scrypted-rtc-signaling-channel',
|
||||
RTCSignalingSession = 'x-scrypted/x-scrypted-rtc-signaling-session',
|
||||
RTCConnectionManagement = 'x-scrypted/x-scrypted-rtc-connection-management',
|
||||
|
||||
Image = 'x-scrypted/x-scrypted-image',
|
||||
}
|
||||
|
||||
export type RequestMediaObject = () => Promise<MediaObject>;
|
||||
|
||||
Reference in New Issue
Block a user