Revision 8c2ed4f7
| b/py/scenic/application.py | ||
|---|---|---|
| 220 | 220 |
return _format_device_name_and_identifier(midi_device_dict["name"], str(midi_device_dict["number"])) |
| 221 | 221 |
|
| 222 | 222 |
def format_v4l2_device_name(self, device_dict): |
| 223 |
print "formatyting v4l2 device name", device_dict
|
|
| 223 |
print "formatting v4l2 device name", device_dict |
|
| 224 | 224 |
return _format_device_name_and_identifier(device_dict["card"], device_dict["name"]) |
| 225 | 225 |
|
| 226 | 226 |
def parse_v4l2_device_name(self, formatted_name): |
| b/py/scenic/devices/cameras.py | ||
|---|---|---|
| 28 | 28 |
from twisted.python import procutils |
| 29 | 29 |
from twisted.internet import reactor |
| 30 | 30 |
|
| 31 |
ugly_to_beautiful_camera_names = {
|
|
| 32 |
"BT878 video (Osprey 210/220/230": "Osprey 210/220/230", |
|
| 33 |
"BT878 video (Osprey 100/150 (87": "Osprey 100/150", |
|
| 34 |
} |
|
| 35 |
|
|
| 36 |
def _beautify_camera_name(name): |
|
| 37 |
""" |
|
| 38 |
Renames a camera with a better name if it's in our list of know camera names. |
|
| 39 |
|
|
| 40 |
@rtype: str |
|
| 41 |
@type name: str |
|
| 42 |
""" |
|
| 43 |
global ugly_to_beautiful_camera_names |
|
| 44 |
if name in ugly_to_beautiful_camera_names.keys(): |
|
| 45 |
return ugly_to_beautiful_camera_names[name] |
|
| 46 |
elif name.startswith("UVC Camera"):
|
|
| 47 |
return "USB " % (name[4:]) # we replace UVC by USB |
|
| 48 |
else: |
|
| 49 |
return name |
|
| 50 |
|
|
| 31 | 51 |
def _parse_milhouse_list_cameras(text): |
| 32 | 52 |
""" |
| 33 | 53 |
Parses the output of `milhouse --list-cameras` |
| ... | ... | |
| 87 | 107 |
v4l2_devices[current_v4l2_device]["is_interlaced"] = is_interlaced |
| 88 | 108 |
#print " interlaced:", is_interlaced |
| 89 | 109 |
elif line.startswith("Card type"):
|
| 90 |
card = value
|
|
| 110 |
card = _beautify_camera_name(value)
|
|
| 91 | 111 |
v4l2_devices[current_v4l2_device]["card"] = card |
| 92 | 112 |
#print " card:", card |
| 93 | 113 |
elif line.startswith("Video input"):
|
Also available in: Unified diff