@camera.ui/server 0.0.50-internal.0 → 0.0.50-internal.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/dist/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.BAIU_p3r.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.mdCorqzE.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.D0vsSsly.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.we5ZpWr2.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.9AEBJ3H1.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.CZcnEH0C.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.DE0LkcGu.0.0.50-internal.2.js} +2 -2
- package/dist/interface/js/Cammesh.CVvmkelB.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.CUr4pGoU.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.CaJhu4fF.0.0.50-internal.2.js} +2 -2
- package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.5VUmgryj.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.iYmUxAR5.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.DXPyE5mF.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.BqtlOFnV.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{FirstSteps.b-nvymgb.0.0.50-internal.0.js → FirstSteps.C_RI-SDQ.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.Ch_v02eN.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.BpXAYgSG.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/Recordings.CIKHJytH.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.BcLoGNEy.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.DMROW8kx.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/SettingsAppearance.CUaHpihp.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{SettingsAppearance.vue_vue_type_script_setup_true_lang.CBQ6lL3T.0.0.50-internal.0.js → SettingsAppearance.vue_vue_type_script_setup_true_lang.BuKZ-Uco.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.0QdwFSpv.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/SettingsRecordings.B-aj0U8_.0.0.50-internal.2.js +1 -0
- package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.Bi1YAJ76.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.CAx66Iir.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.CQcDtGy1.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{VersionsHandler.vue_vue_type_script_setup_true_lang.xDishkkS.0.0.50-internal.0.js → VersionsHandler.vue_vue_type_script_setup_true_lang.BhXMzIhV.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0sCXSu5.0.0.50-internal.2.js} +2 -2
- package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.DNqPWa0Q.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.DAXgG3bP.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{chart.js.CP_nMnnf.0.0.50-internal.0.js → chart.js.Bq3YocRX.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.9rxyNw0z.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.BuEvHAsS.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.DUdE08x8.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{engine.io-client.kITRnq-g.0.0.50-internal.0.js → engine.io-client.DWU6YI8o.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{fast-deep-equal.Bpc9mIsj.0.0.50-internal.0.js → fast-deep-equal.BpPyC6E4.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{highlight.js.BlSXU-Wb.0.0.50-internal.0.js → highlight.js.BoR2Rhdd.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BXzPONHs.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.DwcBYfWc.0.0.50-internal.2.js} +3 -3
- package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.BUDVOjPt.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CsG-OBoI.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CqEQao5R.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.D91sslRx.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.SdSTPzZO.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{react-dnd-touch-backend.BA4WhUJo.0.0.50-internal.0.js → react-dnd-touch-backend.BwroebQ4.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{refresh-rounded.D_SmhhUf.0.0.50-internal.0.js → refresh-rounded.DxM48YSv.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.Cmpbnzo4.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{socket.io-client.DKrRxgjP.0.0.50-internal.0.js → socket.io-client.DF2YgZo1.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{socket.io-parser.EXj3YDH2.0.0.50-internal.0.js → socket.io-parser.BUs2ineY.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.DmkT2LKx.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.dPzyZDVa.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.y2ZlFveS.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vee-validate.BeiObIH8.0.0.50-internal.0.js → vee-validate.Y-alCADW.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.sRVFTqDf.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue-i18n.BW2bx_6z.0.0.50-internal.0.js → vue-i18n.D5WrXOZa.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue-inline-svg.BJkQGmKz.0.0.50-internal.0.js → vue-inline-svg.R0uz_abA.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue-router.B2mOXHaC.0.0.50-internal.0.js → vue-router.65mnGy-o.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.B1Qop6Uu.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.CwmyAcir.0.0.50-internal.2.js} +1 -1
- package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.CMPALvRh.0.0.50-internal.2.js} +1 -1
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +1 -1
- package/dist/server/src/rpc/server.js +4 -1
- package/dist/server/src/rpc/server.js.map +1 -1
- package/package.json +1 -1
- package/.prettierignore +0 -12
- package/.prettierrc.json +0 -12
- package/artillery.yaml +0 -29
- package/bin/cameraui-server.ts +0 -11
- package/dist/interface/js/Cammesh.D-6dAROQ.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/Recordings.DhxjIW7e.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsAppearance.DsTjKXk1.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsRecordings.DgW7M0jj.0.0.50-internal.0.js +0 -1
- package/eslint.config.js +0 -103
- package/localdeps.txt +0 -10
- package/mypy.ini +0 -30
- package/requirements.txt +0 -15
- package/ruff.toml +0 -90
- package/src/__init__.py +0 -0
- package/src/_camera_ui_tools/__init__.py +0 -0
- package/src/_camera_ui_tools/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/api/controllers/api.controller.ts +0 -19
- package/src/api/controllers/auth.controller.ts +0 -294
- package/src/api/controllers/backup.controller.ts +0 -72
- package/src/api/controllers/cameras.controller.ts +0 -1029
- package/src/api/controllers/config.controller.ts +0 -102
- package/src/api/controllers/files.controller.ts +0 -35
- package/src/api/controllers/frameWorkers.controller.ts +0 -109
- package/src/api/controllers/plugins.controller.ts +0 -1206
- package/src/api/controllers/system.controller.ts +0 -273
- package/src/api/controllers/users.controller.ts +0 -648
- package/src/api/database/checks.ts +0 -268
- package/src/api/database/constants.ts +0 -8
- package/src/api/database/index.ts +0 -262
- package/src/api/database/migration.ts +0 -62
- package/src/api/database/selfcheck.ts +0 -492
- package/src/api/database/types.ts +0 -104
- package/src/api/go2rtc/api/application.ts +0 -48
- package/src/api/go2rtc/api/config.ts +0 -61
- package/src/api/go2rtc/api/discover.ts +0 -197
- package/src/api/go2rtc/api/index.ts +0 -49
- package/src/api/go2rtc/api/snapshot.ts +0 -44
- package/src/api/go2rtc/api/streams.ts +0 -168
- package/src/api/go2rtc/index.ts +0 -43
- package/src/api/go2rtc/queue.ts +0 -50
- package/src/api/go2rtc/types.ts +0 -174
- package/src/api/index.ts +0 -286
- package/src/api/middlewares/authPermission.middleware.ts +0 -46
- package/src/api/middlewares/authValidation.middleware.ts +0 -160
- package/src/api/middlewares/pagination.middleware.ts +0 -67
- package/src/api/middlewares/socketAuth.middleware.ts +0 -136
- package/src/api/plugins/header.plugin.ts +0 -15
- package/src/api/plugins/logger.plugin.ts +0 -44
- package/src/api/plugins/proxy.plugin.ts +0 -255
- package/src/api/plugins/socket.plugin.ts +0 -28
- package/src/api/plugins/system.plugin.ts +0 -48
- package/src/api/plugins/useragent.plugin.ts +0 -19
- package/src/api/routes/api.routes.ts +0 -10
- package/src/api/routes/auth.routes.ts +0 -56
- package/src/api/routes/backup.routes.ts +0 -28
- package/src/api/routes/cameras.routes.ts +0 -281
- package/src/api/routes/config.routes.ts +0 -66
- package/src/api/routes/files.routes.ts +0 -15
- package/src/api/routes/frameWorkers.routes.ts +0 -39
- package/src/api/routes/index.ts +0 -37
- package/src/api/routes/plugins.routes.ts +0 -420
- package/src/api/routes/system.routes.ts +0 -101
- package/src/api/routes/users.routes.ts +0 -167
- package/src/api/schemas/backup.schema.ts +0 -112
- package/src/api/schemas/cameras.schema.ts +0 -479
- package/src/api/schemas/config.schema.ts +0 -38
- package/src/api/schemas/go2rtc.schema.ts +0 -189
- package/src/api/schemas/plugins.schema.ts +0 -126
- package/src/api/schemas/storage.schema.ts +0 -11
- package/src/api/schemas/system.schema.ts +0 -45
- package/src/api/schemas/users.schema.ts +0 -185
- package/src/api/services/auth.service.ts +0 -210
- package/src/api/services/backup.service.ts +0 -144
- package/src/api/services/cameras.service.ts +0 -671
- package/src/api/services/plugins.service.ts +0 -470
- package/src/api/services/system.service.ts +0 -85
- package/src/api/services/users.service.ts +0 -276
- package/src/api/types/index.ts +0 -675
- package/src/api/utils/cert.ts +0 -254
- package/src/api/utils/constants.ts +0 -17
- package/src/api/utils/fetch.ts +0 -21
- package/src/api/utils/moveFiles.ts +0 -45
- package/src/api/utils/parse.ts +0 -17
- package/src/api/websocket/index.ts +0 -110
- package/src/api/websocket/nsp/logs.ts +0 -240
- package/src/api/websocket/nsp/main.ts +0 -27
- package/src/api/websocket/nsp/metrics.ts +0 -301
- package/src/api/websocket/nsp/notifications.ts +0 -43
- package/src/api/websocket/nsp/plugins.ts +0 -37
- package/src/api/websocket/nsp/server.ts +0 -220
- package/src/api/websocket/nsp/status.ts +0 -77
- package/src/api/websocket/types.ts +0 -55
- package/src/api.ts +0 -163
- package/src/camera/classes.ts +0 -32
- package/src/camera/controller.ts +0 -579
- package/src/camera/device.ts +0 -422
- package/src/camera/frameWorker.ts +0 -403
- package/src/camera/index.ts +0 -679
- package/src/camera/interfaces.ts +0 -95
- package/src/camera/iou.ts +0 -153
- package/src/camera/polygon.ts +0 -226
- package/src/camera/python/__init__.py +0 -0
- package/src/camera/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/classes.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/delegate_controller.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/interfaces.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou2.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/polygon.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/video_frame.cpython-311.pyc +0 -0
- package/src/camera/python/classes.py +0 -41
- package/src/camera/python/interfaces.py +0 -130
- package/src/camera/python/iou.py +0 -158
- package/src/camera/python/polygon.py +0 -230
- package/src/camera/python/test/__pycache__/polygon.cpython-310.pyc +0 -0
- package/src/camera/python/test/iou_test.py +0 -799
- package/src/camera/python/test/polygon.py +0 -238
- package/src/camera/python/test/polygon_test.py +0 -256
- package/src/camera/python/test/polygon_test2.py +0 -484
- package/src/camera/python/typings.py +0 -50
- package/src/camera/python/video_frame.py +0 -143
- package/src/camera/session.ts +0 -192
- package/src/camera/streaming/fmp4-session.ts +0 -390
- package/src/camera/streaming/peer-connection.ts +0 -273
- package/src/camera/streaming/rtsp-session.ts +0 -331
- package/src/camera/streaming/webrtc-connection.ts +0 -260
- package/src/camera/streaming/werift-session.ts +0 -317
- package/src/camera/test/iou_test.ts +0 -761
- package/src/camera/test/polygon.test.ts +0 -611
- package/src/camera/test/polygon_test.ts +0 -210
- package/src/camera/types.ts +0 -48
- package/src/camera/utils.ts +0 -489
- package/src/camera/videoFrame.ts +0 -123
- package/src/cloud/index.ts +0 -61
- package/src/cloud/remote/cloudflare.ts +0 -18
- package/src/cloud/remote/upnp.ts +0 -18
- package/src/cloud/remote/utils.ts +0 -24
- package/src/cloud/types.ts +0 -16
- package/src/decoder/child.ts +0 -883
- package/src/decoder/imageUtils.ts +0 -275
- package/src/decoder/manager.ts +0 -251
- package/src/decoder/python/__init__.py +0 -0
- package/src/decoder/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/image_utils.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/utils.cpython-311.pyc +0 -0
- package/src/decoder/python/child.py +0 -903
- package/src/decoder/python/image_utils.py +0 -196
- package/src/decoder/python/pool.py +0 -45
- package/src/decoder/python/test/group.py +0 -62
- package/src/decoder/python/test/motion.mp4 +0 -0
- package/src/decoder/python/test/motion2.mp4 +0 -0
- package/src/decoder/python/test/opencl.cl +0 -70
- package/src/decoder/python/test/opencl2.cl +0 -130
- package/src/decoder/python/test/test.py +0 -427
- package/src/decoder/python/test/test1.jpg +0 -0
- package/src/decoder/python/test/test1_resized.jpg +0 -0
- package/src/decoder/python/test/test2.jpg +0 -0
- package/src/decoder/python/test/test2.py +0 -451
- package/src/decoder/python/test/test2_resized.jpg +0 -0
- package/src/decoder/python/test/test3.jpg +0 -0
- package/src/decoder/python/test/utils.py +0 -50
- package/src/decoder/python/typings.py +0 -57
- package/src/decoder/python/utils.py +0 -70
- package/src/decoder/test/child.ts +0 -117
- package/src/decoder/test/ffmpeg.ts +0 -371
- package/src/decoder/test/test.ts +0 -182
- package/src/decoder/types.ts +0 -27
- package/src/decoder/utils.ts +0 -64
- package/src/decoder/wasm/asconfig.json +0 -28
- package/src/decoder/wasm/assembly/console.ts +0 -1
- package/src/decoder/wasm/assembly/index.ts +0 -890
- package/src/decoder/wasm/build/decoder.d.ts +0 -43
- package/src/decoder/wasm/build/decoder.js +0 -108
- package/src/decoder/wasm/build/decoder.wasm +0 -0
- package/src/decoder/wasm/tsconfig.json +0 -5
- package/src/decoder/worker.ts +0 -113
- package/src/go2rtc/index.ts +0 -324
- package/src/go2rtc/types.ts +0 -88
- package/src/main.ts +0 -267
- package/src/manager/coreManager.ts +0 -78
- package/src/manager/deviceManager.ts +0 -132
- package/src/manager/types.ts +0 -17
- package/src/plugins/index.ts +0 -443
- package/src/plugins/plugin.ts +0 -177
- package/src/plugins/runtime/base.ts +0 -282
- package/src/plugins/runtime/index.ts +0 -15
- package/src/plugins/runtime/node/child.ts +0 -193
- package/src/plugins/runtime/node/index.ts +0 -67
- package/src/plugins/runtime/node/plugin.ts +0 -122
- package/src/plugins/runtime/node/pluginApi.ts +0 -27
- package/src/plugins/runtime/node/proxy/cameraDevice.ts +0 -299
- package/src/plugins/runtime/node/proxy/coreManager.ts +0 -128
- package/src/plugins/runtime/node/proxy/deviceManager.ts +0 -187
- package/src/plugins/runtime/node/storage.ts +0 -312
- package/src/plugins/runtime/node/storageController.ts +0 -91
- package/src/plugins/runtime/python/__init__.py +0 -0
- package/src/plugins/runtime/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/camera_storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/config_service.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/ipc.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/namespaces.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_api.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/proxy_utils.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/schema.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage_controller.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/child.py +0 -248
- package/src/plugins/runtime/python/index.ts +0 -73
- package/src/plugins/runtime/python/namespaces.py +0 -101
- package/src/plugins/runtime/python/plugin.py +0 -155
- package/src/plugins/runtime/python/plugin_api.py +0 -29
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/core_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/camera_device.py +0 -1732
- package/src/plugins/runtime/python/proxy/core_manager.py +0 -126
- package/src/plugins/runtime/python/proxy/device_manager.py +0 -197
- package/src/plugins/runtime/python/schema.py +0 -99
- package/src/plugins/runtime/python/storage.py +0 -353
- package/src/plugins/runtime/python/storage_controller.py +0 -102
- package/src/plugins/runtime/python/typings.py +0 -195
- package/src/plugins/schema.ts +0 -472
- package/src/plugins/types.ts +0 -60
- package/src/plugins/worker.ts +0 -250
- package/src/rpc/index.ts +0 -149
- package/src/rpc/namespaces.ts +0 -79
- package/src/rpc/server.ts +0 -422
- package/src/rpc/types.ts +0 -119
- package/src/rpc/utils.ts +0 -16
- package/src/services/config/constants.ts +0 -47
- package/src/services/config/defaults.ts +0 -57
- package/src/services/config/index.ts +0 -744
- package/src/services/config/types.ts +0 -211
- package/src/services/logger/index.ts +0 -96
- package/src/types.ts +0 -47
- package/src/utils/path.ts +0 -16
- package/src/utils/pythonInstaller.ts +0 -597
- package/tsconfig.json +0 -37
- package/types/fastify.d.ts +0 -14
- package/updates.config.js +0 -3
- /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.50-internal.0.css → @xterm.DYP7pi_n.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.2.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.2.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.2.png} +0 -0
- /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.2.css} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.C-5Lxnx_.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.50-internal.0.js → engine.io-parser.BiEtp6m2.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.50-internal.0.js → ev-emitter.X5f1qa-c.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{get-size.D1dS-IaP.0.0.50-internal.0.js → get-size.D1dS-IaP.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.0.js → react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
- /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.2.js} +0 -0
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { instantiate } from '@assemblyscript/loader';
|
|
2
|
-
import { getAddon } from '@camera.ui/rust-decoder';
|
|
3
|
-
import { readFileSync } from 'node:fs';
|
|
4
|
-
import { dirname, resolve } from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
|
|
7
|
-
import type { ASUtil } from '@assemblyscript/loader';
|
|
8
|
-
import type { Logger } from '@camera.ui/common/logger';
|
|
9
|
-
import type { GpuImageProcessorInstance } from '@camera.ui/rust-decoder';
|
|
10
|
-
import type { CameraFrameWorkerDecoder, DecoderFormat, ImageOptions, ImageOutputFormat } from '@camera.ui/types';
|
|
11
|
-
import type { instantiate as instantiateWasm } from './wasm/build/decoder.js';
|
|
12
|
-
|
|
13
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
-
const __dirname = dirname(__filename);
|
|
15
|
-
|
|
16
|
-
export type WASMModule = ASUtil & Record<string, unknown> & Awaited<ReturnType<typeof instantiateWasm>>;
|
|
17
|
-
|
|
18
|
-
enum WASMImageFormat {
|
|
19
|
-
NONE = 0,
|
|
20
|
-
GRAY = 1,
|
|
21
|
-
RGB = 2,
|
|
22
|
-
RGBA = 3,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
enum WASMInputFormat {
|
|
26
|
-
YUV = 1,
|
|
27
|
-
RGB = 2,
|
|
28
|
-
RGBA = 3,
|
|
29
|
-
GRAY = 4,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
enum RUSTInputFormat {
|
|
33
|
-
GRAY = 1,
|
|
34
|
-
RGB = 3,
|
|
35
|
-
RGBA = 4,
|
|
36
|
-
NV12 = 12,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class ImageUtils {
|
|
40
|
-
public decoder: CameraFrameWorkerDecoder;
|
|
41
|
-
|
|
42
|
-
private logger: Logger;
|
|
43
|
-
private initiated = false;
|
|
44
|
-
|
|
45
|
-
private wasmExports?: WASMModule;
|
|
46
|
-
private rustAddon = getAddon();
|
|
47
|
-
private gpuImageProcessor?: GpuImageProcessorInstance;
|
|
48
|
-
|
|
49
|
-
constructor(decoder: CameraFrameWorkerDecoder, logger: Logger) {
|
|
50
|
-
this.decoder = decoder;
|
|
51
|
-
this.logger = logger;
|
|
52
|
-
|
|
53
|
-
const gpuBackends = this.rustAddon?.getGpuBackends() ?? [];
|
|
54
|
-
if (this.decoder === 'rust' || this.decoder === 'gpu') {
|
|
55
|
-
if (!this.rustAddon) {
|
|
56
|
-
this.logger.warn('Rust decoder not available, falling back to WASM');
|
|
57
|
-
this.decoder = 'wasm';
|
|
58
|
-
} else if (this.decoder === 'gpu' && gpuBackends.length === 0) {
|
|
59
|
-
this.logger.warn('No GPU backends available, falling back to Rust');
|
|
60
|
-
this.decoder = 'rust';
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public async initiate(): Promise<void> {
|
|
66
|
-
if (this.initiated) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
this.initiated = true;
|
|
71
|
-
|
|
72
|
-
if (this.decoder === 'gpu') {
|
|
73
|
-
const backends = this.rustAddon!.getGpuBackends();
|
|
74
|
-
this.logger.log('Available GPU backends:', backends.join(', '));
|
|
75
|
-
this.gpuImageProcessor = new this.rustAddon!.GpuImageProcessor();
|
|
76
|
-
await this.gpuImageProcessor.initialize('auto');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (this.decoder === 'wasm') {
|
|
80
|
-
const wasmModule = await instantiate(readFileSync(resolve(__dirname, './wasm/build/decoder.wasm')), {
|
|
81
|
-
console: {
|
|
82
|
-
log: (messagePtr: number) => {
|
|
83
|
-
this.logger.debug(this.wasmExports!.__getString(messagePtr));
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
env: {
|
|
87
|
-
abort: (msgPtr: number, filePtr: number, line: number, column: number) => {
|
|
88
|
-
const msg = this.wasmExports!.__getString(msgPtr);
|
|
89
|
-
const file = this.wasmExports!.__getString(filePtr);
|
|
90
|
-
this.logger.error(`Abort called at ${file}:${line}:${column}`, msg);
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
this.wasmExports = wasmModule.exports as WASMModule;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
public processImage(
|
|
100
|
-
imageData: Buffer | Uint8Array,
|
|
101
|
-
inputWidth: number,
|
|
102
|
-
inputHeight: number,
|
|
103
|
-
inputFormat: DecoderFormat | 'rgba' | 'gray',
|
|
104
|
-
options: ImageOptions,
|
|
105
|
-
): Promise<Uint8Array> {
|
|
106
|
-
if (!this.initiated) {
|
|
107
|
-
throw new Error('ImageUtils not initiated');
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (this.decoder === 'wasm') {
|
|
111
|
-
return this.processImageWASM(imageData, inputWidth, inputHeight, inputFormat, options);
|
|
112
|
-
} else if (this.decoder === 'gpu' && this.gpuImageProcessor?.initialized) {
|
|
113
|
-
return this.processImageGpu(imageData, inputWidth, inputHeight, inputFormat, options);
|
|
114
|
-
} else {
|
|
115
|
-
return this.processImageRust(imageData, inputWidth, inputHeight, inputFormat, options);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
private async processImageRust(
|
|
120
|
-
imageData: Buffer | Uint8Array,
|
|
121
|
-
inputWidth: number,
|
|
122
|
-
inputHeight: number,
|
|
123
|
-
inputFormat: DecoderFormat | 'rgba' | 'gray',
|
|
124
|
-
options: ImageOptions,
|
|
125
|
-
): Promise<Uint8Array> {
|
|
126
|
-
if (!this.rustAddon) {
|
|
127
|
-
throw new Error('Rust addon not available');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const channels = options.format?.to === 'gray' ? 1 : options.format?.to === 'rgba' ? 4 : 3;
|
|
131
|
-
|
|
132
|
-
const cropTop = options.crop && options.crop.top > 0 ? options.crop.top : 0;
|
|
133
|
-
const cropLeft = options.crop && options.crop.left > 0 ? options.crop.left : 0;
|
|
134
|
-
const cropWidth = options.crop && options.crop.width > 0 ? options.crop.width : 0;
|
|
135
|
-
const cropHeight = options.crop && options.crop.height > 0 ? options.crop.height : 0;
|
|
136
|
-
|
|
137
|
-
const resizeWidth = options.resize && options.resize.width > 0 ? options.resize.width : 0;
|
|
138
|
-
const resizeHeight = options.resize && options.resize.height > 0 ? options.resize.height : 0;
|
|
139
|
-
|
|
140
|
-
const blurRadius = 0; // not used
|
|
141
|
-
|
|
142
|
-
return this.rustAddon.processImage(imageData, inputWidth, inputHeight, channels, cropTop, cropLeft, cropWidth, cropHeight, resizeWidth, resizeHeight, blurRadius);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
private async processImageGpu(
|
|
146
|
-
imageData: Buffer | Uint8Array,
|
|
147
|
-
inputWidth: number,
|
|
148
|
-
inputHeight: number,
|
|
149
|
-
inputFormat: DecoderFormat | 'rgba' | 'gray',
|
|
150
|
-
options: ImageOptions,
|
|
151
|
-
): Promise<Uint8Array> {
|
|
152
|
-
if (!this.rustAddon) {
|
|
153
|
-
throw new Error('Rust addon not available');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (!this.gpuImageProcessor?.initialized) {
|
|
157
|
-
throw new Error('GPU Image Processor not initialized');
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
const frame = Buffer.isBuffer(imageData) ? imageData : Buffer.from(imageData);
|
|
161
|
-
|
|
162
|
-
return this.gpuImageProcessor.processImage(frame, {
|
|
163
|
-
inputWidth,
|
|
164
|
-
inputHeight,
|
|
165
|
-
inputFormat: this.mapRustInputFormat(inputFormat),
|
|
166
|
-
cropTop: options.crop?.top,
|
|
167
|
-
cropLeft: options.crop?.left,
|
|
168
|
-
cropWidth: options.crop?.width,
|
|
169
|
-
cropHeight: options.crop?.height,
|
|
170
|
-
resizeWidth: options.resize?.width,
|
|
171
|
-
resizeHeight: options.resize?.height,
|
|
172
|
-
outputFormat: options.format?.to === 'gray' ? 1 : options.format?.to === 'rgba' ? 4 : 3,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
private async processImageWASM(
|
|
177
|
-
imageData: Buffer | Uint8Array,
|
|
178
|
-
inputWidth: number,
|
|
179
|
-
inputHeight: number,
|
|
180
|
-
inputFormat: DecoderFormat | 'rgba' | 'gray',
|
|
181
|
-
options: ImageOptions,
|
|
182
|
-
): Promise<Uint8Array> {
|
|
183
|
-
if (!this.wasmExports) {
|
|
184
|
-
throw new Error('WASM module not initialized');
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
188
|
-
const { processImage, __newArray, __getUint8Array, __pin, __unpin, __collect, Uint8Array_ID } = this.wasmExports;
|
|
189
|
-
|
|
190
|
-
const inputPtr = __pin(__newArray(Uint8Array_ID.value, imageData));
|
|
191
|
-
|
|
192
|
-
const inputFormatEnum = this.mapWASMInputFormat(inputFormat);
|
|
193
|
-
const formatEnum = options.format ? this.mapImageFormat(options.format.to) : WASMImageFormat.NONE;
|
|
194
|
-
|
|
195
|
-
const cropTop = options.crop && options.crop.top > 0 ? options.crop.top : 0;
|
|
196
|
-
const cropLeft = options.crop && options.crop.left > 0 ? options.crop.left : 0;
|
|
197
|
-
const cropWidth = options.crop && options.crop.width > 0 ? options.crop.width : 0;
|
|
198
|
-
const cropHeight = options.crop && options.crop.height > 0 ? options.crop.height : 0;
|
|
199
|
-
|
|
200
|
-
const resizeWidth = options.resize && options.resize.width > 0 ? options.resize.width : 0;
|
|
201
|
-
const resizeHeight = options.resize && options.resize.height > 0 ? options.resize.height : 0;
|
|
202
|
-
|
|
203
|
-
const reconvertRGBToYUV = 0;
|
|
204
|
-
const blurRadius = 0; // not used
|
|
205
|
-
|
|
206
|
-
const outputPtr = processImage(
|
|
207
|
-
inputPtr as any,
|
|
208
|
-
inputWidth,
|
|
209
|
-
inputHeight,
|
|
210
|
-
formatEnum,
|
|
211
|
-
cropTop,
|
|
212
|
-
cropLeft,
|
|
213
|
-
cropWidth,
|
|
214
|
-
cropHeight,
|
|
215
|
-
resizeWidth,
|
|
216
|
-
resizeHeight,
|
|
217
|
-
blurRadius,
|
|
218
|
-
inputFormatEnum,
|
|
219
|
-
reconvertRGBToYUV,
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
// Retrieve the processed image data
|
|
223
|
-
const processedImage = __getUint8Array(outputPtr as any).slice();
|
|
224
|
-
|
|
225
|
-
// Clean up WASM memory
|
|
226
|
-
__unpin(inputPtr);
|
|
227
|
-
__collect();
|
|
228
|
-
|
|
229
|
-
return processedImage;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
private mapWASMInputFormat(inputFormat: DecoderFormat | 'rgba' | 'gray'): WASMInputFormat {
|
|
233
|
-
switch (inputFormat) {
|
|
234
|
-
case 'yuv420p':
|
|
235
|
-
case 'nv12':
|
|
236
|
-
return WASMInputFormat.YUV;
|
|
237
|
-
case 'rgb24':
|
|
238
|
-
return WASMInputFormat.RGB;
|
|
239
|
-
case 'rgba':
|
|
240
|
-
return WASMInputFormat.RGBA;
|
|
241
|
-
case 'gray':
|
|
242
|
-
return WASMInputFormat.GRAY;
|
|
243
|
-
default:
|
|
244
|
-
return WASMInputFormat.GRAY;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
private mapRustInputFormat(inputFormat: DecoderFormat | 'rgba' | 'gray'): RUSTInputFormat {
|
|
249
|
-
switch (inputFormat) {
|
|
250
|
-
case 'gray':
|
|
251
|
-
return RUSTInputFormat.GRAY;
|
|
252
|
-
case 'rgb24':
|
|
253
|
-
return RUSTInputFormat.RGB;
|
|
254
|
-
case 'rgba':
|
|
255
|
-
return RUSTInputFormat.RGBA;
|
|
256
|
-
case 'nv12':
|
|
257
|
-
return RUSTInputFormat.NV12;
|
|
258
|
-
default:
|
|
259
|
-
return RUSTInputFormat.GRAY;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
private mapImageFormat(format: ImageOutputFormat): WASMImageFormat {
|
|
264
|
-
switch (format) {
|
|
265
|
-
case 'gray':
|
|
266
|
-
return WASMImageFormat.GRAY;
|
|
267
|
-
case 'rgb':
|
|
268
|
-
return WASMImageFormat.RGB;
|
|
269
|
-
case 'rgba':
|
|
270
|
-
return WASMImageFormat.RGBA;
|
|
271
|
-
default:
|
|
272
|
-
return WASMImageFormat.NONE;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
package/src/decoder/manager.ts
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import { dirname, resolve } from 'node:path';
|
|
2
|
-
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import { Worker } from 'node:worker_threads';
|
|
4
|
-
|
|
5
|
-
import type { Logger } from '@camera.ui/common';
|
|
6
|
-
import type { CameraFrameWorkerDecoder, DecoderFormat, ImageOptions } from '@camera.ui/types';
|
|
7
|
-
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
-
const __dirname = dirname(__filename);
|
|
10
|
-
|
|
11
|
-
export class ImageProcessorManager {
|
|
12
|
-
private worker: Worker | null = null;
|
|
13
|
-
private logger: Logger;
|
|
14
|
-
private isInitialized = false;
|
|
15
|
-
private isInitializing = false;
|
|
16
|
-
private pendingRequests = new Map<number, { resolve: (result: Uint8Array) => void; reject: (error: Error) => void }>();
|
|
17
|
-
private nextRequestId = 0;
|
|
18
|
-
private decoder: CameraFrameWorkerDecoder;
|
|
19
|
-
|
|
20
|
-
constructor(decoder: CameraFrameWorkerDecoder, logger: Logger) {
|
|
21
|
-
this.decoder = decoder;
|
|
22
|
-
this.logger = logger;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public async initialize(): Promise<void> {
|
|
26
|
-
if (this.isInitialized) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (this.isInitializing) {
|
|
31
|
-
return this.waitForInitialization();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.isInitializing = true;
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
await this.startWorker();
|
|
38
|
-
this.isInitialized = true;
|
|
39
|
-
this.isInitializing = false;
|
|
40
|
-
this.logger.trace('Image processor worker initialized');
|
|
41
|
-
} catch (error) {
|
|
42
|
-
this.isInitializing = false;
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public async processImage(
|
|
48
|
-
imageData: Buffer | Uint8Array,
|
|
49
|
-
inputWidth: number,
|
|
50
|
-
inputHeight: number,
|
|
51
|
-
inputFormat: DecoderFormat | 'rgba' | 'gray',
|
|
52
|
-
options: ImageOptions,
|
|
53
|
-
): Promise<Uint8Array> {
|
|
54
|
-
if (!this.isInitialized) {
|
|
55
|
-
await this.initialize();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (!this.worker) {
|
|
59
|
-
throw new Error('Worker not initialized');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const requestId = this.nextRequestId++;
|
|
63
|
-
|
|
64
|
-
return new Promise<Uint8Array>((resolve, reject) => {
|
|
65
|
-
this.pendingRequests.set(requestId, { resolve, reject });
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
// Convert Buffer to Uint8Array for transferring
|
|
69
|
-
// const data = Buffer.isBuffer(imageData) ? new Uint8Array(imageData.buffer, imageData.byteOffset, imageData.byteLength) : imageData;
|
|
70
|
-
|
|
71
|
-
let dataToSend;
|
|
72
|
-
if (Buffer.isBuffer(imageData)) {
|
|
73
|
-
// Eine Kopie des Puffers erstellen, damit der ursprüngliche intakt bleibt
|
|
74
|
-
dataToSend = new Uint8Array(imageData.buffer.slice(0), imageData.byteOffset, imageData.byteLength);
|
|
75
|
-
} else {
|
|
76
|
-
// Auch für Uint8Array eine Kopie erstellen
|
|
77
|
-
dataToSend = new Uint8Array(imageData.buffer.slice(0));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Send the processing request to the worker
|
|
81
|
-
this.worker!.postMessage(
|
|
82
|
-
{
|
|
83
|
-
type: 'process',
|
|
84
|
-
id: requestId,
|
|
85
|
-
imageData: dataToSend,
|
|
86
|
-
inputWidth,
|
|
87
|
-
inputHeight,
|
|
88
|
-
inputFormat,
|
|
89
|
-
options,
|
|
90
|
-
},
|
|
91
|
-
[dataToSend.buffer],
|
|
92
|
-
);
|
|
93
|
-
} catch (error) {
|
|
94
|
-
this.pendingRequests.delete(requestId);
|
|
95
|
-
reject(error instanceof Error ? error : new Error(String(error)));
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public shutdown(): void {
|
|
101
|
-
if (this.worker) {
|
|
102
|
-
// Reject all pending requests
|
|
103
|
-
for (const [, { reject }] of this.pendingRequests) {
|
|
104
|
-
reject(new Error('Worker was terminated'));
|
|
105
|
-
}
|
|
106
|
-
this.pendingRequests.clear();
|
|
107
|
-
|
|
108
|
-
this.worker.terminate();
|
|
109
|
-
this.worker = null;
|
|
110
|
-
this.isInitialized = false;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private async startWorker(): Promise<void> {
|
|
115
|
-
return new Promise<void>((_resolve, _reject) => {
|
|
116
|
-
try {
|
|
117
|
-
const workerPath = resolve(__dirname, './worker.js');
|
|
118
|
-
this.worker = new Worker(workerPath, {
|
|
119
|
-
workerData: { decoder: this.decoder },
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// Setup message handler
|
|
123
|
-
this.worker.on('message', (message) => {
|
|
124
|
-
if (message.type === 'log') {
|
|
125
|
-
this.handleLogMessage(message);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (message.type === 'initialized') {
|
|
130
|
-
_resolve();
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (message.type === 'error' && message.id === undefined) {
|
|
135
|
-
_reject(new Error(message.error));
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (message.type === 'result' || message.type === 'error') {
|
|
140
|
-
this.handleProcessResult(message);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
this.logger.warn('Unknown message from worker:', message);
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// Setup error handler
|
|
148
|
-
this.worker.on('error', (error) => {
|
|
149
|
-
this.logger.error('Worker error:', error);
|
|
150
|
-
|
|
151
|
-
// Reject all pending requests
|
|
152
|
-
for (const [, { reject }] of this.pendingRequests) {
|
|
153
|
-
reject(error);
|
|
154
|
-
}
|
|
155
|
-
this.pendingRequests.clear();
|
|
156
|
-
|
|
157
|
-
this.isInitialized = false;
|
|
158
|
-
this.worker = null;
|
|
159
|
-
|
|
160
|
-
_reject(error);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
// Handle worker exit
|
|
164
|
-
this.worker.on('exit', (code) => {
|
|
165
|
-
if (code !== 0) {
|
|
166
|
-
this.logger.error(`Worker stopped with exit code ${code}`);
|
|
167
|
-
|
|
168
|
-
// Reject all pending requests if not already handled
|
|
169
|
-
for (const [, { reject }] of this.pendingRequests) {
|
|
170
|
-
reject(new Error(`Worker stopped with exit code ${code}`));
|
|
171
|
-
}
|
|
172
|
-
this.pendingRequests.clear();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
this.isInitialized = false;
|
|
176
|
-
this.worker = null;
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
// Send initialization message
|
|
180
|
-
this.worker.postMessage({ type: 'init', decoder: this.decoder });
|
|
181
|
-
} catch (error) {
|
|
182
|
-
this.logger.error('Failed to start worker:', error);
|
|
183
|
-
_reject(error);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
private handleProcessResult(message: any): void {
|
|
189
|
-
const { id, type, data, error } = message;
|
|
190
|
-
const request = this.pendingRequests.get(id);
|
|
191
|
-
|
|
192
|
-
if (!request) {
|
|
193
|
-
this.logger.warn(`Received result for unknown request ${id}`);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
this.pendingRequests.delete(id);
|
|
198
|
-
|
|
199
|
-
if (type === 'result') {
|
|
200
|
-
request.resolve(data);
|
|
201
|
-
} else if (type === 'error') {
|
|
202
|
-
request.reject(new Error(error));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
private handleLogMessage(message: any): void {
|
|
207
|
-
const { level, message: logMessage } = message;
|
|
208
|
-
|
|
209
|
-
switch (level) {
|
|
210
|
-
case 'info':
|
|
211
|
-
this.logger.log(logMessage);
|
|
212
|
-
break;
|
|
213
|
-
case 'debug':
|
|
214
|
-
this.logger.debug(logMessage);
|
|
215
|
-
break;
|
|
216
|
-
case 'error':
|
|
217
|
-
this.logger.error(logMessage);
|
|
218
|
-
break;
|
|
219
|
-
case 'warn':
|
|
220
|
-
this.logger.warn(logMessage);
|
|
221
|
-
break;
|
|
222
|
-
case 'trace':
|
|
223
|
-
this.logger.trace?.(logMessage);
|
|
224
|
-
break;
|
|
225
|
-
default:
|
|
226
|
-
this.logger.log(logMessage);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
private async waitForInitialization(): Promise<void> {
|
|
231
|
-
return new Promise<void>((resolve, reject) => {
|
|
232
|
-
const checkInterval = setInterval(() => {
|
|
233
|
-
if (this.isInitialized) {
|
|
234
|
-
clearInterval(checkInterval);
|
|
235
|
-
resolve();
|
|
236
|
-
} else if (!this.isInitializing) {
|
|
237
|
-
clearInterval(checkInterval);
|
|
238
|
-
reject(new Error('Initialization failed'));
|
|
239
|
-
}
|
|
240
|
-
}, 100);
|
|
241
|
-
|
|
242
|
-
// Timeout after 30 seconds
|
|
243
|
-
setTimeout(() => {
|
|
244
|
-
if (!this.isInitialized) {
|
|
245
|
-
clearInterval(checkInterval);
|
|
246
|
-
reject(new Error('Initialization timed out'));
|
|
247
|
-
}
|
|
248
|
-
}, 30000);
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
}
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|