MCPcopy Create free account
hub / github.com/ARM-software/AVH / _setDevice

Method _setDevice

interface/vstream/python/vsi_video_server.py:136–159  ·  view source on GitHub ↗

Set the streaming device index for input/output. Sets the device index to the specified value, or scans for the default device if -1 (0xFFFFFFFF) is given. Args: device: The device index to set. Returns: Device index actually set.

(self, device)

Source from the content-addressed store, hash-verified

134 return self.mode
135
136 def _setDevice(self, device):
137 """
138 Set the streaming device index for input/output.
139
140 Sets the device index to the specified value, or
141 scans for the default device if -1 (0xFFFFFFFF) is given.
142
143 Args:
144 device: The device index to set.
145 Returns:
146 Device index actually set.
147 """
148 logger.debug(f"_setDevice: device={device}")
149
150 if (device == 4294967295): # -1 as unsigned 32-bit
151 # Set device index to point to default device for the selected mode
152 self.device = self._scan_video_devices()
153 else:
154 # Set device index to the specified value
155 self.device = device
156
157 logger.info(f"_setDevice: streaming device set to {self.device}")
158
159 return self.device
160
161 def _setFilename(self, base_dir, filename):
162 """

Callers 1

runMethod · 0.95

Calls 1

_scan_video_devicesMethod · 0.95

Tested by

no test coverage detected