rebroadcast/ring/google-device-access: stop harassing the user to change settings on their camera when their camera does not support it.

This commit is contained in:
Koushik Dutta
2022-01-30 15:55:50 -08:00
parent baa8cae8f3
commit 4525f51f59
15 changed files with 35 additions and 17 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/google-device-access",
"version": "0.0.77",
"version": "0.0.78",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/google-device-access",
"version": "0.0.77",
"version": "0.0.78",
"dependencies": {
"@googleapis/smartdevicemanagement": "^0.2.0",
"axios": "^0.21.1",

View File

@@ -45,5 +45,5 @@
"@types/node": "^14.17.11",
"@types/url-parse": "^1.4.3"
},
"version": "0.0.77"
"version": "0.0.78"
}

View File

@@ -32,12 +32,14 @@ function getSdmRtspMediaStreamOptions(): MediaStreamOptions {
codec: 'aac',
},
source: 'cloud',
userConfigurable: false,
};
}
function getSdmRtcMediaStreamOptions(signalingMime: string): MediaStreamOptions {
const ret = getRtcMediaStreamOptions('webrtc', 'WebRTC', signalingMime);
ret.source = 'cloud';
ret.userConfigurable = false;
return ret;
}

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/prebuffer-mixin",
"version": "0.1.144",
"version": "0.1.145",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/prebuffer-mixin",
"version": "0.1.144",
"version": "0.1.145",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/common": "file:../../common",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/prebuffer-mixin",
"version": "0.1.144",
"version": "0.1.145",
"description": "Rebroadcast and Prebuffer for VideoCameras.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -182,7 +182,7 @@ class PrebufferSession {
{
title: 'Rebroadcast Mode',
group,
description: 'The stream format to use when rebroadcasting. RTP will increase startup time but may resolve PCM audio issues.',
description: 'THIS FEATURE IS IN TESTING. DO NOT CHANGE THIS FROM MPEG-TS. The stream format to use when rebroadcasting. RTP will increase startup time but may resolve PCM audio issues.',
placeholder: 'MPEG-TS',
choices: [
'MPEG-TS',
@@ -280,9 +280,10 @@ class PrebufferSession {
? advertisedAudioCodec?.toLowerCase()
: this.detectedAudioCodec?.toLowerCase();
if (!probingAudioCodec) {
const audioIncompatible = !COMPATIBLE_AUDIO_CODECS.includes(assumedAudioCodec);
// after probing the audio codec is complete, alert the user with appropriate instructions.
// assume the codec is user configurable unless the camera explictly reports otherwise.
const audioIncompatible = !COMPATIBLE_AUDIO_CODECS.includes(assumedAudioCodec);
if (!probingAudioCodec && mso?.userConfigurable !== false) {
if (audioIncompatible) {
// show an alert that rebroadcast needs an explicit setting by the user.
if (isUsingDefaultAudioConfig) {
@@ -318,12 +319,19 @@ class PrebufferSession {
const detectedNoAudio = this.detectedAudioCodec === null;
// if the camera reports audio is incompatible and the user can't do anything about it
// enable transcoding by default. however, still allow the user to change the settings
// in case something changed.
const mustTranscode = isUsingDefaultAudioConfig && audioIncompatible;
if (mustTranscode)
this.console.log('camera reports it is not user configurable. transcoding due to incompatible codec', assumedAudioCodec);
if (audioSoftMuted || probingAudioCodec || detectedNoAudio) {
// no audio? explicitly disable it.
acodec = ['-an'];
this.audioDisabled = true;
}
else if (pcmAudio) {
else if (pcmAudio || mustTranscode) {
acodec = ['-an'];
}
else if (reencodeAudio || (advertisedAudioCodec && !COMPATIBLE_AUDIO_CODECS.includes(advertisedAudioCodec))) {

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/ring",
"version": "0.0.32",
"version": "0.0.33",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/ring",
"version": "0.0.32",
"version": "0.0.33",
"dependencies": {
"@homebridge/camera-utils": "^2.0.4",
"@types/node": "^16.6.1",

View File

@@ -37,5 +37,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.32"
"version": "0.0.33"
}

View File

@@ -206,6 +206,7 @@ class RingCameraDevice extends ScryptedDeviceBase implements BufferConverter, De
codec: 'pcm',
},
source: 'cloud',
userConfigurable: false,
};
}
@@ -219,6 +220,7 @@ class RingCameraDevice extends ScryptedDeviceBase implements BufferConverter, De
audio: {
},
source: 'cloud',
userConfigurable: false,
};
}

View File

@@ -381,6 +381,7 @@ export interface MediaStreamOptions {
metadata?: any;
source?: MediaStreamSource;
userConfigurable?: boolean;
}
export interface ResponseMediaStreamOptions extends MediaStreamOptions {

4
sdk/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/sdk",
"version": "0.0.151",
"version": "0.0.152",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/sdk",
"version": "0.0.151",
"version": "0.0.152",
"license": "ISC",
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.14.5",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/sdk",
"version": "0.0.151",
"version": "0.0.152",
"description": "",
"main": "index.js",
"scripts": {

View File

@@ -176,6 +176,7 @@ class ResponseMediaStreamOptions(TypedDict):
prebuffer: float
refreshAt: float
source: MediaStreamSource
userConfigurable: bool
video: VideoStreamOptions
pass
@@ -327,6 +328,7 @@ class MediaStreamOptions(TypedDict):
name: str
prebuffer: float
source: MediaStreamSource
userConfigurable: bool
video: VideoStreamOptions
pass
@@ -378,6 +380,7 @@ class RequestMediaStreamOptions(TypedDict):
prebuffer: float
refreshAt: float
source: MediaStreamSource
userConfigurable: bool
video: VideoStreamOptions
pass

1
sdk/types.d.ts vendored
View File

@@ -505,6 +505,7 @@ export interface MediaStreamOptions {
*/
metadata?: any;
source?: MediaStreamSource;
userConfigurable?: boolean;
}
export interface ResponseMediaStreamOptions extends MediaStreamOptions {
/**

View File

@@ -1030,6 +1030,7 @@ export interface MediaStreamOptions {
metadata?: any;
source?: MediaStreamSource;
userConfigurable?: boolean;
}
export interface ResponseMediaStreamOptions extends MediaStreamOptions {