@viji-dev/core 0.3.0 → 0.3.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/index.d.ts CHANGED
@@ -740,6 +740,8 @@ declare interface DeviceState extends DeviceSensorState {
740
740
  id: string;
741
741
  /** User-friendly device name */
742
742
  name: string;
743
+ /** Device camera video (null if not available) */
744
+ video: VideoAPI | null;
743
745
  }
744
746
 
745
747
  export declare interface FaceData {
@@ -1253,7 +1255,7 @@ export declare const VERSION = "0.2.20";
1253
1255
 
1254
1256
  export declare interface VideoAPI {
1255
1257
  isConnected: boolean;
1256
- currentFrame: OffscreenCanvas | null;
1258
+ currentFrame: OffscreenCanvas | ImageBitmap | null;
1257
1259
  frameWidth: number;
1258
1260
  frameHeight: number;
1259
1261
  frameRate: number;
@@ -1273,6 +1275,14 @@ export declare interface VideoAPI {
1273
1275
  };
1274
1276
  }
1275
1277
 
1278
+ /**
1279
+ * Video stream categorization type
1280
+ * - main: Primary video with CV processing (viji.video)
1281
+ * - additional: Host-provided streams without CV (viji.streams[])
1282
+ * - device: Device-provided camera streams (device.video)
1283
+ */
1284
+ export declare type VideoStreamType = 'main' | 'additional' | 'device';
1285
+
1276
1286
  export declare interface VijiAPI {
1277
1287
  canvas: OffscreenCanvas;
1278
1288
  ctx?: OffscreenCanvasRenderingContext2D;
@@ -1332,6 +1342,7 @@ export declare class VijiCore {
1332
1342
  private mainVideoCoordinator;
1333
1343
  private additionalCoordinators;
1334
1344
  private directFrameSlots;
1345
+ private deviceVideoCoordinators;
1335
1346
  private latestFrameBuffer;
1336
1347
  private autoCaptureEnabled;
1337
1348
  private eventSourceCore;
@@ -1852,6 +1863,18 @@ export declare class VijiCore {
1852
1863
  name: string;
1853
1864
  index: number;
1854
1865
  }>;
1866
+ /**
1867
+ * Set video stream for an external device
1868
+ * Device camera will appear in viji.devices[].video
1869
+ * @param deviceId - Device identifier
1870
+ * @param stream - MediaStream from device camera
1871
+ */
1872
+ setDeviceVideo(deviceId: string, stream: MediaStream): Promise<void>;
1873
+ /**
1874
+ * Clear video stream from device
1875
+ * @param deviceId - Device identifier
1876
+ */
1877
+ clearDeviceVideo(deviceId: string): Promise<void>;
1855
1878
  /**
1856
1879
  * Checks if the core is ready for use
1857
1880
  */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A, V, a, b } from "./index-BdLMCFEN.js";
1
+ import { A, V, a, b } from "./index-BTtBhJW4.js";
2
2
  export {
3
3
  A as AudioSystem,
4
4
  V as VERSION,
@@ -349,6 +349,131 @@ export const shaderUniforms = {
349
349
  "category": "Video",
350
350
  "description": "Stream 7 connection status"
351
351
  },
352
+ "u_deviceCount": {
353
+ "type": "int",
354
+ "category": "Device Video Support (device cameras)",
355
+ "description": "Number of device videos (0-8)"
356
+ },
357
+ "u_device0": {
358
+ "type": "sampler2D",
359
+ "category": "Device Video Support (device cameras)",
360
+ "description": "Device 0 camera texture"
361
+ },
362
+ "u_device1": {
363
+ "type": "sampler2D",
364
+ "category": "Device Video Support (device cameras)",
365
+ "description": "Device 1 camera texture"
366
+ },
367
+ "u_device2": {
368
+ "type": "sampler2D",
369
+ "category": "Device Video Support (device cameras)",
370
+ "description": "Device 2 camera texture"
371
+ },
372
+ "u_device3": {
373
+ "type": "sampler2D",
374
+ "category": "Device Video Support (device cameras)",
375
+ "description": "Device 3 camera texture"
376
+ },
377
+ "u_device4": {
378
+ "type": "sampler2D",
379
+ "category": "Device Video Support (device cameras)",
380
+ "description": "Device 4 camera texture"
381
+ },
382
+ "u_device5": {
383
+ "type": "sampler2D",
384
+ "category": "Device Video Support (device cameras)",
385
+ "description": "Device 5 camera texture"
386
+ },
387
+ "u_device6": {
388
+ "type": "sampler2D",
389
+ "category": "Device Video Support (device cameras)",
390
+ "description": "Device 6 camera texture"
391
+ },
392
+ "u_device7": {
393
+ "type": "sampler2D",
394
+ "category": "Device Video Support (device cameras)",
395
+ "description": "Device 7 camera texture"
396
+ },
397
+ "u_device0Resolution": {
398
+ "type": "vec2",
399
+ "category": "Device Video Support (device cameras)",
400
+ "description": "Device 0 resolution"
401
+ },
402
+ "u_device1Resolution": {
403
+ "type": "vec2",
404
+ "category": "Device Video Support (device cameras)",
405
+ "description": "Device 1 resolution"
406
+ },
407
+ "u_device2Resolution": {
408
+ "type": "vec2",
409
+ "category": "Device Video Support (device cameras)",
410
+ "description": "Device 2 resolution"
411
+ },
412
+ "u_device3Resolution": {
413
+ "type": "vec2",
414
+ "category": "Device Video Support (device cameras)",
415
+ "description": "Device 3 resolution"
416
+ },
417
+ "u_device4Resolution": {
418
+ "type": "vec2",
419
+ "category": "Device Video Support (device cameras)",
420
+ "description": "Device 4 resolution"
421
+ },
422
+ "u_device5Resolution": {
423
+ "type": "vec2",
424
+ "category": "Device Video Support (device cameras)",
425
+ "description": "Device 5 resolution"
426
+ },
427
+ "u_device6Resolution": {
428
+ "type": "vec2",
429
+ "category": "Device Video Support (device cameras)",
430
+ "description": "Device 6 resolution"
431
+ },
432
+ "u_device7Resolution": {
433
+ "type": "vec2",
434
+ "category": "Device Video Support (device cameras)",
435
+ "description": "Device 7 resolution"
436
+ },
437
+ "u_device0Connected": {
438
+ "type": "bool",
439
+ "category": "Device Video Support (device cameras)",
440
+ "description": "Device 0 connection status"
441
+ },
442
+ "u_device1Connected": {
443
+ "type": "bool",
444
+ "category": "Device Video Support (device cameras)",
445
+ "description": "Device 1 connection status"
446
+ },
447
+ "u_device2Connected": {
448
+ "type": "bool",
449
+ "category": "Device Video Support (device cameras)",
450
+ "description": "Device 2 connection status"
451
+ },
452
+ "u_device3Connected": {
453
+ "type": "bool",
454
+ "category": "Device Video Support (device cameras)",
455
+ "description": "Device 3 connection status"
456
+ },
457
+ "u_device4Connected": {
458
+ "type": "bool",
459
+ "category": "Device Video Support (device cameras)",
460
+ "description": "Device 4 connection status"
461
+ },
462
+ "u_device5Connected": {
463
+ "type": "bool",
464
+ "category": "Device Video Support (device cameras)",
465
+ "description": "Device 5 connection status"
466
+ },
467
+ "u_device6Connected": {
468
+ "type": "bool",
469
+ "category": "Device Video Support (device cameras)",
470
+ "description": "Device 6 connection status"
471
+ },
472
+ "u_device7Connected": {
473
+ "type": "bool",
474
+ "category": "Device Video Support (device cameras)",
475
+ "description": "Device 7 connection status"
476
+ },
352
477
  "u_faceCount": {
353
478
  "type": "int",
354
479
  "category": "CV",
@@ -464,6 +589,246 @@ export const shaderUniforms = {
464
589
  "category": "CV",
465
590
  "description": "Segmentation mask resolution in pixels"
466
591
  },
592
+ "u_deviceAcceleration": {
593
+ "type": "vec3",
594
+ "category": "Device Sensors",
595
+ "description": "Acceleration without gravity (m/s²) - x, y, z"
596
+ },
597
+ "u_deviceAccelerationGravity": {
598
+ "type": "vec3",
599
+ "category": "Device Sensors",
600
+ "description": "Acceleration with gravity (m/s²) - x, y, z"
601
+ },
602
+ "u_deviceRotationRate": {
603
+ "type": "vec3",
604
+ "category": "Device Sensors",
605
+ "description": "Rotation rate (deg/s) - alpha, beta, gamma"
606
+ },
607
+ "u_deviceOrientation": {
608
+ "type": "vec3",
609
+ "category": "Device Sensors",
610
+ "description": "Device orientation (degrees) - alpha, beta, gamma"
611
+ },
612
+ "u_deviceOrientationAbsolute": {
613
+ "type": "bool",
614
+ "category": "Device Sensors",
615
+ "description": "True if orientation uses magnetometer (compass)"
616
+ },
617
+ "u_deviceLocation": {
618
+ "type": "vec2",
619
+ "category": "Device Sensors",
620
+ "description": "Geolocation (degrees) - latitude, longitude"
621
+ },
622
+ "u_deviceLocationExt": {
623
+ "type": "vec4",
624
+ "category": "Device Sensors",
625
+ "description": "Extended geolocation - altitude(m), accuracy(m), heading(deg), speed(m/s)"
626
+ },
627
+ "u_externalDeviceCount": {
628
+ "type": "int",
629
+ "category": "Device Sensors",
630
+ "description": "Number of connected external devices (0-8)"
631
+ },
632
+ "u_device0Acceleration": {
633
+ "type": "vec3",
634
+ "category": "Device Sensors",
635
+ "description": "Device 0 acceleration without gravity (m/s²)"
636
+ },
637
+ "u_device0AccelerationGravity": {
638
+ "type": "vec3",
639
+ "category": "Device Sensors",
640
+ "description": "Device 0 acceleration with gravity (m/s²)"
641
+ },
642
+ "u_device0RotationRate": {
643
+ "type": "vec3",
644
+ "category": "Device Sensors",
645
+ "description": "Device 0 rotation rate (deg/s)"
646
+ },
647
+ "u_device0Orientation": {
648
+ "type": "vec3",
649
+ "category": "Device Sensors",
650
+ "description": "Device 0 orientation (degrees) - alpha, beta, gamma"
651
+ },
652
+ "u_device0Location": {
653
+ "type": "vec2",
654
+ "category": "Device Sensors",
655
+ "description": "Device 0 location - latitude, longitude"
656
+ },
657
+ "u_device1Acceleration": {
658
+ "type": "vec3",
659
+ "category": "Device Sensors",
660
+ "description": "Device 1 acceleration without gravity (m/s²)"
661
+ },
662
+ "u_device1AccelerationGravity": {
663
+ "type": "vec3",
664
+ "category": "Device Sensors",
665
+ "description": "Device 1 acceleration with gravity (m/s²)"
666
+ },
667
+ "u_device1RotationRate": {
668
+ "type": "vec3",
669
+ "category": "Device Sensors",
670
+ "description": "Device 1 rotation rate (deg/s)"
671
+ },
672
+ "u_device1Orientation": {
673
+ "type": "vec3",
674
+ "category": "Device Sensors",
675
+ "description": "Device 1 orientation (degrees) - alpha, beta, gamma"
676
+ },
677
+ "u_device1Location": {
678
+ "type": "vec2",
679
+ "category": "Device Sensors",
680
+ "description": "Device 1 location - latitude, longitude"
681
+ },
682
+ "u_device2Acceleration": {
683
+ "type": "vec3",
684
+ "category": "Device Sensors",
685
+ "description": "Device 2 acceleration without gravity (m/s²)"
686
+ },
687
+ "u_device2AccelerationGravity": {
688
+ "type": "vec3",
689
+ "category": "Device Sensors",
690
+ "description": "Device 2 acceleration with gravity (m/s²)"
691
+ },
692
+ "u_device2RotationRate": {
693
+ "type": "vec3",
694
+ "category": "Device Sensors",
695
+ "description": "Device 2 rotation rate (deg/s)"
696
+ },
697
+ "u_device2Orientation": {
698
+ "type": "vec3",
699
+ "category": "Device Sensors",
700
+ "description": "Device 2 orientation (degrees) - alpha, beta, gamma"
701
+ },
702
+ "u_device2Location": {
703
+ "type": "vec2",
704
+ "category": "Device Sensors",
705
+ "description": "Device 2 location - latitude, longitude"
706
+ },
707
+ "u_device3Acceleration": {
708
+ "type": "vec3",
709
+ "category": "Device Sensors",
710
+ "description": "Device 3 acceleration without gravity (m/s²)"
711
+ },
712
+ "u_device3AccelerationGravity": {
713
+ "type": "vec3",
714
+ "category": "Device Sensors",
715
+ "description": "Device 3 acceleration with gravity (m/s²)"
716
+ },
717
+ "u_device3RotationRate": {
718
+ "type": "vec3",
719
+ "category": "Device Sensors",
720
+ "description": "Device 3 rotation rate (deg/s)"
721
+ },
722
+ "u_device3Orientation": {
723
+ "type": "vec3",
724
+ "category": "Device Sensors",
725
+ "description": "Device 3 orientation (degrees) - alpha, beta, gamma"
726
+ },
727
+ "u_device3Location": {
728
+ "type": "vec2",
729
+ "category": "Device Sensors",
730
+ "description": "Device 3 location - latitude, longitude"
731
+ },
732
+ "u_device4Acceleration": {
733
+ "type": "vec3",
734
+ "category": "Device Sensors",
735
+ "description": "Device 4 acceleration without gravity (m/s²)"
736
+ },
737
+ "u_device4AccelerationGravity": {
738
+ "type": "vec3",
739
+ "category": "Device Sensors",
740
+ "description": "Device 4 acceleration with gravity (m/s²)"
741
+ },
742
+ "u_device4RotationRate": {
743
+ "type": "vec3",
744
+ "category": "Device Sensors",
745
+ "description": "Device 4 rotation rate (deg/s)"
746
+ },
747
+ "u_device4Orientation": {
748
+ "type": "vec3",
749
+ "category": "Device Sensors",
750
+ "description": "Device 4 orientation (degrees) - alpha, beta, gamma"
751
+ },
752
+ "u_device4Location": {
753
+ "type": "vec2",
754
+ "category": "Device Sensors",
755
+ "description": "Device 4 location - latitude, longitude"
756
+ },
757
+ "u_device5Acceleration": {
758
+ "type": "vec3",
759
+ "category": "Device Sensors",
760
+ "description": "Device 5 acceleration without gravity (m/s²)"
761
+ },
762
+ "u_device5AccelerationGravity": {
763
+ "type": "vec3",
764
+ "category": "Device Sensors",
765
+ "description": "Device 5 acceleration with gravity (m/s²)"
766
+ },
767
+ "u_device5RotationRate": {
768
+ "type": "vec3",
769
+ "category": "Device Sensors",
770
+ "description": "Device 5 rotation rate (deg/s)"
771
+ },
772
+ "u_device5Orientation": {
773
+ "type": "vec3",
774
+ "category": "Device Sensors",
775
+ "description": "Device 5 orientation (degrees) - alpha, beta, gamma"
776
+ },
777
+ "u_device5Location": {
778
+ "type": "vec2",
779
+ "category": "Device Sensors",
780
+ "description": "Device 5 location - latitude, longitude"
781
+ },
782
+ "u_device6Acceleration": {
783
+ "type": "vec3",
784
+ "category": "Device Sensors",
785
+ "description": "Device 6 acceleration without gravity (m/s²)"
786
+ },
787
+ "u_device6AccelerationGravity": {
788
+ "type": "vec3",
789
+ "category": "Device Sensors",
790
+ "description": "Device 6 acceleration with gravity (m/s²)"
791
+ },
792
+ "u_device6RotationRate": {
793
+ "type": "vec3",
794
+ "category": "Device Sensors",
795
+ "description": "Device 6 rotation rate (deg/s)"
796
+ },
797
+ "u_device6Orientation": {
798
+ "type": "vec3",
799
+ "category": "Device Sensors",
800
+ "description": "Device 6 orientation (degrees) - alpha, beta, gamma"
801
+ },
802
+ "u_device6Location": {
803
+ "type": "vec2",
804
+ "category": "Device Sensors",
805
+ "description": "Device 6 location - latitude, longitude"
806
+ },
807
+ "u_device7Acceleration": {
808
+ "type": "vec3",
809
+ "category": "Device Sensors",
810
+ "description": "Device 7 acceleration without gravity (m/s²)"
811
+ },
812
+ "u_device7AccelerationGravity": {
813
+ "type": "vec3",
814
+ "category": "Device Sensors",
815
+ "description": "Device 7 acceleration with gravity (m/s²)"
816
+ },
817
+ "u_device7RotationRate": {
818
+ "type": "vec3",
819
+ "category": "Device Sensors",
820
+ "description": "Device 7 rotation rate (deg/s)"
821
+ },
822
+ "u_device7Orientation": {
823
+ "type": "vec3",
824
+ "category": "Device Sensors",
825
+ "description": "Device 7 orientation (degrees) - alpha, beta, gamma"
826
+ },
827
+ "u_device7Location": {
828
+ "type": "vec2",
829
+ "category": "Device Sensors",
830
+ "description": "Device 7 location - latitude, longitude"
831
+ },
467
832
  "backbuffer": {
468
833
  "type": "sampler2D",
469
834
  "category": "Backbuffer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viji-dev/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Universal execution engine for Viji Creative scenes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",