@camera.ui/camera-ui-homekit 0.0.2
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 +8 -0
- package/CONTRIBUTING.md +1 -0
- package/LICENSE.md +22 -0
- package/README.md +1 -0
- package/config.schema.json +15 -0
- package/dist/camera/accessory.d.ts +27 -0
- package/dist/camera/accessory.js +327 -0
- package/dist/camera/accessory.js.map +1 -0
- package/dist/camera/recordingDelegate.d.ts +27 -0
- package/dist/camera/recordingDelegate.js +263 -0
- package/dist/camera/recordingDelegate.js.map +1 -0
- package/dist/camera/services.d.ts +22 -0
- package/dist/camera/services.js +171 -0
- package/dist/camera/services.js.map +1 -0
- package/dist/camera/sessionWrapper.d.ts +25 -0
- package/dist/camera/sessionWrapper.js +287 -0
- package/dist/camera/sessionWrapper.js.map +1 -0
- package/dist/camera/streamingDelegate.d.ts +13 -0
- package/dist/camera/streamingDelegate.js +96 -0
- package/dist/camera/streamingDelegate.js.map +1 -0
- package/dist/camera/streamingServer.d.ts +24 -0
- package/dist/camera/streamingServer.js +143 -0
- package/dist/camera/streamingServer.js.map +1 -0
- package/dist/crypto.d.ts +1 -0
- package/dist/crypto.js +29 -0
- package/dist/crypto.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +10 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/codecs.d.ts +1 -0
- package/dist/utils/codecs.js +2 -0
- package/dist/utils/codecs.js.map +1 -0
- package/dist/utils/ffmpeg.d.ts +11 -0
- package/dist/utils/ffmpeg.js +66 -0
- package/dist/utils/ffmpeg.js.map +1 -0
- package/dist/utils/mac.d.ts +4 -0
- package/dist/utils/mac.js +19 -0
- package/dist/utils/mac.js.map +1 -0
- package/dist/utils/opus-repacketizer.d.ts +7 -0
- package/dist/utils/opus-repacketizer.js +163 -0
- package/dist/utils/opus-repacketizer.js.map +1 -0
- package/media/cameraOffline.png +0 -0
- package/media/maxStreams.png +0 -0
- package/media/noSnapshot.png +0 -0
- package/media/privacyMode.png +0 -0
- package/package.json +62 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
All notable changes to this project will be documented in this file.
|
|
2
|
+
|
|
3
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
|
+
|
|
6
|
+
## [X.X.X] - ???
|
|
7
|
+
|
|
8
|
+
- Initial Release
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Contributing
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-2024 seydx <dev@seydx.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# @camera.ui/camera-ui-homekit
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": {
|
|
3
|
+
"advertiser": {
|
|
4
|
+
"type": "string",
|
|
5
|
+
"key": "advertiser",
|
|
6
|
+
"title": "mDNS Advertiser",
|
|
7
|
+
"description": "The mDNS advertiser to use for HomeKit accessory discovery",
|
|
8
|
+
"defaultValue": "ciao",
|
|
9
|
+
"placeholder": "ciao",
|
|
10
|
+
"enum": ["ciao", "bonjour-hap", "avahi", "resolved"],
|
|
11
|
+
"required": true,
|
|
12
|
+
"store": true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CameraController } from 'hap-nodejs';
|
|
2
|
+
import type { CameraDevice, CameraStorage } from '@camera.ui/types';
|
|
3
|
+
import type HomeKit from '../index.js';
|
|
4
|
+
export declare class CameraAccessory {
|
|
5
|
+
controller?: CameraController;
|
|
6
|
+
cameraStorage: CameraStorage;
|
|
7
|
+
private api;
|
|
8
|
+
private config;
|
|
9
|
+
private logger;
|
|
10
|
+
private cameraDevice;
|
|
11
|
+
private accessory;
|
|
12
|
+
private accessoryPort?;
|
|
13
|
+
private cameraServices;
|
|
14
|
+
private published;
|
|
15
|
+
private republishing;
|
|
16
|
+
private publishedExternalAccessories;
|
|
17
|
+
constructor(platform: HomeKit, cameraDevice: CameraDevice);
|
|
18
|
+
teardown(): Promise<void>;
|
|
19
|
+
private publishAccessory;
|
|
20
|
+
private unpublishAccessory;
|
|
21
|
+
private republishAccessory;
|
|
22
|
+
private setupAccessory;
|
|
23
|
+
private setAccessoryCategory;
|
|
24
|
+
private setAccessoryInformation;
|
|
25
|
+
private createCameraStorage;
|
|
26
|
+
private createControllerOptions;
|
|
27
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { Accessory, CameraController, Characteristic, Service, uuid, } from 'hap-nodejs';
|
|
2
|
+
import { ControllerStorage } from 'hap-nodejs/dist/lib/model/ControllerStorage.js';
|
|
3
|
+
import { baseAudioCodecs } from '../utils/codecs.js';
|
|
4
|
+
import * as mac from '../utils/mac.js';
|
|
5
|
+
import { RecordingDelegate } from './recordingDelegate.js';
|
|
6
|
+
import { CameraServices } from './services.js';
|
|
7
|
+
import { StreamingDelegate } from './streamingDelegate.js';
|
|
8
|
+
export class CameraAccessory {
|
|
9
|
+
controller;
|
|
10
|
+
cameraStorage;
|
|
11
|
+
api;
|
|
12
|
+
config;
|
|
13
|
+
logger;
|
|
14
|
+
cameraDevice;
|
|
15
|
+
accessory;
|
|
16
|
+
accessoryPort;
|
|
17
|
+
cameraServices;
|
|
18
|
+
published = false;
|
|
19
|
+
republishing = false;
|
|
20
|
+
publishedExternalAccessories = new Map();
|
|
21
|
+
constructor(platform, cameraDevice) {
|
|
22
|
+
this.api = platform.api;
|
|
23
|
+
this.config = platform.config;
|
|
24
|
+
this.logger = platform.logger;
|
|
25
|
+
this.cameraDevice = cameraDevice;
|
|
26
|
+
this.cameraStorage = this.createCameraStorage();
|
|
27
|
+
this.setupAccessory();
|
|
28
|
+
this.cameraDevice.onConnected.subscribe(async (connected) => {
|
|
29
|
+
if (connected) {
|
|
30
|
+
await this.publishAccessory();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
await this.unpublishAccessory();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async teardown() {
|
|
38
|
+
if (this.published) {
|
|
39
|
+
if (!this.republishing) {
|
|
40
|
+
this.logger.log('Unpublishing accessory:', this.cameraDevice.name);
|
|
41
|
+
}
|
|
42
|
+
const advertiseAddress = await this.cameraStorage?.getValue('advertiseAddress');
|
|
43
|
+
this.publishedExternalAccessories.delete(advertiseAddress);
|
|
44
|
+
this.accessory.removeAllListeners();
|
|
45
|
+
await this.accessory.unpublish();
|
|
46
|
+
this.published = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async publishAccessory() {
|
|
50
|
+
if (!this.published) {
|
|
51
|
+
try {
|
|
52
|
+
const accessoryPin = await this.cameraStorage.getValue('accessoryPin');
|
|
53
|
+
const advertiseAddress = await this.cameraStorage.getValue('advertiseAddress');
|
|
54
|
+
const accessoryPort = this.cameraStorage.values.accessoryPort;
|
|
55
|
+
if (this.publishedExternalAccessories.has(advertiseAddress)) {
|
|
56
|
+
throw new Error(`Accessory ${this.cameraDevice.name} experienced an address collision.`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.publishedExternalAccessories.set(advertiseAddress, this.accessory);
|
|
60
|
+
}
|
|
61
|
+
this.accessory.on("listening" /* AccessoryEventTypes.LISTENING */, (port) => {
|
|
62
|
+
this.accessoryPort = port;
|
|
63
|
+
this.logger.debug(`${this.cameraDevice.name} is running on port ${port}`);
|
|
64
|
+
if (!this.republishing) {
|
|
65
|
+
this.logger.log(`Please add [${this.cameraDevice.name}] manually in Home app. Setup Code: ${accessoryPin}`);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const publishInfo = {
|
|
69
|
+
username: advertiseAddress,
|
|
70
|
+
pincode: accessoryPin,
|
|
71
|
+
category: this.accessory.category,
|
|
72
|
+
port: accessoryPort,
|
|
73
|
+
bind: undefined,
|
|
74
|
+
addIdentifyingMaterial: false,
|
|
75
|
+
advertiser: this.config.advertiser,
|
|
76
|
+
};
|
|
77
|
+
if (!this.republishing) {
|
|
78
|
+
this.logger.log('Publishing accessory:', this.cameraDevice.name);
|
|
79
|
+
}
|
|
80
|
+
await this.accessory.publish(publishInfo);
|
|
81
|
+
this.published = true;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
this.logger.error('Error publishing accessory', error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async unpublishAccessory() {
|
|
89
|
+
this.accessory.controllerStorage = new ControllerStorage(this.accessory);
|
|
90
|
+
await this.teardown();
|
|
91
|
+
}
|
|
92
|
+
async republishAccessory() {
|
|
93
|
+
this.republishing = true;
|
|
94
|
+
this.logger.log('Republishing accessory:', this.cameraDevice.name);
|
|
95
|
+
await this.unpublishAccessory();
|
|
96
|
+
await this.publishAccessory();
|
|
97
|
+
setTimeout(() => {
|
|
98
|
+
this.republishing = false;
|
|
99
|
+
}, 100);
|
|
100
|
+
}
|
|
101
|
+
setupAccessory() {
|
|
102
|
+
this.logger.log('Configuring accessory:', this.cameraDevice.name);
|
|
103
|
+
this.accessory = new Accessory(this.cameraDevice.name, uuid.generate(this.cameraDevice.id));
|
|
104
|
+
this.accessory.on("identify" /* AccessoryEventTypes.IDENTIFY */, () => this.logger.debug(this.cameraDevice.name, 'identified!'));
|
|
105
|
+
this.setAccessoryCategory();
|
|
106
|
+
this.setAccessoryInformation();
|
|
107
|
+
this.cameraServices = new CameraServices(this.accessory, this.cameraDevice, this.logger);
|
|
108
|
+
this.controller = new CameraController(this.createControllerOptions());
|
|
109
|
+
this.accessory.configureController(this.controller);
|
|
110
|
+
}
|
|
111
|
+
setAccessoryCategory() {
|
|
112
|
+
this.cameraDevice.onPropertyChange('type').subscribe(({ newData }) => {
|
|
113
|
+
this.logger.debug(this.cameraDevice.name, 'Changing accessory category to', newData);
|
|
114
|
+
this.accessory.category = newData === 'doorbell' ? 18 /* Categories.VIDEO_DOORBELL */ : 17 /* Categories.IP_CAMERA */;
|
|
115
|
+
});
|
|
116
|
+
this.accessory.category = this.cameraDevice.type === 'doorbell' ? 18 /* Categories.VIDEO_DOORBELL */ : 17 /* Categories.IP_CAMERA */;
|
|
117
|
+
}
|
|
118
|
+
setAccessoryInformation() {
|
|
119
|
+
this.cameraDevice.onPropertyChange('name').subscribe(({ newData }) => {
|
|
120
|
+
this.logger.debug(this.cameraDevice.name, 'Changing accessory name', newData);
|
|
121
|
+
// this.cameraDevice.name = newData;
|
|
122
|
+
accessoryInformation?.setCharacteristic(Characteristic.Name, this.cameraDevice.name);
|
|
123
|
+
accessoryInformation?.setCharacteristic(Characteristic.ConfiguredName, this.cameraDevice.name);
|
|
124
|
+
});
|
|
125
|
+
this.cameraDevice.onPropertyChange('info').subscribe(({ newData }) => {
|
|
126
|
+
this.logger.debug(this.cameraDevice.name, 'Changing accessory information', newData);
|
|
127
|
+
if (newData.manufacturer)
|
|
128
|
+
accessoryInformation?.setCharacteristic(Characteristic.Manufacturer, newData.manufacturer);
|
|
129
|
+
if (newData.model)
|
|
130
|
+
accessoryInformation?.setCharacteristic(Characteristic.Model, newData.model);
|
|
131
|
+
if (newData.serialNumber)
|
|
132
|
+
accessoryInformation?.setCharacteristic(Characteristic.SerialNumber, newData.serialNumber);
|
|
133
|
+
if (newData.firmwareVersion)
|
|
134
|
+
accessoryInformation?.setCharacteristic(Characteristic.FirmwareRevision, newData.firmwareVersion);
|
|
135
|
+
});
|
|
136
|
+
const accessoryInformation = this.accessory.getService(Service.AccessoryInformation);
|
|
137
|
+
accessoryInformation?.setCharacteristic(Characteristic.Name, this.cameraDevice.name);
|
|
138
|
+
accessoryInformation?.setCharacteristic(Characteristic.ConfiguredName, this.cameraDevice.name);
|
|
139
|
+
accessoryInformation?.setCharacteristic(Characteristic.Manufacturer, 'camera.ui');
|
|
140
|
+
accessoryInformation?.setCharacteristic(Characteristic.Identify, true);
|
|
141
|
+
if (this.cameraDevice.info.manufacturer)
|
|
142
|
+
accessoryInformation?.setCharacteristic(Characteristic.Manufacturer, this.cameraDevice.info.manufacturer);
|
|
143
|
+
if (this.cameraDevice.info.model)
|
|
144
|
+
accessoryInformation?.setCharacteristic(Characteristic.Model, this.cameraDevice.info.model);
|
|
145
|
+
if (this.cameraDevice.info.serialNumber)
|
|
146
|
+
accessoryInformation?.setCharacteristic(Characteristic.SerialNumber, this.cameraDevice.info.serialNumber);
|
|
147
|
+
if (this.cameraDevice.info.firmwareVersion)
|
|
148
|
+
accessoryInformation?.setCharacteristic(Characteristic.FirmwareRevision, this.cameraDevice.info.firmwareVersion);
|
|
149
|
+
}
|
|
150
|
+
createCameraStorage() {
|
|
151
|
+
return this.api.storageController.createCameraStorage(this, this.cameraDevice.id, {
|
|
152
|
+
qrCode: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
key: 'qrCode',
|
|
155
|
+
title: 'QR Code',
|
|
156
|
+
description: 'The QR code to use for pairing the HomeKit camera',
|
|
157
|
+
format: 'qrCode',
|
|
158
|
+
group: 'Pairing',
|
|
159
|
+
onGet: async () => {
|
|
160
|
+
return this.published ? this.accessory.setupURI() : '';
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
accessoryPin: {
|
|
164
|
+
type: 'string',
|
|
165
|
+
key: 'pincode',
|
|
166
|
+
title: 'Pincode',
|
|
167
|
+
description: 'The pincode to use for pairing the HomeKit camera',
|
|
168
|
+
group: 'Pairing',
|
|
169
|
+
defaultValue: mac.randomPinCode(),
|
|
170
|
+
store: true,
|
|
171
|
+
readonly: true,
|
|
172
|
+
},
|
|
173
|
+
accessoryPort: {
|
|
174
|
+
type: 'number',
|
|
175
|
+
key: 'accessoryPort',
|
|
176
|
+
title: 'Port',
|
|
177
|
+
description: 'The port to use for publishing the HomeKit camera',
|
|
178
|
+
group: 'Pairing',
|
|
179
|
+
defaultValue: 0,
|
|
180
|
+
store: true,
|
|
181
|
+
onGet: async () => {
|
|
182
|
+
return this.accessoryPort;
|
|
183
|
+
},
|
|
184
|
+
onSet: async () => {
|
|
185
|
+
await this.republishAccessory();
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
advertiseAddress: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
key: 'advertiseAddress',
|
|
191
|
+
title: 'Username',
|
|
192
|
+
description: 'The username to use for pairing the HomeKit camera',
|
|
193
|
+
group: 'Pairing',
|
|
194
|
+
store: true,
|
|
195
|
+
readonly: true,
|
|
196
|
+
hidden: true,
|
|
197
|
+
onGet: async () => {
|
|
198
|
+
return mac.generate(this.accessory.UUID);
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
twoWayAudio: {
|
|
202
|
+
type: 'boolean',
|
|
203
|
+
key: 'twoWayAudio',
|
|
204
|
+
title: 'Two-way Audio',
|
|
205
|
+
description: 'Enable two-way audio',
|
|
206
|
+
group: 'Streaming',
|
|
207
|
+
defaultValue: true,
|
|
208
|
+
store: true,
|
|
209
|
+
onSet: async () => {
|
|
210
|
+
if (this.controller) {
|
|
211
|
+
this.accessory.removeController(this.controller);
|
|
212
|
+
this.controller = undefined;
|
|
213
|
+
}
|
|
214
|
+
const constrollerOptions = this.createControllerOptions();
|
|
215
|
+
this.controller = new CameraController(constrollerOptions);
|
|
216
|
+
this.accessory.configureController(this.controller);
|
|
217
|
+
await this.republishAccessory();
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
returnAudioCodec: {
|
|
221
|
+
type: 'string',
|
|
222
|
+
key: 'returnAudioCodec',
|
|
223
|
+
title: 'Return Audio Codec',
|
|
224
|
+
description: 'The audio codec to use for returning audio',
|
|
225
|
+
group: 'Streaming',
|
|
226
|
+
enum: baseAudioCodecs,
|
|
227
|
+
required: false,
|
|
228
|
+
store: true,
|
|
229
|
+
},
|
|
230
|
+
transcodeRecording: {
|
|
231
|
+
type: 'boolean',
|
|
232
|
+
key: 'transcodeRecording',
|
|
233
|
+
title: 'Transcode Recording',
|
|
234
|
+
description: 'Transcode the recording',
|
|
235
|
+
group: 'HKSV',
|
|
236
|
+
defaultValue: false,
|
|
237
|
+
store: true,
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
createControllerOptions() {
|
|
242
|
+
const audioStreamingCodecs = [];
|
|
243
|
+
const audioRecordingCodecs = [];
|
|
244
|
+
const enabledStreamingCodecTypes = ["OPUS" /* AudioStreamingCodecType.OPUS */];
|
|
245
|
+
const enabledRecordingCodecTypes = [0 /* AudioRecordingCodecType.AAC_LC */];
|
|
246
|
+
for (const type of enabledStreamingCodecTypes) {
|
|
247
|
+
for (const samplerate of [8 /* AudioStreamingSamplerate.KHZ_8 */, 16 /* AudioStreamingSamplerate.KHZ_16 */, 24 /* AudioStreamingSamplerate.KHZ_24 */]) {
|
|
248
|
+
audioStreamingCodecs.push({
|
|
249
|
+
type,
|
|
250
|
+
samplerate,
|
|
251
|
+
bitrate: 0,
|
|
252
|
+
audioChannels: 1,
|
|
253
|
+
});
|
|
254
|
+
audioStreamingCodecs.push({
|
|
255
|
+
type,
|
|
256
|
+
samplerate,
|
|
257
|
+
bitrate: 1,
|
|
258
|
+
audioChannels: 1,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
for (const type of enabledRecordingCodecTypes) {
|
|
263
|
+
audioRecordingCodecs.push({
|
|
264
|
+
type,
|
|
265
|
+
bitrateMode: 0,
|
|
266
|
+
samplerate: [3 /* AudioRecordingSamplerate.KHZ_32 */],
|
|
267
|
+
audioChannels: 1,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
const options = {
|
|
271
|
+
cameraStreamCount: 10,
|
|
272
|
+
delegate: new StreamingDelegate(this, this.cameraDevice, this.logger),
|
|
273
|
+
streamingOptions: {
|
|
274
|
+
supportedCryptoSuites: [0 /* SRTPCryptoSuites.AES_CM_128_HMAC_SHA1_80 */, 2 /* SRTPCryptoSuites.NONE */],
|
|
275
|
+
video: {
|
|
276
|
+
codec: {
|
|
277
|
+
// profiles: [H264Profile.BASELINE, H264Profile.MAIN, H264Profile.HIGH],
|
|
278
|
+
profiles: [1 /* H264Profile.MAIN */],
|
|
279
|
+
levels: [0 /* H264Level.LEVEL3_1 */, 1 /* H264Level.LEVEL3_2 */, 2 /* H264Level.LEVEL4_0 */],
|
|
280
|
+
},
|
|
281
|
+
resolutions: [
|
|
282
|
+
[3840, 2160, 30],
|
|
283
|
+
[2880, 1620, 30],
|
|
284
|
+
[2560, 1440, 30],
|
|
285
|
+
[1920, 1080, 30],
|
|
286
|
+
[1280, 720, 30],
|
|
287
|
+
[960, 540, 30],
|
|
288
|
+
[640, 360, 30],
|
|
289
|
+
[320, 240, 15],
|
|
290
|
+
],
|
|
291
|
+
},
|
|
292
|
+
audio: {
|
|
293
|
+
codecs: audioStreamingCodecs,
|
|
294
|
+
twoWayAudio: this.cameraStorage.values.twoWayAudio,
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
recording: {
|
|
298
|
+
options: {
|
|
299
|
+
prebufferLength: 8000,
|
|
300
|
+
mediaContainerConfiguration: [
|
|
301
|
+
{
|
|
302
|
+
type: 0 /* MediaContainerType.FRAGMENTED_MP4 */,
|
|
303
|
+
fragmentLength: 4000,
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
video: {
|
|
307
|
+
type: 0 /* VideoCodecType.H264 */,
|
|
308
|
+
parameters: {
|
|
309
|
+
levels: [0 /* H264Level.LEVEL3_1 */, 1 /* H264Level.LEVEL3_2 */, 2 /* H264Level.LEVEL4_0 */],
|
|
310
|
+
profiles: [0 /* H264Profile.BASELINE */, 1 /* H264Profile.MAIN */, 2 /* H264Profile.HIGH */],
|
|
311
|
+
},
|
|
312
|
+
resolutions: [
|
|
313
|
+
[1280, 720, 30],
|
|
314
|
+
[1920, 1080, 30],
|
|
315
|
+
],
|
|
316
|
+
},
|
|
317
|
+
audio: {
|
|
318
|
+
codecs: audioRecordingCodecs,
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
delegate: new RecordingDelegate(this, this.accessory, this.cameraDevice, this.logger),
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
return options;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=accessory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessory.js","sourceRoot":"","sources":["../../src/camera/accessory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E;4BACV,MAAM,EAAE,oFAA4D;4BACpE,QAAQ,EAAE,kFAA0D;yBACrE;wBACD,WAAW,EAAE;4BACX,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;4BACf,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC;yBACjB;qBACF;oBACD,KAAK,EAAE;wBACL,MAAM,EAAE,oBAAoB;qBAC7B;iBACF;gBACD,QAAQ,EAAE,IAAI,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC;aACtF;SACF,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HDSProtocolSpecificErrorReason } from 'hap-nodejs';
|
|
2
|
+
import type { CameraDevice, PluginLogger } from '@camera.ui/types';
|
|
3
|
+
import type { Accessory, CameraRecordingConfiguration, CameraRecordingDelegate, RecordingPacket } from 'hap-nodejs';
|
|
4
|
+
import type { CameraAccessory } from './accessory.js';
|
|
5
|
+
export declare class RecordingDelegate implements CameraRecordingDelegate {
|
|
6
|
+
private cameraAccessory;
|
|
7
|
+
private accessory;
|
|
8
|
+
private cameraDevice;
|
|
9
|
+
private logger;
|
|
10
|
+
private isRecording;
|
|
11
|
+
private handlingRecordingRequest;
|
|
12
|
+
private maxVideoDuration;
|
|
13
|
+
private recordingTimeout?;
|
|
14
|
+
private server?;
|
|
15
|
+
private configuration?;
|
|
16
|
+
constructor(cameraAccessory: CameraAccessory, accessory: Accessory, cameraDevice: CameraDevice, logger: PluginLogger);
|
|
17
|
+
updateRecordingActive(active: boolean): Promise<void>;
|
|
18
|
+
updateRecordingConfiguration(configuration?: CameraRecordingConfiguration): void;
|
|
19
|
+
handleRecordingStreamRequest(streamId: number): AsyncGenerator<RecordingPacket, any, unknown>;
|
|
20
|
+
closeRecordingStream(streamId: number, reason?: HDSProtocolSpecificErrorReason): Promise<void>;
|
|
21
|
+
acknowledgeStream(streamId: number): Promise<void>;
|
|
22
|
+
private cleanupRecording;
|
|
23
|
+
private getSampleRate;
|
|
24
|
+
private getProfile;
|
|
25
|
+
private getLevel;
|
|
26
|
+
private getHdsReason;
|
|
27
|
+
}
|