hap-nodejs 0.11.0-beta.9 → 0.11.1-beta.0

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.
Files changed (214) hide show
  1. package/README.md +2 -1
  2. package/dist/BridgedCore.js +4 -4
  3. package/dist/BridgedCore.js.map +1 -1
  4. package/dist/Core.js +2 -2
  5. package/dist/Core.js.map +1 -1
  6. package/dist/accessories/AirConditioner_accessory.js +18 -18
  7. package/dist/accessories/AirConditioner_accessory.js.map +1 -1
  8. package/dist/accessories/AppleTVRemote_accessory.js +6 -6
  9. package/dist/accessories/AppleTVRemote_accessory.js.map +1 -1
  10. package/dist/accessories/Camera_accessory.js +96 -87
  11. package/dist/accessories/Camera_accessory.js.map +1 -1
  12. package/dist/accessories/Fan_accessory.js +6 -6
  13. package/dist/accessories/Fan_accessory.js.map +1 -1
  14. package/dist/accessories/GarageDoorOpener_accessory.js +4 -4
  15. package/dist/accessories/GarageDoorOpener_accessory.js.map +1 -1
  16. package/dist/accessories/Light-AdaptiveLighting_accessory.js +2 -2
  17. package/dist/accessories/Light-AdaptiveLighting_accessory.js.map +1 -1
  18. package/dist/accessories/Light_accessory.js +11 -11
  19. package/dist/accessories/Light_accessory.js.map +1 -1
  20. package/dist/accessories/Lock_accessory.js +4 -4
  21. package/dist/accessories/Lock_accessory.js.map +1 -1
  22. package/dist/accessories/MotionSensor_accessory.js +3 -3
  23. package/dist/accessories/MotionSensor_accessory.js.map +1 -1
  24. package/dist/accessories/Outlet_accessory.js +4 -4
  25. package/dist/accessories/Outlet_accessory.js.map +1 -1
  26. package/dist/accessories/SmartSpeaker_accessory.js +5 -5
  27. package/dist/accessories/SmartSpeaker_accessory.js.map +1 -1
  28. package/dist/accessories/Sprinkler_accessory.js +7 -7
  29. package/dist/accessories/Sprinkler_accessory.js.map +1 -1
  30. package/dist/accessories/TV_accessory.js +9 -9
  31. package/dist/accessories/TV_accessory.js.map +1 -1
  32. package/dist/accessories/TemperatureSensor_accessory.js +2 -2
  33. package/dist/accessories/TemperatureSensor_accessory.js.map +1 -1
  34. package/dist/accessories/Wi-FiRouter_accessory.js +2 -2
  35. package/dist/accessories/Wi-FiRouter_accessory.js.map +1 -1
  36. package/dist/accessories/Wi-FiSatellite_accessory.js +2 -2
  37. package/dist/accessories/Wi-FiSatellite_accessory.js.map +1 -1
  38. package/dist/accessories/gstreamer-audioProducer.d.ts +2 -2
  39. package/dist/accessories/gstreamer-audioProducer.d.ts.map +1 -1
  40. package/dist/accessories/gstreamer-audioProducer.js +20 -20
  41. package/dist/accessories/gstreamer-audioProducer.js.map +1 -1
  42. package/dist/index.d.ts +30 -6
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +39 -25
  45. package/dist/index.js.map +1 -1
  46. package/dist/internal-types.d.ts +65 -126
  47. package/dist/internal-types.d.ts.map +1 -1
  48. package/dist/internal-types.js +66 -5
  49. package/dist/internal-types.js.map +1 -1
  50. package/dist/lib/Accessory.d.ts +97 -21
  51. package/dist/lib/Accessory.d.ts.map +1 -1
  52. package/dist/lib/Accessory.js +315 -327
  53. package/dist/lib/Accessory.js.map +1 -1
  54. package/dist/lib/AccessoryLoader.d.ts +12 -0
  55. package/dist/lib/AccessoryLoader.d.ts.map +1 -1
  56. package/dist/lib/AccessoryLoader.js +18 -6
  57. package/dist/lib/AccessoryLoader.js.map +1 -1
  58. package/dist/lib/Advertiser.d.ts +32 -0
  59. package/dist/lib/Advertiser.d.ts.map +1 -1
  60. package/dist/lib/Advertiser.js +136 -58
  61. package/dist/lib/Advertiser.js.map +1 -1
  62. package/dist/lib/Bridge.d.ts +2 -0
  63. package/dist/lib/Bridge.d.ts.map +1 -1
  64. package/dist/lib/Bridge.js +3 -1
  65. package/dist/lib/Bridge.js.map +1 -1
  66. package/dist/lib/Characteristic.d.ts +872 -40
  67. package/dist/lib/Characteristic.d.ts.map +1 -1
  68. package/dist/lib/Characteristic.js +172 -141
  69. package/dist/lib/Characteristic.js.map +1 -1
  70. package/dist/lib/HAPServer.d.ts +113 -20
  71. package/dist/lib/HAPServer.d.ts.map +1 -1
  72. package/dist/lib/HAPServer.js +226 -231
  73. package/dist/lib/HAPServer.js.map +1 -1
  74. package/dist/lib/Service.d.ts +329 -13
  75. package/dist/lib/Service.d.ts.map +1 -1
  76. package/dist/lib/Service.js +45 -40
  77. package/dist/lib/Service.js.map +1 -1
  78. package/dist/lib/camera/Camera.d.ts +13 -4
  79. package/dist/lib/camera/Camera.d.ts.map +1 -1
  80. package/dist/lib/camera/Camera.js +3 -0
  81. package/dist/lib/camera/Camera.js.map +1 -1
  82. package/dist/lib/camera/RTPProxy.d.ts +5 -0
  83. package/dist/lib/camera/RTPProxy.d.ts.map +1 -1
  84. package/dist/lib/camera/RTPProxy.js +2 -1
  85. package/dist/lib/camera/RTPProxy.js.map +1 -1
  86. package/dist/lib/camera/RTPStreamManagement.d.ts +156 -33
  87. package/dist/lib/camera/RTPStreamManagement.d.ts.map +1 -1
  88. package/dist/lib/camera/RTPStreamManagement.js +204 -164
  89. package/dist/lib/camera/RTPStreamManagement.js.map +1 -1
  90. package/dist/lib/camera/RecordingManagement.d.ts +61 -11
  91. package/dist/lib/camera/RecordingManagement.d.ts.map +1 -1
  92. package/dist/lib/camera/RecordingManagement.js +171 -138
  93. package/dist/lib/camera/RecordingManagement.js.map +1 -1
  94. package/dist/lib/camera/index.js +4 -4
  95. package/dist/lib/camera/index.js.map +1 -1
  96. package/dist/lib/controller/AdaptiveLightingController.d.ts +28 -2
  97. package/dist/lib/controller/AdaptiveLightingController.d.ts.map +1 -1
  98. package/dist/lib/controller/AdaptiveLightingController.js +77 -68
  99. package/dist/lib/controller/AdaptiveLightingController.js.map +1 -1
  100. package/dist/lib/controller/CameraController.d.ts +44 -13
  101. package/dist/lib/controller/CameraController.d.ts.map +1 -1
  102. package/dist/lib/controller/CameraController.js +43 -34
  103. package/dist/lib/controller/CameraController.js.map +1 -1
  104. package/dist/lib/controller/Controller.d.ts +28 -7
  105. package/dist/lib/controller/Controller.d.ts.map +1 -1
  106. package/dist/lib/controller/Controller.js +7 -0
  107. package/dist/lib/controller/Controller.js.map +1 -1
  108. package/dist/lib/controller/DoorbellController.d.ts +5 -1
  109. package/dist/lib/controller/DoorbellController.d.ts.map +1 -1
  110. package/dist/lib/controller/DoorbellController.js +5 -3
  111. package/dist/lib/controller/DoorbellController.js.map +1 -1
  112. package/dist/lib/controller/RemoteController.d.ts +108 -39
  113. package/dist/lib/controller/RemoteController.d.ts.map +1 -1
  114. package/dist/lib/controller/RemoteController.js +190 -175
  115. package/dist/lib/controller/RemoteController.js.map +1 -1
  116. package/dist/lib/controller/index.js +5 -5
  117. package/dist/lib/controller/index.js.map +1 -1
  118. package/dist/lib/datastream/DataStreamManagement.d.ts +25 -19
  119. package/dist/lib/datastream/DataStreamManagement.d.ts.map +1 -1
  120. package/dist/lib/datastream/DataStreamManagement.js +36 -30
  121. package/dist/lib/datastream/DataStreamManagement.js.map +1 -1
  122. package/dist/lib/datastream/DataStreamParser.d.ts +39 -0
  123. package/dist/lib/datastream/DataStreamParser.d.ts.map +1 -1
  124. package/dist/lib/datastream/DataStreamParser.js +125 -88
  125. package/dist/lib/datastream/DataStreamParser.js.map +1 -1
  126. package/dist/lib/datastream/DataStreamServer.d.ts +121 -46
  127. package/dist/lib/datastream/DataStreamServer.d.ts.map +1 -1
  128. package/dist/lib/datastream/DataStreamServer.js +134 -100
  129. package/dist/lib/datastream/DataStreamServer.js.map +1 -1
  130. package/dist/lib/datastream/index.js +3 -3
  131. package/dist/lib/datastream/index.js.map +1 -1
  132. package/dist/lib/definitions/CharacteristicDefinitions.js +799 -799
  133. package/dist/lib/definitions/CharacteristicDefinitions.js.map +1 -1
  134. package/dist/lib/definitions/ServiceDefinitions.js +77 -77
  135. package/dist/lib/definitions/ServiceDefinitions.js.map +1 -1
  136. package/dist/lib/definitions/generate-definitions.js +60 -59
  137. package/dist/lib/definitions/generate-definitions.js.map +1 -1
  138. package/dist/lib/definitions/generator-configuration.js +15 -15
  139. package/dist/lib/definitions/generator-configuration.js.map +1 -1
  140. package/dist/lib/definitions/index.js +2 -2
  141. package/dist/lib/definitions/index.js.map +1 -1
  142. package/dist/lib/model/AccessoryInfo.d.ts +10 -4
  143. package/dist/lib/model/AccessoryInfo.d.ts.map +1 -1
  144. package/dist/lib/model/AccessoryInfo.js +21 -17
  145. package/dist/lib/model/AccessoryInfo.js.map +1 -1
  146. package/dist/lib/model/ControllerStorage.d.ts +3 -0
  147. package/dist/lib/model/ControllerStorage.d.ts.map +1 -1
  148. package/dist/lib/model/ControllerStorage.js +8 -5
  149. package/dist/lib/model/ControllerStorage.js.map +1 -1
  150. package/dist/lib/model/HAPStorage.d.ts +3 -0
  151. package/dist/lib/model/HAPStorage.d.ts.map +1 -1
  152. package/dist/lib/model/HAPStorage.js +4 -1
  153. package/dist/lib/model/HAPStorage.js.map +1 -1
  154. package/dist/lib/model/IdentifierCache.d.ts +1 -0
  155. package/dist/lib/model/IdentifierCache.d.ts.map +1 -1
  156. package/dist/lib/model/IdentifierCache.js +3 -2
  157. package/dist/lib/model/IdentifierCache.js.map +1 -1
  158. package/dist/lib/tv/AccessControlManagement.d.ts +11 -0
  159. package/dist/lib/tv/AccessControlManagement.d.ts.map +1 -1
  160. package/dist/lib/tv/AccessControlManagement.js +15 -7
  161. package/dist/lib/tv/AccessControlManagement.js.map +1 -1
  162. package/dist/lib/util/clone.d.ts +2 -1
  163. package/dist/lib/util/clone.d.ts.map +1 -1
  164. package/dist/lib/util/clone.js +5 -4
  165. package/dist/lib/util/clone.js.map +1 -1
  166. package/dist/lib/util/color-utils.d.ts +4 -1
  167. package/dist/lib/util/color-utils.d.ts.map +1 -1
  168. package/dist/lib/util/color-utils.js +5 -2
  169. package/dist/lib/util/color-utils.js.map +1 -1
  170. package/dist/lib/util/eventedhttp.d.ts +52 -9
  171. package/dist/lib/util/eventedhttp.d.ts.map +1 -1
  172. package/dist/lib/util/eventedhttp.js +141 -135
  173. package/dist/lib/util/eventedhttp.js.map +1 -1
  174. package/dist/lib/util/hapCrypto.d.ts +30 -2
  175. package/dist/lib/util/hapCrypto.d.ts.map +1 -1
  176. package/dist/lib/util/hapCrypto.js +28 -4
  177. package/dist/lib/util/hapCrypto.js.map +1 -1
  178. package/dist/lib/util/hapStatusError.d.ts +2 -0
  179. package/dist/lib/util/hapStatusError.d.ts.map +1 -1
  180. package/dist/lib/util/hapStatusError.js +4 -2
  181. package/dist/lib/util/hapStatusError.js.map +1 -1
  182. package/dist/lib/util/net-utils.d.ts +7 -0
  183. package/dist/lib/util/net-utils.d.ts.map +1 -1
  184. package/dist/lib/util/net-utils.js +11 -4
  185. package/dist/lib/util/net-utils.js.map +1 -1
  186. package/dist/lib/util/once.d.ts +5 -0
  187. package/dist/lib/util/once.d.ts.map +1 -1
  188. package/dist/lib/util/once.js +6 -1
  189. package/dist/lib/util/once.js.map +1 -1
  190. package/dist/lib/util/promise-utils.d.ts +13 -0
  191. package/dist/lib/util/promise-utils.d.ts.map +1 -1
  192. package/dist/lib/util/promise-utils.js +27 -1
  193. package/dist/lib/util/promise-utils.js.map +1 -1
  194. package/dist/lib/util/request-util.d.ts +16 -0
  195. package/dist/lib/util/request-util.d.ts.map +1 -1
  196. package/dist/lib/util/request-util.js +42 -27
  197. package/dist/lib/util/request-util.js.map +1 -1
  198. package/dist/lib/util/time.d.ts +6 -0
  199. package/dist/lib/util/time.d.ts.map +1 -1
  200. package/dist/lib/util/time.js +8 -2
  201. package/dist/lib/util/time.js.map +1 -1
  202. package/dist/lib/util/tlv.d.ts +95 -5
  203. package/dist/lib/util/tlv.d.ts.map +1 -1
  204. package/dist/lib/util/tlv.js +90 -21
  205. package/dist/lib/util/tlv.js.map +1 -1
  206. package/dist/lib/util/uuid.d.ts +2 -3
  207. package/dist/lib/util/uuid.d.ts.map +1 -1
  208. package/dist/lib/util/uuid.js +1 -1
  209. package/dist/lib/util/uuid.js.map +1 -1
  210. package/dist/types.d.ts +267 -19
  211. package/dist/types.d.ts.map +1 -1
  212. package/dist/types.js +8 -0
  213. package/dist/types.js.map +1 -1
  214. package/package.json +10 -7
@@ -1,18 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamController = exports.RTPStreamManagement = exports.StreamRequestTypes = exports.AudioStreamingSamplerate = exports.AudioStreamingCodecType = exports.SRTPCryptoSuites = exports.H264Level = exports.H264Profile = exports.VideoCodecType = void 0;
3
+ exports.StreamController = exports.RTPStreamManagement = exports.StreamRequestTypes = exports.AudioStreamingSamplerate = exports.AudioStreamingCodecType = exports.SRTPCryptoSuites = exports.AudioSamplerate = exports.AudioBitrate = exports.VideoCodecPacketizationMode = exports.H264Level = exports.H264Profile = exports.VideoCodecType = void 0;
4
4
  var tslib_1 = require("tslib");
5
- var assert_1 = (0, tslib_1.__importDefault)(require("assert"));
6
- var crypto_1 = (0, tslib_1.__importDefault)(require("crypto"));
7
- var debug_1 = (0, tslib_1.__importDefault)(require("debug"));
8
- var net_1 = (0, tslib_1.__importDefault)(require("net"));
9
- // noinspection JSDeprecatedSymbols
10
- var index_1 = require("../../index");
5
+ var assert_1 = tslib_1.__importDefault(require("assert"));
6
+ var crypto_1 = tslib_1.__importDefault(require("crypto"));
7
+ var debug_1 = tslib_1.__importDefault(require("debug"));
8
+ var net_1 = tslib_1.__importDefault(require("net"));
11
9
  var Characteristic_1 = require("../Characteristic");
12
10
  var controller_1 = require("../controller");
13
11
  var Service_1 = require("../Service");
14
- var tlv = (0, tslib_1.__importStar)(require("../util/tlv"));
15
- var RTPProxy_1 = (0, tslib_1.__importDefault)(require("./RTPProxy"));
12
+ var hapStatusError_1 = require("../util/hapStatusError");
13
+ var once_1 = require("../util/once");
14
+ var tlv = tslib_1.__importStar(require("../util/tlv"));
15
+ var uuid = tslib_1.__importStar(require("../util/uuid"));
16
+ // noinspection JSDeprecatedSymbols
17
+ var Camera_1 = require("./Camera");
18
+ var RTPProxy_1 = tslib_1.__importDefault(require("./RTPProxy"));
16
19
  var debug = (0, debug_1.default)("HAP-NodeJS:Camera:RTPStreamManagement");
17
20
  // ---------------------------------- TLV DEFINITIONS START ----------------------------------
18
21
  var StreamingStatusTypes;
@@ -50,28 +53,40 @@ var VideoAttributesTypes;
50
53
  VideoAttributesTypes[VideoAttributesTypes["IMAGE_HEIGHT"] = 2] = "IMAGE_HEIGHT";
51
54
  VideoAttributesTypes[VideoAttributesTypes["FRAME_RATE"] = 3] = "FRAME_RATE";
52
55
  })(VideoAttributesTypes || (VideoAttributesTypes = {}));
56
+ /**
57
+ * @group Camera
58
+ */
53
59
  var VideoCodecType;
54
60
  (function (VideoCodecType) {
55
61
  VideoCodecType[VideoCodecType["H264"] = 0] = "H264";
56
62
  // while the namespace is already reserved for H265 it isn't currently supported.
57
63
  // H265 = 0x01,
58
64
  })(VideoCodecType = exports.VideoCodecType || (exports.VideoCodecType = {}));
65
+ /**
66
+ * @group Camera
67
+ */
59
68
  var H264Profile;
60
69
  (function (H264Profile) {
61
70
  H264Profile[H264Profile["BASELINE"] = 0] = "BASELINE";
62
71
  H264Profile[H264Profile["MAIN"] = 1] = "MAIN";
63
72
  H264Profile[H264Profile["HIGH"] = 2] = "HIGH";
64
73
  })(H264Profile = exports.H264Profile || (exports.H264Profile = {}));
74
+ /**
75
+ * @group Camera
76
+ */
65
77
  var H264Level;
66
78
  (function (H264Level) {
67
79
  H264Level[H264Level["LEVEL3_1"] = 0] = "LEVEL3_1";
68
80
  H264Level[H264Level["LEVEL3_2"] = 1] = "LEVEL3_2";
69
81
  H264Level[H264Level["LEVEL4_0"] = 2] = "LEVEL4_0";
70
82
  })(H264Level = exports.H264Level || (exports.H264Level = {}));
83
+ /**
84
+ * @group Camera
85
+ */
71
86
  var VideoCodecPacketizationMode;
72
87
  (function (VideoCodecPacketizationMode) {
73
88
  VideoCodecPacketizationMode[VideoCodecPacketizationMode["NON_INTERLEAVED"] = 0] = "NON_INTERLEAVED";
74
- })(VideoCodecPacketizationMode || (VideoCodecPacketizationMode = {}));
89
+ })(VideoCodecPacketizationMode = exports.VideoCodecPacketizationMode || (exports.VideoCodecPacketizationMode = {}));
75
90
  var VideoCodecCVO;
76
91
  (function (VideoCodecCVO) {
77
92
  VideoCodecCVO[VideoCodecCVO["UNSUPPORTED"] = 0] = "UNSUPPORTED";
@@ -105,11 +120,17 @@ var AudioCodecParametersTypes;
105
120
  AudioCodecParametersTypes[AudioCodecParametersTypes["SAMPLE_RATE"] = 3] = "SAMPLE_RATE";
106
121
  AudioCodecParametersTypes[AudioCodecParametersTypes["PACKET_TIME"] = 4] = "PACKET_TIME"; // only present in selected audio codec parameters tlv
107
122
  })(AudioCodecParametersTypes || (AudioCodecParametersTypes = {}));
123
+ /**
124
+ * @group Camera
125
+ */
108
126
  var AudioBitrate;
109
127
  (function (AudioBitrate) {
110
128
  AudioBitrate[AudioBitrate["VARIABLE"] = 0] = "VARIABLE";
111
129
  AudioBitrate[AudioBitrate["CONSTANT"] = 1] = "CONSTANT";
112
- })(AudioBitrate || (AudioBitrate = {}));
130
+ })(AudioBitrate = exports.AudioBitrate || (exports.AudioBitrate = {}));
131
+ /**
132
+ * @group Camera
133
+ */
113
134
  var AudioSamplerate;
114
135
  (function (AudioSamplerate) {
115
136
  AudioSamplerate[AudioSamplerate["KHZ_8"] = 0] = "KHZ_8";
@@ -117,12 +138,15 @@ var AudioSamplerate;
117
138
  AudioSamplerate[AudioSamplerate["KHZ_24"] = 2] = "KHZ_24";
118
139
  // 3, 4, 5 are theoretically defined, but no idea to what kHz value they correspond to
119
140
  // probably KHZ_32, KHZ_44_1, KHZ_48 (as supported by Secure Video recordings)
120
- })(AudioSamplerate || (AudioSamplerate = {}));
141
+ })(AudioSamplerate = exports.AudioSamplerate || (exports.AudioSamplerate = {}));
121
142
  // ----------
122
143
  var SupportedRTPConfigurationTypes;
123
144
  (function (SupportedRTPConfigurationTypes) {
124
145
  SupportedRTPConfigurationTypes[SupportedRTPConfigurationTypes["SRTP_CRYPTO_SUITE"] = 2] = "SRTP_CRYPTO_SUITE";
125
146
  })(SupportedRTPConfigurationTypes || (SupportedRTPConfigurationTypes = {}));
147
+ /**
148
+ * @group Camera
149
+ */
126
150
  var SRTPCryptoSuites;
127
151
  (function (SRTPCryptoSuites) {
128
152
  SRTPCryptoSuites[SRTPCryptoSuites["AES_CM_128_HMAC_SHA1_80"] = 0] = "AES_CM_128_HMAC_SHA1_80";
@@ -225,6 +249,9 @@ var AudioRTPParametersTypes;
225
249
  function isLegacySRTPOptions(options) {
226
250
  return "srtp" in options;
227
251
  }
252
+ /**
253
+ * @group Camera
254
+ */
228
255
  var AudioStreamingCodecType;
229
256
  (function (AudioStreamingCodecType) {
230
257
  AudioStreamingCodecType["PCMU"] = "PCMU";
@@ -235,23 +262,35 @@ var AudioStreamingCodecType;
235
262
  AudioStreamingCodecType["AMR"] = "AMR";
236
263
  AudioStreamingCodecType["AMR_WB"] = "AMR-WB";
237
264
  })(AudioStreamingCodecType = exports.AudioStreamingCodecType || (exports.AudioStreamingCodecType = {}));
265
+ /**
266
+ * @group Camera
267
+ */
238
268
  var AudioStreamingSamplerate;
239
269
  (function (AudioStreamingSamplerate) {
240
270
  AudioStreamingSamplerate[AudioStreamingSamplerate["KHZ_8"] = 8] = "KHZ_8";
241
271
  AudioStreamingSamplerate[AudioStreamingSamplerate["KHZ_16"] = 16] = "KHZ_16";
242
272
  AudioStreamingSamplerate[AudioStreamingSamplerate["KHZ_24"] = 24] = "KHZ_24";
243
273
  })(AudioStreamingSamplerate = exports.AudioStreamingSamplerate || (exports.AudioStreamingSamplerate = {}));
274
+ /**
275
+ * @group Camera
276
+ */
244
277
  var StreamRequestTypes;
245
278
  (function (StreamRequestTypes) {
246
279
  StreamRequestTypes["RECONFIGURE"] = "reconfigure";
247
280
  StreamRequestTypes["START"] = "start";
248
281
  StreamRequestTypes["STOP"] = "stop";
249
282
  })(StreamRequestTypes = exports.StreamRequestTypes || (exports.StreamRequestTypes = {}));
283
+ /**
284
+ * @group Camera
285
+ */
250
286
  var RTPStreamManagement = /** @class */ (function () {
251
287
  function RTPStreamManagement(id, options, delegate, service, disabledThroughOperatingMode) {
252
288
  this.videoOnly = false;
253
289
  this.sessionIdentifier = undefined;
254
- this.streamStatus = 0 /* AVAILABLE */; // use _updateStreamStatus to update this property
290
+ /**
291
+ * @private private API
292
+ */
293
+ this.streamStatus = 0 /* StreamingStatus.AVAILABLE */; // use _updateStreamStatus to update this property
255
294
  this.selectedConfiguration = ""; // base64 representation of the currently selected configuration
256
295
  this.setupEndpointsResponse = ""; // response of the SetupEndpoints Characteristic
257
296
  this.id = id;
@@ -259,13 +298,13 @@ var RTPStreamManagement = /** @class */ (function () {
259
298
  this.requireProxy = options.proxy || false;
260
299
  this.disableAudioProxy = options.disable_audio_proxy || false;
261
300
  if (isLegacySRTPOptions(options)) {
262
- this.supportedCryptoSuites = [options.srtp ? 0 /* AES_CM_128_HMAC_SHA1_80 */ : 2 /* NONE */];
301
+ this.supportedCryptoSuites = [options.srtp ? 0 /* SRTPCryptoSuites.AES_CM_128_HMAC_SHA1_80 */ : 2 /* SRTPCryptoSuites.NONE */];
263
302
  }
264
303
  else {
265
304
  this.supportedCryptoSuites = options.supportedCryptoSuites;
266
305
  }
267
306
  if (this.supportedCryptoSuites.length === 0) {
268
- this.supportedCryptoSuites.push(2 /* NONE */);
307
+ this.supportedCryptoSuites.push(2 /* SRTPCryptoSuites.NONE */);
269
308
  }
270
309
  if (!options.video) {
271
310
  throw new Error("Video parameters cannot be undefined in options");
@@ -321,35 +360,35 @@ var RTPStreamManagement = /** @class */ (function () {
321
360
  this.service.setCharacteristic(Characteristic_1.Characteristic.Active, true);
322
361
  }
323
362
  this.service.getCharacteristic(Characteristic_1.Characteristic.Active)
324
- .on("change" /* CHANGE */, function () { var _a; return (_a = _this.stateChangeDelegate) === null || _a === void 0 ? void 0 : _a.call(_this); })
325
- .setProps({ adminOnlyAccess: [1 /* WRITE */] });
363
+ .on("change" /* CharacteristicEventTypes.CHANGE */, function () { var _a; return (_a = _this.stateChangeDelegate) === null || _a === void 0 ? void 0 : _a.call(_this); })
364
+ .setProps({ adminOnlyAccess: [1 /* Access.WRITE */] });
326
365
  // ensure that configurations are up-to-date and reflected in the characteristic values
327
366
  this.service.setCharacteristic(Characteristic_1.Characteristic.SupportedRTPConfiguration, this.supportedRTPConfiguration);
328
367
  this.service.setCharacteristic(Characteristic_1.Characteristic.SupportedVideoStreamConfiguration, this.supportedVideoStreamConfiguration);
329
368
  this.service.setCharacteristic(Characteristic_1.Characteristic.SupportedAudioStreamConfiguration, this.supportedAudioStreamConfiguration);
330
- this._updateStreamStatus(0 /* AVAILABLE */); // reset streaming status to available
369
+ this._updateStreamStatus(0 /* StreamingStatus.AVAILABLE */); // reset streaming status to available
331
370
  this.service.setCharacteristic(Characteristic_1.Characteristic.SetupEndpoints, this.setupEndpointsResponse); // reset SetupEndpoints to default
332
371
  this.service.getCharacteristic(Characteristic_1.Characteristic.SelectedRTPStreamConfiguration)
333
- .on("get" /* GET */, function (callback) {
372
+ .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
334
373
  if (_this.streamingIsDisabled()) {
335
- callback(null, tlv.encode(1 /* SESSION_CONTROL */, tlv.encode(2 /* COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64"));
374
+ callback(null, tlv.encode(1 /* SelectedRTPStreamConfigurationTypes.SESSION_CONTROL */, tlv.encode(2 /* SessionControlTypes.COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64"));
336
375
  return;
337
376
  }
338
377
  callback(null, _this.selectedConfiguration);
339
378
  })
340
- .on("set" /* SET */, this._handleSelectedStreamConfigurationWrite.bind(this));
379
+ .on("set" /* CharacteristicEventTypes.SET */, this._handleSelectedStreamConfigurationWrite.bind(this));
341
380
  this.service.getCharacteristic(Characteristic_1.Characteristic.SetupEndpoints)
342
- .on("get" /* GET */, function (callback) {
381
+ .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
343
382
  if (_this.streamingIsDisabled()) {
344
- callback(null, tlv.encode(2 /* STATUS */, 2 /* ERROR */).toString("base64"));
383
+ callback(null, tlv.encode(2 /* SetupEndpointsResponseTypes.STATUS */, 2 /* SetupEndpointsStatus.ERROR */).toString("base64"));
345
384
  return;
346
385
  }
347
386
  callback(null, _this.setupEndpointsResponse);
348
387
  })
349
- .on("set" /* SET */, function (value, callback, context, connection) {
388
+ .on("set" /* CharacteristicEventTypes.SET */, function (value, callback, context, connection) {
350
389
  if (!connection) {
351
390
  debug("Set event handler for SetupEndpoints cannot be called from plugin. Connection undefined!");
352
- callback(-70410 /* INVALID_VALUE_IN_REQUEST */);
391
+ callback(-70410 /* HAPStatus.INVALID_VALUE_IN_REQUEST */);
353
392
  return;
354
393
  }
355
394
  _this.handleSetupEndpoints(value, callback, connection);
@@ -359,10 +398,10 @@ var RTPStreamManagement = /** @class */ (function () {
359
398
  this.resetSelectedStreamConfiguration();
360
399
  this.resetSetupEndpointsResponse();
361
400
  if (this.activeConnection) {
362
- this.activeConnection.removeListener("closed" /* CLOSED */, this.activeConnectionClosedListener);
401
+ this.activeConnection.removeListener("closed" /* HAPConnectionEvent.CLOSED */, this.activeConnectionClosedListener);
363
402
  this.activeConnection = undefined;
364
403
  }
365
- this._updateStreamStatus(0 /* AVAILABLE */);
404
+ this._updateStreamStatus(0 /* StreamingStatus.AVAILABLE */);
366
405
  this.sessionIdentifier = undefined;
367
406
  // noinspection JSDeprecatedSymbols
368
407
  this.connectionID = undefined;
@@ -379,11 +418,11 @@ var RTPStreamManagement = /** @class */ (function () {
379
418
  RTPStreamManagement.prototype.streamingIsDisabled = function (callback) {
380
419
  var _a;
381
420
  if (!this.service.getCharacteristic(Characteristic_1.Characteristic.Active).value) {
382
- callback && callback(new index_1.HapStatusError(-70412 /* NOT_ALLOWED_IN_CURRENT_STATE */));
421
+ callback && callback(new hapStatusError_1.HapStatusError(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */));
383
422
  return true;
384
423
  }
385
424
  if ((_a = this.disabledThroughOperatingMode) === null || _a === void 0 ? void 0 : _a.call(this)) {
386
- callback && callback(new index_1.HapStatusError(-70412 /* NOT_ALLOWED_IN_CURRENT_STATE */));
425
+ callback && callback(new hapStatusError_1.HapStatusError(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */));
387
426
  return true;
388
427
  }
389
428
  return false;
@@ -395,12 +434,12 @@ var RTPStreamManagement = /** @class */ (function () {
395
434
  }
396
435
  var data = Buffer.from(value, "base64");
397
436
  var objects = tlv.decode(data);
398
- var sessionControl = tlv.decode(objects[1 /* SESSION_CONTROL */]);
399
- var sessionIdentifier = index_1.uuid.unparse(sessionControl[1 /* SESSION_IDENTIFIER */]);
400
- var requestType = sessionControl[2 /* COMMAND */][0];
437
+ var sessionControl = tlv.decode(objects[1 /* SelectedRTPStreamConfigurationTypes.SESSION_CONTROL */]);
438
+ var sessionIdentifier = uuid.unparse(sessionControl[1 /* SessionControlTypes.SESSION_IDENTIFIER */]);
439
+ var requestType = sessionControl[2 /* SessionControlTypes.COMMAND */][0];
401
440
  if (sessionIdentifier !== this.sessionIdentifier) {
402
441
  debug("Received unknown session Identifier with request to ".concat(SessionControlCommand[requestType]));
403
- callback(-70410 /* INVALID_VALUE_IN_REQUEST */);
442
+ callback(-70410 /* HAPStatus.INVALID_VALUE_IN_REQUEST */);
404
443
  return;
405
444
  }
406
445
  this.selectedConfiguration = value;
@@ -413,13 +452,13 @@ var RTPStreamManagement = /** @class */ (function () {
413
452
  };
414
453
  switch (requestType) {
415
454
  case SessionControlCommand.START_SESSION: {
416
- var selectedVideoParameters = tlv.decode(objects[2 /* SELECTED_VIDEO_PARAMETERS */]);
417
- var selectedAudioParameters = tlv.decode(objects[3 /* SELECTED_AUDIO_PARAMETERS */]);
455
+ var selectedVideoParameters = tlv.decode(objects[2 /* SelectedRTPStreamConfigurationTypes.SELECTED_VIDEO_PARAMETERS */]);
456
+ var selectedAudioParameters = tlv.decode(objects[3 /* SelectedRTPStreamConfigurationTypes.SELECTED_AUDIO_PARAMETERS */]);
418
457
  this._handleStartStream(selectedVideoParameters, selectedAudioParameters, streamCallback);
419
458
  break;
420
459
  }
421
460
  case SessionControlCommand.RECONFIGURE_SESSION: {
422
- var reconfiguredVideoParameters = tlv.decode(objects[2 /* SELECTED_VIDEO_PARAMETERS */]);
461
+ var reconfiguredVideoParameters = tlv.decode(objects[2 /* SelectedRTPStreamConfigurationTypes.SELECTED_VIDEO_PARAMETERS */]);
423
462
  this.handleReconfigureStream(reconfiguredVideoParameters, streamCallback);
424
463
  break;
425
464
  }
@@ -430,60 +469,60 @@ var RTPStreamManagement = /** @class */ (function () {
430
469
  case SessionControlCommand.SUSPEND_SESSION:
431
470
  default:
432
471
  debug("Unhandled request type ".concat(SessionControlCommand[requestType]));
433
- callback(-70410 /* INVALID_VALUE_IN_REQUEST */);
472
+ callback(-70410 /* HAPStatus.INVALID_VALUE_IN_REQUEST */);
434
473
  return;
435
474
  }
436
475
  };
437
476
  RTPStreamManagement.prototype._handleStartStream = function (videoConfiguration, audioConfiguration, callback) {
438
477
  // selected video configuration
439
478
  // noinspection JSUnusedLocalSymbols
440
- var videoCodec = videoConfiguration[1 /* CODEC_TYPE */]; // always 0x00 for h264
441
- var videoParametersTLV = videoConfiguration[2 /* CODEC_PARAMETERS */];
442
- var videoAttributesTLV = videoConfiguration[3 /* ATTRIBUTES */];
443
- var videoRTPParametersTLV = videoConfiguration[4 /* RTP_PARAMETERS */];
479
+ var videoCodec = videoConfiguration[1 /* SelectedVideoParametersTypes.CODEC_TYPE */]; // always 0x00 for h264
480
+ var videoParametersTLV = videoConfiguration[2 /* SelectedVideoParametersTypes.CODEC_PARAMETERS */];
481
+ var videoAttributesTLV = videoConfiguration[3 /* SelectedVideoParametersTypes.ATTRIBUTES */];
482
+ var videoRTPParametersTLV = videoConfiguration[4 /* SelectedVideoParametersTypes.RTP_PARAMETERS */];
444
483
  // video parameters
445
484
  var videoParameters = tlv.decode(videoParametersTLV);
446
- var h264Profile = videoParameters[1 /* PROFILE_ID */][0];
447
- var h264Level = videoParameters[2 /* LEVEL */][0];
448
- var packetizationMode = videoParameters[3 /* PACKETIZATION_MODE */][0];
449
- var cvoEnabled = videoParameters[4 /* CVO_ENABLED */];
485
+ var h264Profile = videoParameters[1 /* VideoCodecParametersTypes.PROFILE_ID */][0];
486
+ var h264Level = videoParameters[2 /* VideoCodecParametersTypes.LEVEL */][0];
487
+ var packetizationMode = videoParameters[3 /* VideoCodecParametersTypes.PACKETIZATION_MODE */][0];
488
+ var cvoEnabled = videoParameters[4 /* VideoCodecParametersTypes.CVO_ENABLED */];
450
489
  var cvoId = undefined;
451
- if (cvoEnabled && cvoEnabled[0] === 1 /* SUPPORTED */) {
452
- cvoId = videoParameters[5 /* CVO_ID */].readUInt8(0);
490
+ if (cvoEnabled && cvoEnabled[0] === 1 /* VideoCodecCVO.SUPPORTED */) {
491
+ cvoId = videoParameters[5 /* VideoCodecParametersTypes.CVO_ID */].readUInt8(0);
453
492
  }
454
493
  // video attributes
455
494
  var videoAttributes = tlv.decode(videoAttributesTLV);
456
- var width = videoAttributes[1 /* IMAGE_WIDTH */].readUInt16LE(0);
457
- var height = videoAttributes[2 /* IMAGE_HEIGHT */].readUInt16LE(0);
458
- var frameRate = videoAttributes[3 /* FRAME_RATE */].readUInt8(0);
495
+ var width = videoAttributes[1 /* VideoAttributesTypes.IMAGE_WIDTH */].readUInt16LE(0);
496
+ var height = videoAttributes[2 /* VideoAttributesTypes.IMAGE_HEIGHT */].readUInt16LE(0);
497
+ var frameRate = videoAttributes[3 /* VideoAttributesTypes.FRAME_RATE */].readUInt8(0);
459
498
  // video rtp parameters
460
499
  var videoRTPParameters = tlv.decode(videoRTPParametersTLV);
461
- var videoPayloadType = videoRTPParameters[1 /* PAYLOAD_TYPE */].readUInt8(0); // 99
462
- var videoSSRC = videoRTPParameters[2 /* SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
463
- var videoMaximumBitrate = videoRTPParameters[3 /* MAX_BIT_RATE */].readUInt16LE(0);
464
- var videoRTCPInterval = videoRTPParameters[4 /* MIN_RTCP_INTERVAL */].readFloatLE(0);
500
+ var videoPayloadType = videoRTPParameters[1 /* VideoRTPParametersTypes.PAYLOAD_TYPE */].readUInt8(0); // 99
501
+ var videoSSRC = videoRTPParameters[2 /* VideoRTPParametersTypes.SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
502
+ var videoMaximumBitrate = videoRTPParameters[3 /* VideoRTPParametersTypes.MAX_BIT_RATE */].readUInt16LE(0);
503
+ var videoRTCPInterval = videoRTPParameters[4 /* VideoRTPParametersTypes.MIN_RTCP_INTERVAL */].readFloatLE(0);
465
504
  var maxMTU = this.ipVersion === "ipv6" ? 1228 : 1378; // default values ipv4: 1378 bytes; ipv6: 1228 bytes
466
- if (videoRTPParameters[5 /* MAX_MTU */]) {
467
- maxMTU = videoRTPParameters[5 /* MAX_MTU */].readUInt16LE(0);
505
+ if (videoRTPParameters[5 /* VideoRTPParametersTypes.MAX_MTU */]) {
506
+ maxMTU = videoRTPParameters[5 /* VideoRTPParametersTypes.MAX_MTU */].readUInt16LE(0);
468
507
  }
469
508
  // selected audio configuration
470
- var audioCodec = audioConfiguration[1 /* CODEC_TYPE */][0];
471
- var audioParametersTLV = audioConfiguration[2 /* CODEC_PARAMETERS */];
472
- var audioRTPParametersTLV = audioConfiguration[3 /* RTP_PARAMETERS */];
473
- var comfortNoise = !!audioConfiguration[4 /* COMFORT_NOISE */].readUInt8(0);
509
+ var audioCodec = audioConfiguration[1 /* SelectedAudioParametersTypes.CODEC_TYPE */][0];
510
+ var audioParametersTLV = audioConfiguration[2 /* SelectedAudioParametersTypes.CODEC_PARAMETERS */];
511
+ var audioRTPParametersTLV = audioConfiguration[3 /* SelectedAudioParametersTypes.RTP_PARAMETERS */];
512
+ var comfortNoise = !!audioConfiguration[4 /* SelectedAudioParametersTypes.COMFORT_NOISE */].readUInt8(0);
474
513
  // audio parameters
475
514
  var audioParameters = tlv.decode(audioParametersTLV);
476
- var channels = audioParameters[1 /* CHANNEL */][0];
477
- var audioBitrate = audioParameters[2 /* BIT_RATE */][0];
478
- var samplerate = audioParameters[3 /* SAMPLE_RATE */][0];
479
- var rtpPacketTime = audioParameters[4 /* PACKET_TIME */].readUInt8(0);
515
+ var channels = audioParameters[1 /* AudioCodecParametersTypes.CHANNEL */][0];
516
+ var audioBitrate = audioParameters[2 /* AudioCodecParametersTypes.BIT_RATE */][0];
517
+ var samplerate = audioParameters[3 /* AudioCodecParametersTypes.SAMPLE_RATE */][0];
518
+ var rtpPacketTime = audioParameters[4 /* AudioCodecParametersTypes.PACKET_TIME */].readUInt8(0);
480
519
  // audio rtp parameters
481
520
  var audioRTPParameters = tlv.decode(audioRTPParametersTLV);
482
- var audioPayloadType = audioRTPParameters[1 /* PAYLOAD_TYPE */].readUInt8(0); // 110
483
- var audioSSRC = audioRTPParameters[2 /* SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
484
- var audioMaximumBitrate = audioRTPParameters[3 /* MAX_BIT_RATE */].readUInt16LE(0);
485
- var audioRTCPInterval = audioRTPParameters[4 /* MIN_RTCP_INTERVAL */].readFloatLE(0);
486
- var comfortNoisePayloadType = audioRTPParameters[6 /* COMFORT_NOISE_PAYLOAD_TYPE */].readUInt8(0); // 13
521
+ var audioPayloadType = audioRTPParameters[1 /* AudioRTPParametersTypes.PAYLOAD_TYPE */].readUInt8(0); // 110
522
+ var audioSSRC = audioRTPParameters[2 /* AudioRTPParametersTypes.SYNCHRONIZATION_SOURCE */].readUInt32LE(0);
523
+ var audioMaximumBitrate = audioRTPParameters[3 /* AudioRTPParametersTypes.MAX_BIT_RATE */].readUInt16LE(0);
524
+ var audioRTCPInterval = audioRTPParameters[4 /* AudioRTPParametersTypes.MIN_RTCP_INTERVAL */].readFloatLE(0);
525
+ var comfortNoisePayloadType = audioRTPParameters[6 /* AudioRTPParametersTypes.COMFORT_NOISE_PAYLOAD_TYPE */].readUInt8(0); // 13
487
526
  if (this.requireProxy) {
488
527
  this.videoProxy.setOutgoingPayloadType(videoPayloadType);
489
528
  if (!this.disableAudioProxy) {
@@ -508,38 +547,38 @@ var RTPStreamManagement = /** @class */ (function () {
508
547
  var audioCodecName;
509
548
  var samplerateNum;
510
549
  switch (audioCodec) {
511
- case 0 /* PCMU */:
512
- audioCodecName = "PCMU" /* PCMU */;
550
+ case 0 /* AudioCodecTypes.PCMU */:
551
+ audioCodecName = "PCMU" /* AudioStreamingCodecType.PCMU */;
513
552
  break;
514
- case 1 /* PCMA */:
515
- audioCodecName = "PCMA" /* PCMA */;
553
+ case 1 /* AudioCodecTypes.PCMA */:
554
+ audioCodecName = "PCMA" /* AudioStreamingCodecType.PCMA */;
516
555
  break;
517
- case 2 /* AAC_ELD */:
518
- audioCodecName = "AAC-eld" /* AAC_ELD */;
556
+ case 2 /* AudioCodecTypes.AAC_ELD */:
557
+ audioCodecName = "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */;
519
558
  break;
520
- case 3 /* OPUS */:
521
- audioCodecName = "OPUS" /* OPUS */;
559
+ case 3 /* AudioCodecTypes.OPUS */:
560
+ audioCodecName = "OPUS" /* AudioStreamingCodecType.OPUS */;
522
561
  break;
523
- case 4 /* MSBC */:
524
- audioCodecName = "mSBC" /* MSBC */;
562
+ case 4 /* AudioCodecTypes.MSBC */:
563
+ audioCodecName = "mSBC" /* AudioStreamingCodecType.MSBC */;
525
564
  break;
526
- case 5 /* AMR */:
527
- audioCodecName = "AMR" /* AMR */;
565
+ case 5 /* AudioCodecTypes.AMR */:
566
+ audioCodecName = "AMR" /* AudioStreamingCodecType.AMR */;
528
567
  break;
529
- case 6 /* AMR_WB */:
530
- audioCodecName = "AMR-WB" /* AMR_WB */;
568
+ case 6 /* AudioCodecTypes.AMR_WB */:
569
+ audioCodecName = "AMR-WB" /* AudioStreamingCodecType.AMR_WB */;
531
570
  break;
532
571
  default:
533
572
  throw new Error("Encountered unknown selected audio codec ".concat(audioCodec));
534
573
  }
535
574
  switch (samplerate) {
536
- case 0 /* KHZ_8 */:
575
+ case 0 /* AudioSamplerate.KHZ_8 */:
537
576
  samplerateNum = 8;
538
577
  break;
539
- case 1 /* KHZ_16 */:
578
+ case 1 /* AudioSamplerate.KHZ_16 */:
540
579
  samplerateNum = 16;
541
580
  break;
542
- case 2 /* KHZ_24 */:
581
+ case 2 /* AudioSamplerate.KHZ_24 */:
543
582
  samplerateNum = 24;
544
583
  break;
545
584
  default:
@@ -560,7 +599,7 @@ var RTPStreamManagement = /** @class */ (function () {
560
599
  };
561
600
  var request = {
562
601
  sessionID: this.sessionIdentifier,
563
- type: "start" /* START */,
602
+ type: "start" /* StreamRequestTypes.START */,
564
603
  video: videoInfo,
565
604
  audio: audioInfo,
566
605
  };
@@ -568,18 +607,18 @@ var RTPStreamManagement = /** @class */ (function () {
568
607
  };
569
608
  RTPStreamManagement.prototype.handleReconfigureStream = function (videoConfiguration, callback) {
570
609
  // selected video configuration
571
- var videoAttributesTLV = videoConfiguration[3 /* ATTRIBUTES */];
572
- var videoRTPParametersTLV = videoConfiguration[4 /* RTP_PARAMETERS */];
610
+ var videoAttributesTLV = videoConfiguration[3 /* SelectedVideoParametersTypes.ATTRIBUTES */];
611
+ var videoRTPParametersTLV = videoConfiguration[4 /* SelectedVideoParametersTypes.RTP_PARAMETERS */];
573
612
  // video attributes
574
613
  var videoAttributes = tlv.decode(videoAttributesTLV);
575
- var width = videoAttributes[1 /* IMAGE_WIDTH */].readUInt16LE(0);
576
- var height = videoAttributes[2 /* IMAGE_HEIGHT */].readUInt16LE(0);
577
- var frameRate = videoAttributes[3 /* FRAME_RATE */].readUInt8(0);
614
+ var width = videoAttributes[1 /* VideoAttributesTypes.IMAGE_WIDTH */].readUInt16LE(0);
615
+ var height = videoAttributes[2 /* VideoAttributesTypes.IMAGE_HEIGHT */].readUInt16LE(0);
616
+ var frameRate = videoAttributes[3 /* VideoAttributesTypes.FRAME_RATE */].readUInt8(0);
578
617
  // video rtp parameters
579
618
  var videoRTPParameters = tlv.decode(videoRTPParametersTLV);
580
- var videoMaximumBitrate = videoRTPParameters[3 /* MAX_BIT_RATE */].readUInt16LE(0);
619
+ var videoMaximumBitrate = videoRTPParameters[3 /* VideoRTPParametersTypes.MAX_BIT_RATE */].readUInt16LE(0);
581
620
  // seems to be always zero, use default of 0.5
582
- var videoRTCPInterval = videoRTPParameters[4 /* MIN_RTCP_INTERVAL */].readFloatLE(0) || 0.5;
621
+ var videoRTCPInterval = videoRTPParameters[4 /* VideoRTPParametersTypes.MIN_RTCP_INTERVAL */].readFloatLE(0) || 0.5;
583
622
  var reconfiguredVideoInfo = {
584
623
  width: width,
585
624
  height: height,
@@ -589,7 +628,7 @@ var RTPStreamManagement = /** @class */ (function () {
589
628
  };
590
629
  var request = {
591
630
  sessionID: this.sessionIdentifier,
592
- type: "reconfigure" /* RECONFIGURE */,
631
+ type: "reconfigure" /* StreamRequestTypes.RECONFIGURE */,
593
632
  video: reconfiguredVideoInfo,
594
633
  };
595
634
  this.delegate.handleStreamRequest(request, function (error) { return callback(error); });
@@ -597,7 +636,7 @@ var RTPStreamManagement = /** @class */ (function () {
597
636
  RTPStreamManagement.prototype._handleStopStream = function (callback) {
598
637
  var request = {
599
638
  sessionID: this.sessionIdentifier,
600
- type: "stop" /* STOP */,
639
+ type: "stop" /* StreamRequestTypes.STOP */,
601
640
  };
602
641
  this.handleSessionClosed();
603
642
  this.delegate.handleStreamRequest(request, function (error) { return callback ? callback(error) : undefined; });
@@ -609,43 +648,43 @@ var RTPStreamManagement = /** @class */ (function () {
609
648
  }
610
649
  var data = Buffer.from(value, "base64");
611
650
  var objects = tlv.decode(data);
612
- var sessionIdentifier = index_1.uuid.unparse(objects[1 /* SESSION_ID */]);
613
- if (this.streamStatus !== 0 /* AVAILABLE */) {
614
- this.setupEndpointsResponse = tlv.encode(1 /* SESSION_ID */, index_1.uuid.write(sessionIdentifier), 2 /* STATUS */, 1 /* BUSY */).toString("base64");
651
+ var sessionIdentifier = uuid.unparse(objects[1 /* SetupEndpointsTypes.SESSION_ID */]);
652
+ if (this.streamStatus !== 0 /* StreamingStatus.AVAILABLE */) {
653
+ this.setupEndpointsResponse = tlv.encode(1 /* SetupEndpointsResponseTypes.SESSION_ID */, uuid.write(sessionIdentifier), 2 /* SetupEndpointsResponseTypes.STATUS */, 1 /* SetupEndpointsStatus.BUSY */).toString("base64");
615
654
  callback();
616
655
  return;
617
656
  }
618
657
  (0, assert_1.default)(this.activeConnection == null, "Found non-nil `activeConnection` when trying to setup streaming endpoints, even though streamStatus is reported to be AVAILABLE!");
619
658
  this.activeConnection = connection;
620
- this.activeConnection.on("closed" /* CLOSED */, this.activeConnectionClosedListener);
659
+ this.activeConnection.on("closed" /* HAPConnectionEvent.CLOSED */, this.activeConnectionClosedListener);
621
660
  // noinspection JSDeprecatedSymbols
622
661
  this.connectionID = connection.sessionID;
623
662
  this.sessionIdentifier = sessionIdentifier;
624
- this._updateStreamStatus(1 /* IN_USE */);
663
+ this._updateStreamStatus(1 /* StreamingStatus.IN_USE */);
625
664
  // Address
626
- var targetAddressPayload = objects[3 /* CONTROLLER_ADDRESS */];
665
+ var targetAddressPayload = objects[3 /* SetupEndpointsTypes.CONTROLLER_ADDRESS */];
627
666
  var processedAddressInfo = tlv.decode(targetAddressPayload);
628
- var addressVersion = processedAddressInfo[1 /* ADDRESS_VERSION */][0];
629
- var controllerAddress = processedAddressInfo[2 /* ADDRESS */].toString("utf8");
630
- var targetVideoPort = processedAddressInfo[3 /* VIDEO_RTP_PORT */].readUInt16LE(0);
631
- var targetAudioPort = processedAddressInfo[4 /* AUDIO_RTP_PORT */].readUInt16LE(0);
667
+ var addressVersion = processedAddressInfo[1 /* AddressTypes.ADDRESS_VERSION */][0];
668
+ var controllerAddress = processedAddressInfo[2 /* AddressTypes.ADDRESS */].toString("utf8");
669
+ var targetVideoPort = processedAddressInfo[3 /* AddressTypes.VIDEO_RTP_PORT */].readUInt16LE(0);
670
+ var targetAudioPort = processedAddressInfo[4 /* AddressTypes.AUDIO_RTP_PORT */].readUInt16LE(0);
632
671
  // Video SRTP Params
633
- var videoSRTPPayload = objects[4 /* VIDEO_SRTP_PARAMETERS */];
672
+ var videoSRTPPayload = objects[4 /* SetupEndpointsTypes.VIDEO_SRTP_PARAMETERS */];
634
673
  var processedVideoInfo = tlv.decode(videoSRTPPayload);
635
- var videoCryptoSuite = processedVideoInfo[1 /* SRTP_CRYPTO_SUITE */][0];
636
- var videoMasterKey = processedVideoInfo[2 /* MASTER_KEY */];
637
- var videoMasterSalt = processedVideoInfo[3 /* MASTER_SALT */];
674
+ var videoCryptoSuite = processedVideoInfo[1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */][0];
675
+ var videoMasterKey = processedVideoInfo[2 /* SRTPParametersTypes.MASTER_KEY */];
676
+ var videoMasterSalt = processedVideoInfo[3 /* SRTPParametersTypes.MASTER_SALT */];
638
677
  // Audio SRTP Params
639
- var audioSRTPPayload = objects[5 /* AUDIO_SRTP_PARAMETERS */];
678
+ var audioSRTPPayload = objects[5 /* SetupEndpointsTypes.AUDIO_SRTP_PARAMETERS */];
640
679
  var processedAudioInfo = tlv.decode(audioSRTPPayload);
641
- var audioCryptoSuite = processedAudioInfo[1 /* SRTP_CRYPTO_SUITE */][0];
642
- var audioMasterKey = processedAudioInfo[2 /* MASTER_KEY */];
643
- var audioMasterSalt = processedAudioInfo[3 /* MASTER_SALT */];
680
+ var audioCryptoSuite = processedAudioInfo[1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */][0];
681
+ var audioMasterKey = processedAudioInfo[2 /* SRTPParametersTypes.MASTER_KEY */];
682
+ var audioMasterSalt = processedAudioInfo[3 /* SRTPParametersTypes.MASTER_SALT */];
644
683
  debug("Session: ", sessionIdentifier, "\nControllerAddress: ", controllerAddress, "\nVideoPort: ", targetVideoPort, "\nAudioPort: ", targetAudioPort, "\nVideo Crypto: ", videoCryptoSuite, "\nVideo Master Key: ", videoMasterKey, "\nVideo Master Salt: ", videoMasterSalt, "\nAudio Crypto: ", audioCryptoSuite, "\nAudio Master Key: ", audioMasterKey, "\nAudio Master Salt: ", audioMasterSalt);
645
684
  var prepareRequest = {
646
685
  sessionID: sessionIdentifier,
647
686
  targetAddress: controllerAddress,
648
- addressVersion: addressVersion === 1 /* IPV6 */ ? "ipv6" : "ipv4",
687
+ addressVersion: addressVersion === 1 /* IPAddressVersion.IPV6 */ ? "ipv6" : "ipv4",
649
688
  video: {
650
689
  port: targetVideoPort,
651
690
  srtpCryptoSuite: videoCryptoSuite,
@@ -661,7 +700,7 @@ var RTPStreamManagement = /** @class */ (function () {
661
700
  };
662
701
  var promises = [];
663
702
  if (this.requireProxy) {
664
- prepareRequest.targetAddress = connection.getLocalAddress(addressVersion === 1 /* IPV6 */ ? "ipv6" : "ipv4"); // ip versions must be the same
703
+ prepareRequest.targetAddress = connection.getLocalAddress(addressVersion === 1 /* IPAddressVersion.IPV6 */ ? "ipv6" : "ipv4"); // ip versions must be the same
665
704
  this.videoProxy = new RTPProxy_1.default({
666
705
  outgoingAddress: controllerAddress,
667
706
  outgoingPort: targetVideoPort,
@@ -686,10 +725,10 @@ var RTPStreamManagement = /** @class */ (function () {
686
725
  }
687
726
  }
688
727
  Promise.all(promises).then(function () {
689
- _this.delegate.prepareStream(prepareRequest, (0, index_1.once)(function (error, response) {
728
+ _this.delegate.prepareStream(prepareRequest, (0, once_1.once)(function (error, response) {
690
729
  if (error || !response) {
691
730
  debug("PrepareStream request encountered an error: ".concat(error ? error.message : undefined));
692
- _this.setupEndpointsResponse = tlv.encode(1 /* SESSION_ID */, index_1.uuid.write(sessionIdentifier), 2 /* STATUS */, 2 /* ERROR */).toString("base64");
731
+ _this.setupEndpointsResponse = tlv.encode(1 /* SetupEndpointsResponseTypes.SESSION_ID */, uuid.write(sessionIdentifier), 2 /* SetupEndpointsResponseTypes.STATUS */, 2 /* SetupEndpointsStatus.ERROR */).toString("base64");
693
732
  _this.handleSessionClosed();
694
733
  callback(error);
695
734
  }
@@ -737,11 +776,11 @@ var RTPStreamManagement = /** @class */ (function () {
737
776
  }
738
777
  videoPort = videoInfo.port;
739
778
  audioPort = audioInfo.port;
740
- if (request.video.srtpCryptoSuite !== 2 /* NONE */
779
+ if (request.video.srtpCryptoSuite !== 2 /* SRTPCryptoSuites.NONE */
741
780
  && (videoInfo.srtp_key === undefined || videoInfo.srtp_salt === undefined)) {
742
781
  throw new Error("SRTP was selected for the prepared video stream, but no 'srtp_key' or 'srtp_salt' was specified!");
743
782
  }
744
- if (request.audio.srtpCryptoSuite !== 2 /* NONE */
783
+ if (request.audio.srtpCryptoSuite !== 2 /* SRTPCryptoSuites.NONE */
745
784
  && (audioInfo.srtp_key === undefined || audioInfo.srtp_salt === undefined)) {
746
785
  throw new Error("SRTP was selected for the prepared audio stream, but no 'srtp_key' or 'srtp_salt' was specified!");
747
786
  }
@@ -757,10 +796,10 @@ var RTPStreamManagement = /** @class */ (function () {
757
796
  else {
758
797
  var videoInfo = response.video;
759
798
  address = connection.getLocalAddress(request.addressVersion);
760
- videoCryptoSuite = 2 /* NONE */;
799
+ videoCryptoSuite = 2 /* SRTPCryptoSuites.NONE */;
761
800
  videoSRTPKey = Buffer.alloc(0);
762
801
  videoSRTPSalt = Buffer.alloc(0);
763
- audioCryptoSuite = 2 /* NONE */;
802
+ audioCryptoSuite = 2 /* SRTPCryptoSuites.NONE */;
764
803
  audioSRTPKey = Buffer.alloc(0);
765
804
  audioSRTPSalt = Buffer.alloc(0);
766
805
  this.videoProxy.setIncomingPayloadType(videoInfo.proxy_pt);
@@ -785,21 +824,21 @@ var RTPStreamManagement = /** @class */ (function () {
785
824
  }
786
825
  }
787
826
  this.ipVersion = addressVersion; // we need to save this in order to calculate some default mtu values later
788
- var accessoryAddress = tlv.encode(1 /* ADDRESS_VERSION */, addressVersion === "ipv4" ? 0 /* IPV4 */ : 1 /* IPV6 */, 2 /* ADDRESS */, address, 3 /* VIDEO_RTP_PORT */, tlv.writeUInt16(videoPort), 4 /* AUDIO_RTP_PORT */, tlv.writeUInt16(audioPort));
789
- var videoSRTPParameters = tlv.encode(1 /* SRTP_CRYPTO_SUITE */, videoCryptoSuite, 2 /* MASTER_KEY */, videoSRTPKey, 3 /* MASTER_SALT */, videoSRTPSalt);
790
- var audioSRTPParameters = tlv.encode(1 /* SRTP_CRYPTO_SUITE */, audioCryptoSuite, 2 /* MASTER_KEY */, audioSRTPKey, 3 /* MASTER_SALT */, audioSRTPSalt);
791
- this.setupEndpointsResponse = tlv.encode(1 /* SESSION_ID */, index_1.uuid.write(identifier), 2 /* STATUS */, 0 /* SUCCESS */, 3 /* ACCESSORY_ADDRESS */, accessoryAddress, 4 /* VIDEO_SRTP_PARAMETERS */, videoSRTPParameters, 5 /* AUDIO_SRTP_PARAMETERS */, audioSRTPParameters, 6 /* VIDEO_SSRC */, tlv.writeUInt32(videoSSRC), 7 /* AUDIO_SSRC */, tlv.writeUInt32(audioSSRC)).toString("base64");
827
+ var accessoryAddress = tlv.encode(1 /* AddressTypes.ADDRESS_VERSION */, addressVersion === "ipv4" ? 0 /* IPAddressVersion.IPV4 */ : 1 /* IPAddressVersion.IPV6 */, 2 /* AddressTypes.ADDRESS */, address, 3 /* AddressTypes.VIDEO_RTP_PORT */, tlv.writeUInt16(videoPort), 4 /* AddressTypes.AUDIO_RTP_PORT */, tlv.writeUInt16(audioPort));
828
+ var videoSRTPParameters = tlv.encode(1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */, videoCryptoSuite, 2 /* SRTPParametersTypes.MASTER_KEY */, videoSRTPKey, 3 /* SRTPParametersTypes.MASTER_SALT */, videoSRTPSalt);
829
+ var audioSRTPParameters = tlv.encode(1 /* SRTPParametersTypes.SRTP_CRYPTO_SUITE */, audioCryptoSuite, 2 /* SRTPParametersTypes.MASTER_KEY */, audioSRTPKey, 3 /* SRTPParametersTypes.MASTER_SALT */, audioSRTPSalt);
830
+ this.setupEndpointsResponse = tlv.encode(1 /* SetupEndpointsResponseTypes.SESSION_ID */, uuid.write(identifier), 2 /* SetupEndpointsResponseTypes.STATUS */, 0 /* SetupEndpointsStatus.SUCCESS */, 3 /* SetupEndpointsResponseTypes.ACCESSORY_ADDRESS */, accessoryAddress, 4 /* SetupEndpointsResponseTypes.VIDEO_SRTP_PARAMETERS */, videoSRTPParameters, 5 /* SetupEndpointsResponseTypes.AUDIO_SRTP_PARAMETERS */, audioSRTPParameters, 6 /* SetupEndpointsResponseTypes.VIDEO_SSRC */, tlv.writeUInt32(videoSSRC), 7 /* SetupEndpointsResponseTypes.AUDIO_SSRC */, tlv.writeUInt32(audioSSRC)).toString("base64");
792
831
  callback();
793
832
  };
794
833
  RTPStreamManagement.prototype._updateStreamStatus = function (status) {
795
834
  this.streamStatus = status;
796
- this.service.updateCharacteristic(Characteristic_1.Characteristic.StreamingStatus, tlv.encode(1 /* STATUS */, this.streamStatus).toString("base64"));
835
+ this.service.updateCharacteristic(Characteristic_1.Characteristic.StreamingStatus, tlv.encode(1 /* StreamingStatusTypes.STATUS */, this.streamStatus).toString("base64"));
797
836
  };
798
837
  RTPStreamManagement._supportedRTPConfiguration = function (supportedCryptoSuites) {
799
- if (supportedCryptoSuites.length === 1 && supportedCryptoSuites[0] === 2 /* NONE */) {
838
+ if (supportedCryptoSuites.length === 1 && supportedCryptoSuites[0] === 2 /* SRTPCryptoSuites.NONE */) {
800
839
  debug("Client claims it doesn't support SRTP. The stream may stops working with future iOS releases.");
801
840
  }
802
- return tlv.encode(2 /* SRTP_CRYPTO_SUITE */, supportedCryptoSuites).toString("base64");
841
+ return tlv.encode(2 /* SupportedRTPConfigurationTypes.SRTP_CRYPTO_SUITE */, supportedCryptoSuites).toString("base64");
803
842
  };
804
843
  RTPStreamManagement._supportedVideoStreamConfiguration = function (videoOptions) {
805
844
  if (!videoOptions.codec) {
@@ -808,14 +847,14 @@ var RTPStreamManagement = /** @class */ (function () {
808
847
  if (!videoOptions.resolutions) {
809
848
  throw new Error("Video resolutions cannot be undefined");
810
849
  }
811
- var codecParameters = tlv.encode(1 /* PROFILE_ID */, videoOptions.codec.profiles, 2 /* LEVEL */, videoOptions.codec.levels, 3 /* PACKETIZATION_MODE */, 0 /* NON_INTERLEAVED */);
850
+ var codecParameters = tlv.encode(1 /* VideoCodecParametersTypes.PROFILE_ID */, videoOptions.codec.profiles, 2 /* VideoCodecParametersTypes.LEVEL */, videoOptions.codec.levels, 3 /* VideoCodecParametersTypes.PACKETIZATION_MODE */, 0 /* VideoCodecPacketizationMode.NON_INTERLEAVED */);
812
851
  if (videoOptions.cvoId != null) {
813
852
  codecParameters = Buffer.concat([
814
853
  codecParameters,
815
- tlv.encode(4 /* CVO_ENABLED */, 1 /* SUPPORTED */, 5 /* CVO_ID */, videoOptions.cvoId),
854
+ tlv.encode(4 /* VideoCodecParametersTypes.CVO_ENABLED */, 1 /* VideoCodecCVO.SUPPORTED */, 5 /* VideoCodecParametersTypes.CVO_ID */, videoOptions.cvoId),
816
855
  ]);
817
856
  }
818
- var videoStreamConfiguration = tlv.encode(1 /* CODEC_TYPE */, 0 /* H264 */, 2 /* CODEC_PARAMETERS */, codecParameters, 3 /* ATTRIBUTES */, videoOptions.resolutions.map(function (resolution) {
857
+ var videoStreamConfiguration = tlv.encode(1 /* VideoCodecConfigurationTypes.CODEC_TYPE */, 0 /* VideoCodecType.H264 */, 2 /* VideoCodecConfigurationTypes.CODEC_PARAMETERS */, codecParameters, 3 /* VideoCodecConfigurationTypes.ATTRIBUTES */, videoOptions.resolutions.map(function (resolution) {
819
858
  if (resolution.length !== 3) {
820
859
  throw new Error("Unexpected video resolution");
821
860
  }
@@ -825,9 +864,9 @@ var RTPStreamManagement = /** @class */ (function () {
825
864
  width.writeUInt16LE(resolution[0], 0);
826
865
  height.writeUInt16LE(resolution[1], 0);
827
866
  frameRate.writeUInt8(resolution[2], 0);
828
- return tlv.encode(1 /* IMAGE_WIDTH */, width, 2 /* IMAGE_HEIGHT */, height, 3 /* FRAME_RATE */, frameRate);
867
+ return tlv.encode(1 /* VideoAttributesTypes.IMAGE_WIDTH */, width, 2 /* VideoAttributesTypes.IMAGE_HEIGHT */, height, 3 /* VideoAttributesTypes.FRAME_RATE */, frameRate);
829
868
  }));
830
- return tlv.encode(1 /* VIDEO_CODEC_CONFIGURATION */, videoStreamConfiguration).toString("base64");
869
+ return tlv.encode(1 /* SupportedVideoStreamConfigurationTypes.VIDEO_CODEC_CONFIGURATION */, videoStreamConfiguration).toString("base64");
831
870
  };
832
871
  RTPStreamManagement.prototype.checkForLegacyAudioCodecRepresentation = function (codecs) {
833
872
  var codecMap = {};
@@ -858,33 +897,33 @@ var RTPStreamManagement = /** @class */ (function () {
858
897
  debug("Client doesn't support any audio codec that HomeKit supports.");
859
898
  this.videoOnly = true;
860
899
  supportedCodecs.push({
861
- type: "OPUS" /* OPUS */,
862
- samplerate: [16 /* KHZ_16 */, 24 /* KHZ_24 */], // 16 and 24 must be supported
900
+ type: "OPUS" /* AudioStreamingCodecType.OPUS */,
901
+ samplerate: [16 /* AudioStreamingSamplerate.KHZ_16 */, 24 /* AudioStreamingSamplerate.KHZ_24 */], // 16 and 24 must be supported
863
902
  });
864
903
  }
865
904
  var codecConfigurations = supportedCodecs.map(function (codec) {
866
905
  var type;
867
906
  switch (codec.type) {
868
- case "OPUS" /* OPUS */:
869
- type = 3 /* OPUS */;
907
+ case "OPUS" /* AudioStreamingCodecType.OPUS */:
908
+ type = 3 /* AudioCodecTypes.OPUS */;
870
909
  break;
871
- case "AAC-eld" /* AAC_ELD */:
872
- type = 2 /* AAC_ELD */;
910
+ case "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */:
911
+ type = 2 /* AudioCodecTypes.AAC_ELD */;
873
912
  break;
874
- case "PCMA" /* PCMA */:
875
- type = 1 /* PCMA */;
913
+ case "PCMA" /* AudioStreamingCodecType.PCMA */:
914
+ type = 1 /* AudioCodecTypes.PCMA */;
876
915
  break;
877
- case "PCMU" /* PCMU */:
878
- type = 0 /* PCMU */;
916
+ case "PCMU" /* AudioStreamingCodecType.PCMU */:
917
+ type = 0 /* AudioCodecTypes.PCMU */;
879
918
  break;
880
- case "mSBC" /* MSBC */:
881
- type = 4 /* MSBC */;
919
+ case "mSBC" /* AudioStreamingCodecType.MSBC */:
920
+ type = 4 /* AudioCodecTypes.MSBC */;
882
921
  break;
883
- case "AMR" /* AMR */:
884
- type = 5 /* AMR */;
922
+ case "AMR" /* AudioStreamingCodecType.AMR */:
923
+ type = 5 /* AudioCodecTypes.AMR */;
885
924
  break;
886
- case "AMR-WB" /* AMR_WB */:
887
- type = 6 /* AMR_WB */;
925
+ case "AMR-WB" /* AudioStreamingCodecType.AMR_WB */:
926
+ type = 6 /* AudioCodecTypes.AMR_WB */;
888
927
  break;
889
928
  default:
890
929
  throw new Error("Unsupported codec: " + codec.type);
@@ -892,14 +931,14 @@ var RTPStreamManagement = /** @class */ (function () {
892
931
  var providedSamplerates = (typeof codec.samplerate === "number" ? [codec.samplerate] : codec.samplerate).map(function (rate) {
893
932
  var samplerate;
894
933
  switch (rate) {
895
- case 8 /* KHZ_8 */:
896
- samplerate = 0 /* KHZ_8 */;
934
+ case 8 /* AudioStreamingSamplerate.KHZ_8 */:
935
+ samplerate = 0 /* AudioSamplerate.KHZ_8 */;
897
936
  break;
898
- case 16 /* KHZ_16 */:
899
- samplerate = 1 /* KHZ_16 */;
937
+ case 16 /* AudioStreamingSamplerate.KHZ_16 */:
938
+ samplerate = 1 /* AudioSamplerate.KHZ_16 */;
900
939
  break;
901
- case 24 /* KHZ_24 */:
902
- samplerate = 2 /* KHZ_24 */;
940
+ case 24 /* AudioStreamingSamplerate.KHZ_24 */:
941
+ samplerate = 2 /* AudioSamplerate.KHZ_24 */;
903
942
  break;
904
943
  default:
905
944
  console.log("Unsupported sample rate: ", codec.samplerate);
@@ -910,17 +949,17 @@ var RTPStreamManagement = /** @class */ (function () {
910
949
  if (providedSamplerates.length === 0) {
911
950
  throw new Error("Audio samplerate cannot be empty!");
912
951
  }
913
- var audioParameters = tlv.encode(1 /* CHANNEL */, Math.max(1, codec.audioChannels || 1), 2 /* BIT_RATE */, codec.bitrate || 0 /* VARIABLE */, 3 /* SAMPLE_RATE */, providedSamplerates);
914
- return tlv.encode(1 /* CODEC_TYPE */, type, 2 /* CODEC_PARAMETERS */, audioParameters);
952
+ var audioParameters = tlv.encode(1 /* AudioCodecParametersTypes.CHANNEL */, Math.max(1, codec.audioChannels || 1), 2 /* AudioCodecParametersTypes.BIT_RATE */, codec.bitrate || 0 /* AudioBitrate.VARIABLE */, 3 /* AudioCodecParametersTypes.SAMPLE_RATE */, providedSamplerates);
953
+ return tlv.encode(1 /* AudioCodecConfigurationTypes.CODEC_TYPE */, type, 2 /* AudioCodecConfigurationTypes.CODEC_PARAMETERS */, audioParameters);
915
954
  });
916
- return tlv.encode(1 /* AUDIO_CODEC_CONFIGURATION */, codecConfigurations, 2 /* COMFORT_NOISE_SUPPORT */, comfortNoise ? 1 : 0).toString("base64");
955
+ return tlv.encode(1 /* SupportedAudioStreamConfigurationTypes.AUDIO_CODEC_CONFIGURATION */, codecConfigurations, 2 /* SupportedAudioStreamConfigurationTypes.COMFORT_NOISE_SUPPORT */, comfortNoise ? 1 : 0).toString("base64");
917
956
  };
918
957
  RTPStreamManagement.prototype.resetSetupEndpointsResponse = function () {
919
- this.setupEndpointsResponse = tlv.encode(2 /* STATUS */, 2 /* ERROR */).toString("base64");
958
+ this.setupEndpointsResponse = tlv.encode(2 /* SetupEndpointsResponseTypes.STATUS */, 2 /* SetupEndpointsStatus.ERROR */).toString("base64");
920
959
  this.service.updateCharacteristic(Characteristic_1.Characteristic.SetupEndpoints, this.setupEndpointsResponse);
921
960
  };
922
961
  RTPStreamManagement.prototype.resetSelectedStreamConfiguration = function () {
923
- this.selectedConfiguration = tlv.encode(1 /* SESSION_CONTROL */, tlv.encode(2 /* COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64");
962
+ this.selectedConfiguration = tlv.encode(1 /* SelectedRTPStreamConfigurationTypes.SESSION_CONTROL */, tlv.encode(2 /* SessionControlTypes.COMMAND */, SessionControlCommand.SUSPEND_SESSION)).toString("base64");
924
963
  this.service.updateCharacteristic(Characteristic_1.Characteristic.SelectedRTPStreamConfiguration, this.selectedConfiguration);
925
964
  };
926
965
  /**
@@ -967,13 +1006,14 @@ var RTPStreamManagement = /** @class */ (function () {
967
1006
  }());
968
1007
  exports.RTPStreamManagement = RTPStreamManagement;
969
1008
  /**
970
- * @deprecated - only there for backwards compatibility, please use {@see RTPStreamManagement} directly
1009
+ * @group Camera
1010
+ * @deprecated - only there for backwards compatibility, please use {@link RTPStreamManagement} directly
971
1011
  */
972
1012
  var StreamController = /** @class */ (function (_super) {
973
- (0, tslib_1.__extends)(StreamController, _super);
1013
+ tslib_1.__extends(StreamController, _super);
974
1014
  // noinspection JSDeprecatedSymbols
975
1015
  function StreamController(id, options, delegate, service) {
976
- var _this = _super.call(this, id, options, new index_1.LegacyCameraSourceAdapter(delegate), service) || this;
1016
+ var _this = _super.call(this, id, options, new Camera_1.LegacyCameraSourceAdapter(delegate), service) || this;
977
1017
  _this.options = options;
978
1018
  return _this;
979
1019
  }