• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

README.mdD25-Apr-20254.2 KiB137114

ignored_cameras.jsonD25-Apr-20253 21

physical_camera_mapping.jsonD25-Apr-20252 11

physical_camera_zoom_ratio_ranges.jsonD25-Apr-20252 11

README.md

1The JSON files in this directory can be overridden by vendors using Runtime
2Resource Overlays. These serve as an optional mechanism for vendors to modify
3DeviceAsWebcam behavior if needed.
4
5The details of the overridable files are as follows:
6
7- `physical_camera_mapping.json`:
8
9  This file contains a mapping of the preferred physical streams that are to be
10  used by DeviceAsWebcam service instead of logical streams, in order to save
11  power during webcam streaming. This mapping is optional. It must be overridden
12  through a static resource overlay by vendors if needed. The format of the
13  mapping is :
14
15  ```json
16  {
17    "<logical-camera-id-1>" : {
18      "<physical-camera-id-1>" : "<camera-label-1>",
19      "<physical-camera-id-2>" : "<camera-label-2>",
20      ...
21    },
22    "<logical-camera-id-2>" : {
23      "<physical-camera-id-3>" : "<camera-label-3>",
24      "<physical-camera-id-4>" : "<camera-label-4>",
25      ...
26    },
27    ...
28  }
29  ```
30
31  The 'camera-label' field here helps DeviceAsWebcam label these physical camera
32  ids in the UI elements of the service. The mapping containing physical camera
33  ids is in order of preference of the physical streams that must be used by
34  DeviceAsWebcam service. Available camera-labels are:
35
36  - `UW`: Ultra-wide
37  - `W`: Wide
38  - `T`: Telephoto
39  - `S`: Standard
40  - `O`: Other
41
42  For example, if a vendor would like to advertise 2 possible physical streams
43  with camera ids 3(Ultra-wide) and 4(Wide) for the back logical camera the
44  mapping could be:
45  ```json
46  {
47    "0" : {
48      "3" : "UW",
49      "4" : "W"
50    }
51  }
52  ```
53
54- `physical_camera_zoom_ratio_ranges.json`:
55
56  This file contains the mapping of physical cameras to their zoom ratio ranges.
57  When provided, DeviceAsWebcam will use this zoom ratio range instead of that
58  retrieved from camera characteristics. This is useful when the zoom ratio of the
59  physical camera listed in `physical_camera_mapping.json` is different from the
60  logical camera it belongs to. Providing this mapping is optional, and only used
61  if `physical_camera_mapping,json` contains a corresponding entry. The format of
62  the mapping is:
63
64  ```json
65  {
66    "<logical-camera-id-1>" : {
67      "<physical-camera-id-1>" : ["<zoom-ratio-range-lower-1>", "<zoom-ratio-range-upper-1>"],
68      "<physical-camera-id-2>" : ["<zoom-ratio-range-lower-2>", "<zoom-ratio-range-upper-2>"],
69      ...
70    },
71    "<logical-camera-id-2>" : {
72      "<physical-camera-id-3>" : ["<zoom-ratio-range-lower-3>", "<zoom-ratio-range-upper-3>"],
73      "<physical-camera-id-4>" : ["<zoom-ratio-range-lower-4>", "<zoom-ratio-range-upper-4>"],
74      ...
75    },
76    ...
77  }
78  ```
79
80  For example, if a vendor would like to custom 2 possible physical streams'
81  supported zoom ratio ranges with camera ids 3 and 4 for the back logical
82  camera the mapping could be:
83  ```json
84  {
85    "0" : {
86      "3" : ["1.0", "5.0"],
87      "4" : ["1.0", "8.0"]
88    }
89  }
90  ```
91
92- `ignored_cameras.json`:
93
94  By default, DeviceAsWebcam exposes all backward compatible cameras listed in
95  `CameraManager#getCameraIdList()` as supported cameras to stream webcam frames
96  from. `ignored_cameras.json` provides a way to ignore a predetermined set of
97  cameras if they are not expected to be used with DeviceAsWebcam.
98
99  For example, if a vendor would like to ignore camera ids 22 and 66, the ignored
100  cameras array could be:
101
102  ```json
103  [
104      "22",
105      "66",
106      ...
107  ]
108  ```
109
110- `ignored_v4l2_nodes.json`:
111
112  Linux UVC gadget driver mounts a V4L2 node that DeviceAsWebcam service
113  interacts with. To determine this node, DeviceAsWebcam service looks through
114  all `/dev/video*` nodes, looking for the first V4L2 node that advertises
115  `V4L2_CAP_VIDEO_OUTPUT` capability.
116
117  This will run into issues if a device has other V4L2 nodes mounted at
118  `/dev/video*` with `V4L2_CAP_VIDEO_OUTPUT` capability advertised for other
119  processing purposes.
120
121  `ignored_v4l2_nodes.json` provides a way for DeviceAsWebcam service to
122  ignore a predetermined set of V4L2 nodes.
123
124  The file format is as follows:
125
126  ```json
127  [
128      "/dev/video10",
129      "/dev/video12",
130      ...
131  ]
132  ```
133
134  **Note:**
135  - `ignored_v4l2_nodes.json` is pulled in via `libDeviceAsWebcam`.
136  - Wildcard patterns are _not_ supported in `ignored_v4l2_nodes.json`.
137