Skip to content

Commit

Permalink
sdk: improve adaptive flags
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Dec 1, 2023
1 parent 8ccbba4 commit a8c64aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions sdk/types/scrypted_python/scrypted_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ class PictureDimensions(TypedDict):
height: float
width: float

class RequestMediaStreamAdaptiveOptions(TypedDict):

keyframe: bool
packetLoss: bool
pictureLoss: bool
reconfigure: bool

class ScryptedDeviceAccessControl(TypedDict):
"""ScryptedDeviceAccessControl describes the methods and properties on a device that will be visible to the user. If methods is nullish, the user will be granted full access to all methods. If properties is nullish, the user will be granted full access to all properties. If events is nullish, the user will be granted full access to all events."""

Expand Down Expand Up @@ -651,7 +658,7 @@ class RecordingStreamThumbnailOptions(TypedDict):
class RequestMediaStreamOptions(TypedDict):
"""Options passed to VideoCamera.getVideoStream to request specific media formats. The audio/video properties may be omitted to indicate no audio/video is available when calling getVideoStreamOptions or no audio/video is requested when calling getVideoStream."""

adaptive: bool # Request an adaptive bitrate stream, if available. The destination will need to report packet loss indication.
adaptive: bool | RequestMediaStreamAdaptiveOptions # Request an adaptive bitrate stream, if available. The destination will need to report packet loss indication.
audio: AudioStreamOptions
container: str # The container type of this stream, ie: mp4, mpegts, rtsp.
destination: MediaStreamDestination # The intended destination for this media stream. May be used as a hint to determine which main/substream to send if no id is explicitly provided.
Expand All @@ -677,7 +684,7 @@ class RequestPictureOptions(TypedDict):
class RequestRecordingStreamOptions(TypedDict):
"""Options passed to VideoCamera.getVideoStream to request specific media formats. The audio/video properties may be omitted to indicate no audio/video is available when calling getVideoStreamOptions or no audio/video is requested when calling getVideoStream."""

adaptive: bool # Request an adaptive bitrate stream, if available. The destination will need to report packet loss indication.
adaptive: bool | RequestMediaStreamAdaptiveOptions # Request an adaptive bitrate stream, if available. The destination will need to report packet loss indication.
audio: AudioStreamOptions
container: str # The container type of this stream, ie: mp4, mpegts, rtsp.
destination: MediaStreamDestination # The intended destination for this media stream. May be used as a hint to determine which main/substream to send if no id is explicitly provided.
Expand Down
9 changes: 8 additions & 1 deletion sdk/types/src/types.input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,13 @@ export interface ResponseMediaStreamOptions extends MediaStreamOptions {

export type MediaStreamDestination = "local" | "remote" | "medium-resolution" | "low-resolution" | "local-recorder" | "remote-recorder";

export interface RequestMediaStreamAdaptiveOptions {
packetLoss?: boolean;
pictureLoss?: boolean;
keyframe?: boolean;
reconfigure?: boolean;
}

export interface RequestMediaStreamOptions extends MediaStreamOptions {
/**
* When retrieving media, setting route directs how the media should be
Expand Down Expand Up @@ -605,7 +612,7 @@ export interface RequestMediaStreamOptions extends MediaStreamOptions {
* Request an adaptive bitrate stream, if available. The destination
* will need to report packet loss indication.
*/
adaptive?: boolean;
adaptive?: boolean | RequestMediaStreamAdaptiveOptions;
}

export interface MediaStreamPacketLoss {
Expand Down

0 comments on commit a8c64aa

Please sign in to comment.