decord/source/1700_SensorContainer.js

93 lines
2.7 KiB
JavaScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 1700
// Function ID: 1701
2026-07-20 16:05:17 +00:00
// Name: SensorContainer
2026-08-15 05:55:55 +00:00
// Dependencies: [41, 42, 1701]
2026-07-20 16:05:17 +00:00
2026-08-15 05:55:55 +00:00
// Module 1700 (SensorContainer)
2026-08-24 06:08:38 +00:00
import _createClassDefault from "_createClass" /* 42 */;
import closure_2 from "_classCallCheck" /* 41 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
const SensorContainer = importDefault;
class SensorContainer {
constructor() {
2026-08-24 06:08:38 +00:00
tmp = closure_2(this, SensorContainer);
2026-07-29 08:29:29 +00:00
map = new Map();
this.nativeSensors = map;
return;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const items = [
{
2026-07-20 16:05:17 +00:00
key: "getSensorId",
value: function getSensorId(arg0, iosReferenceFrame) {
const result = 100 * arg0;
const result1 = 10 * iosReferenceFrame.iosReferenceFrame;
return result + result1 + Number(iosReferenceFrame.adjustToInterfaceOrientation);
}
2026-07-29 08:29:29 +00:00
},
{
2026-07-20 16:05:17 +00:00
key: "initializeSensor",
value: function initializeSensor(arg0, iosReferenceFrame) {
const self = this;
const sensorId = this.getSensorId(arg0, iosReferenceFrame);
const nativeSensors = this.nativeSensors;
if (!nativeSensors.has(sensorId)) {
2026-08-15 05:55:55 +00:00
const tmp8 = new SensorContainer(1701)(arg0, iosReferenceFrame);
2026-07-20 16:05:17 +00:00
const nativeSensors2 = self.nativeSensors;
2026-07-29 08:29:29 +00:00
const result = nativeSensors2.set(sensorId, tmp8);
2026-07-20 16:05:17 +00:00
}
const nativeSensors3 = self.nativeSensors;
const value = nativeSensors3.get(sensorId);
return value.getSharedValue();
}
2026-07-29 08:29:29 +00:00
},
{
2026-07-20 16:05:17 +00:00
key: "registerSensor",
value: function registerSensor(arg0, iosReferenceFrame) {
const sensorId = this.getSensorId(arg0, iosReferenceFrame);
const nativeSensors = this.nativeSensors;
if (nativeSensors.has(sensorId)) {
const nativeSensors2 = this.nativeSensors;
const value = nativeSensors2.get(sensorId);
let num = -1;
if (value) {
num = -1;
if (value.isAvailable()) {
if (value.isRunning()) {
value.listenersNumber = value.listenersNumber + 1;
num = sensorId;
} else {
num = -1;
}
}
}
return num;
} else {
return -1;
}
}
2026-07-29 08:29:29 +00:00
},
{
2026-07-20 16:05:17 +00:00
key: "unregisterSensor",
value: function unregisterSensor(arg0) {
const nativeSensors = this.nativeSensors;
if (nativeSensors.has(arg0)) {
const nativeSensors2 = this.nativeSensors;
const value = nativeSensors2.get(arg0);
let isRunningResult = value;
if (value) {
isRunningResult = value.isRunning();
}
if (isRunningResult) {
value.listenersNumber = value.listenersNumber - 1;
if (0 === value.listenersNumber) {
value.unregister();
}
}
}
}
2026-07-29 08:29:29 +00:00
}
];
2026-08-24 06:08:38 +00:00
export const SensorContainer = _createClassDefault(SensorContainer, items);