matterbridge-example-camera 0.0.4-dev-20260720-d558241 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -18
- package/README.md +4 -17
- package/dist/behaviors/webRtcTransportProviderServer.js +16 -1
- package/dist/devices/camera.js +8 -2
- package/dist/devices/doorbell.js +5 -3
- package/dist/webrtc/weriftSession.js +4 -40
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/dist/behaviors/clients.js +0 -24
- package/dist/devices/audioDoorbell.js +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -28,24 +28,6 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
28
28
|
|
|
29
29
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
30
30
|
|
|
31
|
-
## [0.0.5] - Dev branch
|
|
32
|
-
|
|
33
|
-
## Added
|
|
34
|
-
|
|
35
|
-
- [wirift]: Add codec negotiation and ffmpeg windows path.
|
|
36
|
-
- [audio doorbell]: Add the Audio Doorbell device type with the required Identify, Switch (MomentarySwitch feature), Camera AV Stream Management (Audio feature), and WebRtcTransportProvider clusters, plus the Chime and WebRtcTransportRequestor client clusters, and Power Source support.
|
|
37
|
-
- [clients]: Add `src/behaviors/clients.ts` with `addChimeClient`/`addWebRtcTransportRequestorClient` helpers, shared by `Doorbell`, `AudioDoorbell`, and `Camera`.
|
|
38
|
-
- [tests]: Add `vitest/behaviors/clients.test.ts` covering `addChimeClient`/`addWebRtcTransportRequestorClient`, and assert in `doorbell.test.ts`, `camera.test.ts`, and `audioDoorbell.test.ts` that the required client clusters are registered in `MatterbridgeBindingServer`'s `clientList` and `type.clientClusters`.
|
|
39
|
-
|
|
40
|
-
## Changed
|
|
41
|
-
|
|
42
|
-
- [package]: Update dependencies.
|
|
43
|
-
- [package]: Upgrade package.
|
|
44
|
-
- [camera]: Use the shared `addWebRtcTransportRequestorClient` helper from `clients.ts` instead of a local duplicate.
|
|
45
|
-
- [doorbell]: Use the shared `addChimeClient` helper from `clients.ts` instead of inline binding code.
|
|
46
|
-
|
|
47
|
-
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
48
|
-
|
|
49
31
|
## [0.0.4] - 2026-07-19
|
|
50
32
|
|
|
51
33
|
### Added
|
package/README.md
CHANGED
|
@@ -77,18 +77,6 @@ Features:
|
|
|
77
77
|
- Optional Identify cluster support, with configurable identify time and type. Set to Identify.IdentifyType.None to omit the cluster entirely.
|
|
78
78
|
- Configurable Power Source cluster type: Rechargeable, Replaceable, Battery, Wired, or None to omit the Power Source cluster entirely.
|
|
79
79
|
|
|
80
|
-
### Audio Doorbell
|
|
81
|
-
|
|
82
|
-
Features:
|
|
83
|
-
|
|
84
|
-
- Exposes the Switch cluster with the MomentarySwitch feature only, as required by the Matter specification for this device type.
|
|
85
|
-
- Exposes the Camera AV Stream Management cluster with the Audio feature only (the Video and Snapshot features are not present, per the Matter specification for this device type; see Camera for a device implementing those).
|
|
86
|
-
- Exposes the WebRtcTransportProvider cluster and registers a WebRtcTransportRequestor client, so a bound controller can solicit and receive WebRTC offers, same as Camera.
|
|
87
|
-
- Adds the required Chime client cluster automatically via `addChimeClient`, so a bound Chime device can be triggered when the doorbell button is pressed.
|
|
88
|
-
- Identify cluster is always created (it is a required server cluster for this device type), with configurable identify time and type.
|
|
89
|
-
- Configurable Power Source cluster type: Rechargeable, Replaceable, Battery, Wired, or None to omit the Power Source cluster entirely.
|
|
90
|
-
- Deviation from the Matter specification: the CameraAvStreamManagement ImageControl feature is also enabled, even though the specification only allows it when Video or Snapshot is present, to work around a matter.js bug where the ImageRotation/ImageFlipHorizontal/ImageFlipVertical "at least one shall be present" choice conformance is enforced unconditionally instead of only when ImageControl is enabled (see the JSDoc in `src/devices/audioDoorbell.ts`).
|
|
91
|
-
|
|
92
80
|
## WebRTC test video injection
|
|
93
81
|
|
|
94
82
|
`WeriftWebRtcSession` (see `src/webrtc/weriftSession.ts`) wraps a real werift `RTCPeerConnection` for each WebRtcTransportProvider session (see `MatterbridgeWebRtcTransportProviderServer` in `src/behaviors/webRtcTransportProviderServer.ts`), so the session's SDP offer/answer and ICE candidates are handled by a real WebRTC peer connection instead of being just recorded. It can also inject a real ffmpeg-generated video track into the negotiated connection, so the end-to-end media path can be validated without a real camera capture pipeline.
|
|
@@ -102,7 +90,7 @@ The video source defaults to a synthetic SMPTE bars test pattern, or can be swit
|
|
|
102
90
|
|
|
103
91
|
A real client's resolution/quality picker (e.g. in Home Assistant) takes precedence over `MATTERBRIDGE_CAMERA_WEBCAM_RESOLUTION`: it allocates a video stream with `CameraAvStreamManagement.VideoStreamAllocate` before soliciting or providing a WebRTC offer, and `MatterbridgeWebRtcTransportProviderServer` looks up that stream's `maxResolution` to select the webcam capture resolution for the session. `MATTERBRIDGE_CAMERA_WEBCAM_RESOLUTION` is used when no matching allocated stream is found, or when the requested resolution isn't one of the three supported above.
|
|
104
92
|
|
|
105
|
-
Requires `ffmpeg` to be installed
|
|
93
|
+
Requires `ffmpeg` to be installed and reachable on `PATH` (or under `/usr/bin`, `/bin`, or `/usr/local/bin`).
|
|
106
94
|
|
|
107
95
|
Example, capturing from a real Linux webcam at 720p:
|
|
108
96
|
|
|
@@ -157,10 +145,9 @@ The `assets` directory contains deterministic three-second media fixtures for ex
|
|
|
157
145
|
- `test-video.h264`: raw H.264 Constrained Baseline video, 640×360 at 15 FPS, with a moving test pattern. Use this elementary stream when implementing H.264 NAL-unit parsing and RTP packetization.
|
|
158
146
|
- `test-audio.opus`: Ogg container with mono Opus audio at 48 kHz and 64 kbit/s, containing a 1 kHz test tone. Use the Opus packets for an audio RTP track; the Ogg container itself is not sent over WebRTC.
|
|
159
147
|
- `test-camera.mp4`: playable reference containing the same 640×360 H.264 test pattern and a mono 1 kHz AAC track. The werift test transfers the complete file over its SCTP data channel and verifies its integrity. This exercises binary file transport, not a WebRTC video RTP track.
|
|
160
|
-
- `camera-color-1920-1080.jpeg`: 1920×1080
|
|
161
|
-
- `camera-color-1280-720.jpeg`: 1280×720
|
|
162
|
-
- `camera-color-640-480.jpeg`: 640×480
|
|
163
|
-
- `camera-color-test-1920-1080.jpeg`, `camera-color-test-1280-720.jpeg`, `camera-color-test-960-540.jpeg`, `camera-color-test-640-480.jpeg`, and `camera-color-test-480-270.jpeg`: additional SMPTE color-bars snapshot fixtures.
|
|
148
|
+
- `camera-color-test-1920-1080.jpeg`: 1920×1080 broadcast-style snapshot calibration card returned by the example's `CaptureSnapshot` command. It contains color bars, grayscale references, geometry targets, focus patterns, safe-area guides, and near-black/near-white patches for inspecting hue, saturation, brightness, contrast, geometry, overscan, and focus.
|
|
149
|
+
- `camera-color-test-1280-720.jpeg`: 1280×720 SMPTE color-bars test pattern (mire) returned by the example's `CaptureSnapshot` command, generated with `ffmpeg -f lavfi -i smptebars=size=1280x720`.
|
|
150
|
+
- `camera-color-test-640-480.jpeg`: 640×480 SMPTE color-bars test pattern (mire) returned by the example's `CaptureSnapshot` command, generated with `ffmpeg -f lavfi -i smptebars=size=640x480`.
|
|
164
151
|
|
|
165
152
|
WebRTC media tracks transport encoded H.264 or Opus frames in RTP packets; they do not send an MP4, Ogg, or MPEG container directly. The current MP4 transfer deliberately uses the separate data-channel path. A future video-track test should parse the relevant elementary frames, packetize them as RTP, call werift's media track `writeRtp()`, and verify reception through `onTrack` and `onReceiveRtp`.
|
|
166
153
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MatterbridgeServer } from 'matterbridge/behaviors';
|
|
1
|
+
import { MatterbridgeBindingServer, MatterbridgeServer } from 'matterbridge/behaviors';
|
|
2
2
|
import { Node } from 'matterbridge/matter';
|
|
3
3
|
import { WebRtcTransportProviderServer, WebRtcTransportRequestorClient } from 'matterbridge/matter/behaviors';
|
|
4
|
+
import { WebRtcTransportRequestor } from 'matterbridge/matter/clusters';
|
|
4
5
|
import { EndpointNumber, FabricIndex, NodeId, StreamUsage, Status, StatusResponseError } from 'matterbridge/matter/types';
|
|
5
6
|
import { WeriftWebRtcSession } from '../webrtc/weriftSession.js';
|
|
6
7
|
import { MatterbridgeCameraAvStreamManagementServer } from './cameraAvStreamManagementServer.js';
|
|
@@ -259,3 +260,17 @@ export function createDefaultWebRtcTransportProviderClusterServer(endpoint) {
|
|
|
259
260
|
endpoint.behaviors.require(MatterbridgeWebRtcTransportProviderServer, { currentSessions: [] });
|
|
260
261
|
return endpoint;
|
|
261
262
|
}
|
|
263
|
+
export function addWebRtcTransportRequestorClient(endpoint) {
|
|
264
|
+
if (endpoint.behaviors.has(MatterbridgeBindingServer)) {
|
|
265
|
+
const existing = endpoint.behaviors.optionsFor(MatterbridgeBindingServer)?.clientList ?? [];
|
|
266
|
+
if (!existing.includes(WebRtcTransportRequestor.id)) {
|
|
267
|
+
endpoint.behaviors.inject(MatterbridgeBindingServer, { clientList: [...existing, WebRtcTransportRequestor.id] });
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
endpoint.behaviors.require(MatterbridgeBindingServer, { clientList: [WebRtcTransportRequestor.id] });
|
|
272
|
+
}
|
|
273
|
+
const clientClusters = endpoint.type.clientClusters;
|
|
274
|
+
clientClusters.webRtcTransportRequestor ??= WebRtcTransportRequestorClient;
|
|
275
|
+
return endpoint;
|
|
276
|
+
}
|
package/dist/devices/camera.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { camera, MatterbridgeEndpoint, powerSource } from 'matterbridge';
|
|
2
|
-
import {
|
|
2
|
+
import { MatterbridgeBindingServer } from 'matterbridge/behaviors';
|
|
3
|
+
import { WebRtcTransportRequestorClient } from 'matterbridge/matter/behaviors';
|
|
4
|
+
import { CameraAvStreamManagement, Identify, WebRtcTransportRequestor } from 'matterbridge/matter/clusters';
|
|
3
5
|
import { StreamUsage, ThreeLevelAuto } from 'matterbridge/matter/types';
|
|
4
6
|
import { MatterbridgeCameraAvStreamManagementServer } from '../behaviors/cameraAvStreamManagementServer.js';
|
|
5
|
-
import { addWebRtcTransportRequestorClient } from '../behaviors/clients.js';
|
|
6
7
|
import { MatterbridgeWebRtcTransportProviderServer } from '../behaviors/webRtcTransportProviderServer.js';
|
|
7
8
|
export class Camera extends MatterbridgeEndpoint {
|
|
8
9
|
constructor(name, serial, options = {}) {
|
|
@@ -77,3 +78,8 @@ export function createDefaultWebRtcTransportProviderClusterServer(endpoint) {
|
|
|
77
78
|
endpoint.behaviors.require(MatterbridgeWebRtcTransportProviderServer, { currentSessions: [] });
|
|
78
79
|
return endpoint;
|
|
79
80
|
}
|
|
81
|
+
export function addWebRtcTransportRequestorClient(endpoint) {
|
|
82
|
+
endpoint.behaviors.require(MatterbridgeBindingServer, { clientList: [WebRtcTransportRequestor.id] });
|
|
83
|
+
endpoint.type.clientClusters['webRtcTransportRequestor'] ??= WebRtcTransportRequestorClient;
|
|
84
|
+
return endpoint;
|
|
85
|
+
}
|
package/dist/devices/doorbell.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { doorbell, MatterbridgeEndpoint, powerSource } from 'matterbridge';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { MatterbridgeBindingServer } from 'matterbridge/behaviors';
|
|
3
|
+
import { ChimeClient } from 'matterbridge/matter/behaviors';
|
|
4
|
+
import { Chime, Identify } from 'matterbridge/matter/clusters';
|
|
4
5
|
export class Doorbell extends MatterbridgeEndpoint {
|
|
5
6
|
constructor(name, serial, options = {}) {
|
|
6
7
|
const { identifyTime = 0, identifyType = Identify.IdentifyType.None, powerSourceType = 'Wired' } = options;
|
|
@@ -24,7 +25,8 @@ export class Doorbell extends MatterbridgeEndpoint {
|
|
|
24
25
|
break;
|
|
25
26
|
}
|
|
26
27
|
this.createDefaultMomentarySwitchClusterServer();
|
|
27
|
-
|
|
28
|
+
this.behaviors.require(MatterbridgeBindingServer, { clientList: [Chime.id] });
|
|
29
|
+
this.type.clientClusters['chime'] ??= ChimeClient;
|
|
28
30
|
this.addRequiredClusters();
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { createSocket } from 'node:dgram';
|
|
3
3
|
import { constants } from 'node:fs';
|
|
4
|
-
import { access
|
|
5
|
-
import
|
|
6
|
-
import { RTCPeerConnection, RTCRtpCodecParameters, useH264, useOPUS, usePCMU, useVP8 } from 'werift';
|
|
4
|
+
import { access } from 'node:fs/promises';
|
|
5
|
+
import { RTCPeerConnection, RTCRtpCodecParameters } from 'werift';
|
|
7
6
|
import { navigator } from 'werift/nonstandard';
|
|
8
7
|
export class WeriftWebRtcSession {
|
|
9
8
|
peerConnection;
|
|
@@ -13,7 +12,7 @@ export class WeriftWebRtcSession {
|
|
|
13
12
|
testVideoUdpDisposer;
|
|
14
13
|
testVideoAttached = false;
|
|
15
14
|
constructor(logger, label = 'WebRTC session') {
|
|
16
|
-
this.peerConnection = new RTCPeerConnection(
|
|
15
|
+
this.peerConnection = new RTCPeerConnection();
|
|
17
16
|
this.logger = logger;
|
|
18
17
|
this.label = label;
|
|
19
18
|
this.log('debug', 'Created RTCPeerConnection');
|
|
@@ -53,43 +52,8 @@ export class WeriftWebRtcSession {
|
|
|
53
52
|
}
|
|
54
53
|
return false;
|
|
55
54
|
}
|
|
56
|
-
async getWindowsCommandCandidates(command) {
|
|
57
|
-
if (process.platform !== 'win32')
|
|
58
|
-
return [];
|
|
59
|
-
const commandName = command.toLowerCase().replace(/\.exe$/, '');
|
|
60
|
-
const executable = command.toLowerCase().endsWith('.exe') ? command : `${command}.exe`;
|
|
61
|
-
const candidates = [];
|
|
62
|
-
if (commandName === 'ffmpeg' && process.env.LOCALAPPDATA) {
|
|
63
|
-
const wingetPackages = path.join(process.env.LOCALAPPDATA, 'Microsoft', 'WinGet', 'Packages');
|
|
64
|
-
try {
|
|
65
|
-
const packageDirs = await readdir(wingetPackages, { withFileTypes: true });
|
|
66
|
-
for (const packageDir of packageDirs) {
|
|
67
|
-
if (!packageDir.isDirectory() || !packageDir.name.startsWith('Gyan.FFmpeg_'))
|
|
68
|
-
continue;
|
|
69
|
-
const packagePath = path.join(wingetPackages, packageDir.name);
|
|
70
|
-
try {
|
|
71
|
-
const versionDirs = await readdir(packagePath, { withFileTypes: true });
|
|
72
|
-
for (const versionDir of versionDirs) {
|
|
73
|
-
if (versionDir.isDirectory() && versionDir.name.startsWith('ffmpeg-'))
|
|
74
|
-
candidates.push(path.join(packagePath, versionDir.name, 'bin', executable));
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
for (const programFiles of [process.env.ProgramFiles, process.env['ProgramFiles(x86)']]) {
|
|
85
|
-
if (!programFiles)
|
|
86
|
-
continue;
|
|
87
|
-
candidates.push(path.join(programFiles, 'ffmpeg', 'bin', executable), path.join(programFiles, 'Gyan', 'FFmpeg', 'bin', executable));
|
|
88
|
-
}
|
|
89
|
-
return candidates;
|
|
90
|
-
}
|
|
91
55
|
async resolveCommand(command) {
|
|
92
|
-
const candidates = [command, `/usr/bin/${command}`, `/bin/${command}`, `/usr/local/bin/${command}
|
|
56
|
+
const candidates = [command, `/usr/bin/${command}`, `/bin/${command}`, `/usr/local/bin/${command}`];
|
|
93
57
|
for (const candidate of candidates) {
|
|
94
58
|
if (candidate.includes('/')) {
|
|
95
59
|
try {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-camera",
|
|
3
|
-
"version": "0.0.4
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-camera",
|
|
9
|
-
"version": "0.0.4
|
|
9
|
+
"version": "0.0.4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.0",
|
package/package.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MatterbridgeBindingServer } from 'matterbridge/behaviors';
|
|
2
|
-
import { ChimeClient, WebRtcTransportRequestorClient } from 'matterbridge/matter/behaviors';
|
|
3
|
-
import { Chime, WebRtcTransportRequestor } from 'matterbridge/matter/clusters';
|
|
4
|
-
function addBindingClientListEntry(endpoint, clusterId) {
|
|
5
|
-
if (endpoint.behaviors.has(MatterbridgeBindingServer)) {
|
|
6
|
-
const existing = endpoint.behaviors.optionsFor(MatterbridgeBindingServer)?.clientList ?? [];
|
|
7
|
-
if (!existing.includes(clusterId)) {
|
|
8
|
-
endpoint.behaviors.inject(MatterbridgeBindingServer, { clientList: [...existing, clusterId] });
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
endpoint.behaviors.require(MatterbridgeBindingServer, { clientList: [clusterId] });
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function addChimeClient(endpoint) {
|
|
16
|
-
addBindingClientListEntry(endpoint, Chime.id);
|
|
17
|
-
endpoint.type.clientClusters.chime ??= ChimeClient;
|
|
18
|
-
return endpoint;
|
|
19
|
-
}
|
|
20
|
-
export function addWebRtcTransportRequestorClient(endpoint) {
|
|
21
|
-
addBindingClientListEntry(endpoint, WebRtcTransportRequestor.id);
|
|
22
|
-
endpoint.type.clientClusters.webRtcTransportRequestor ??= WebRtcTransportRequestorClient;
|
|
23
|
-
return endpoint;
|
|
24
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { audioDoorbell, MatterbridgeEndpoint, powerSource } from 'matterbridge';
|
|
2
|
-
import { CameraAvStreamManagement, Identify } from 'matterbridge/matter/clusters';
|
|
3
|
-
import { StreamUsage } from 'matterbridge/matter/types';
|
|
4
|
-
import { MatterbridgeCameraAvStreamManagementServer } from '../behaviors/cameraAvStreamManagementServer.js';
|
|
5
|
-
import { addChimeClient, addWebRtcTransportRequestorClient } from '../behaviors/clients.js';
|
|
6
|
-
import { createDefaultWebRtcTransportProviderClusterServer } from '../behaviors/webRtcTransportProviderServer.js';
|
|
7
|
-
export class AudioDoorbell extends MatterbridgeEndpoint {
|
|
8
|
-
constructor(name, serial, options = {}) {
|
|
9
|
-
const { identifyTime = 0, identifyType = Identify.IdentifyType.None, powerSourceType = 'Wired', maxContentBufferSize = 65_536, maxNetworkBandwidth = 128_000, supportedStreamUsages = [StreamUsage.LiveView], streamUsagePriorities = supportedStreamUsages, microphoneCapabilities = { maxNumberOfChannels: 1, supportedCodecs: [CameraAvStreamManagement.AudioCodec.Opus], supportedSampleRates: [48000], supportedBitDepths: [16] }, } = options;
|
|
10
|
-
super(powerSourceType === 'None' ? [audioDoorbell] : [audioDoorbell, powerSource], { id: `${name.replaceAll(' ', '')}-${serial.replaceAll(' ', '')}` });
|
|
11
|
-
this.createDefaultIdentifyClusterServer(identifyTime, identifyType);
|
|
12
|
-
this.createDefaultBasicInformationClusterServer(name, serial, 0xfff1, 'Matterbridge', 0x8000, 'Matterbridge Audio Doorbell');
|
|
13
|
-
switch (powerSourceType) {
|
|
14
|
-
case 'Rechargeable':
|
|
15
|
-
this.createDefaultPowerSourceRechargeableBatteryClusterServer();
|
|
16
|
-
break;
|
|
17
|
-
case 'Replaceable':
|
|
18
|
-
this.createDefaultPowerSourceReplaceableBatteryClusterServer();
|
|
19
|
-
break;
|
|
20
|
-
case 'Battery':
|
|
21
|
-
this.createDefaultPowerSourceBatteryClusterServer();
|
|
22
|
-
break;
|
|
23
|
-
case 'Wired':
|
|
24
|
-
this.createDefaultPowerSourceWiredClusterServer();
|
|
25
|
-
break;
|
|
26
|
-
case 'None':
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
this.createDefaultMomentarySwitchClusterServer();
|
|
30
|
-
createDefaultAudioCameraAvStreamManagementClusterServer(this, {
|
|
31
|
-
maxContentBufferSize,
|
|
32
|
-
maxNetworkBandwidth,
|
|
33
|
-
supportedStreamUsages,
|
|
34
|
-
streamUsagePriorities,
|
|
35
|
-
microphoneCapabilities,
|
|
36
|
-
});
|
|
37
|
-
createDefaultWebRtcTransportProviderClusterServer(this);
|
|
38
|
-
addChimeClient(this);
|
|
39
|
-
addWebRtcTransportRequestorClient(this);
|
|
40
|
-
this.addRequiredClusters();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export function createDefaultAudioCameraAvStreamManagementClusterServer(endpoint, options) {
|
|
44
|
-
endpoint.behaviors.require(MatterbridgeCameraAvStreamManagementServer.with(CameraAvStreamManagement.Feature.Audio, CameraAvStreamManagement.Feature.ImageControl), {
|
|
45
|
-
...options,
|
|
46
|
-
hardPrivacyModeOn: false,
|
|
47
|
-
statusLightEnabled: false,
|
|
48
|
-
allocatedAudioStreams: [],
|
|
49
|
-
microphoneMuted: false,
|
|
50
|
-
microphoneVolumeLevel: 128,
|
|
51
|
-
microphoneMaxLevel: 254,
|
|
52
|
-
microphoneMinLevel: 0,
|
|
53
|
-
microphoneAgcEnabled: false,
|
|
54
|
-
imageRotation: 0,
|
|
55
|
-
imageFlipVertical: false,
|
|
56
|
-
imageFlipHorizontal: false,
|
|
57
|
-
});
|
|
58
|
-
return endpoint;
|
|
59
|
-
}
|