Skip to content

Commit ce749c7

Browse files
Merge pull request #60 from tiagocoutinho/video-fix
Video fix
2 parents ccd6324 + b50a624 commit ce749c7

File tree

11 files changed

+1644
-1658
lines changed

11 files changed

+1644
-1658
lines changed

examples/video/basic_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def run(device):
3131
if new - last_update > 0.1:
3232
elapsed = new - start
3333
print(
34-
f"frame {frame.frame_nb:04d} {len(frame)/1000:.1f} Kb at {fps:.1f} fps ; "
34+
f"frame {frame.frame_nb:04d} {len(frame) / 1000:.1f} Kb at {fps:.1f} fps ; "
3535
f" data={data[0]}; {elapsed=:.2f} s;",
3636
end="\r",
3737
)

examples/video/basic_gevent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def run(device):
3333
if new - last_update > 0.1:
3434
elapsed = new - start
3535
print(
36-
f"frame {frame.frame_nb:04d} {len(frame)/1000:.1f} Kb at {fps:.1f} fps ; "
36+
f"frame {frame.frame_nb:04d} {len(frame) / 1000:.1f} Kb at {fps:.1f} fps ; "
3737
f"data={data[0]}; {elapsed=:.2f} s;",
3838
end="\r",
3939
)

examples/video/basic_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def run(args):
2222
if new - last_update > 0.1:
2323
elapsed = new - start
2424
print(
25-
f"frame {frame.frame_nb:04d} {len(frame)/1000:.1f} Kb at {fps:.1f} fps; {elapsed=:.2f} s;",
25+
f"frame {frame.frame_nb:04d} {len(frame) / 1000:.1f} Kb at {fps:.1f} fps; {elapsed=:.2f} s;",
2626
end="\r",
2727
)
2828
last_update = new

examples/video/qt/grid.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ def close():
3131
logging.info("Stopping all cameras...")
3232
for qcamera in qcameras:
3333
qcamera.stop()
34-
logging.info("waiting for cameras to stop...")
35-
for qcamera in qcameras:
36-
qcamera.wait()
3734
logging.info("Done!")
3835

3936
app = QtWidgets.QApplication([])

examples/video/video_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def run(args):
5151
n = frame_n - last_n
5252
rate = n / elapsed
5353
print(
54-
f"Frame: {i:>8} | Elapsed: {now-start:>8.1f} s | Rate: {rate:>8.1f} fps | Skipped: {skipped:>8}",
54+
f"Frame: {i:>8} | Elapsed: {now - start:>8.1f} s | Rate: {rate:>8.1f} fps | Skipped: {skipped:>8}",
5555
end="\r",
5656
)
5757
last = now

examples/video/video_output_multi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def run(device_config):
6464
n = frame_n - last_n
6565
rate = n / elapsed
6666
print(
67-
f"Frame: {i:>8} | Elapsed: {now-start:>8.1f} s | Rate: {rate:>8.1f} fps | Skipped: {skipped:>8}"
67+
f"Frame: {i:>8} | Elapsed: {now - start:>8.1f} s | Rate: {rate:>8.1f} fps | Skipped: {skipped:>8}"
6868
)
6969
last = now
7070
last_n = frame_n

linuxpy/usb/ids/hid_usage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
47: {"name": "[ and { (Bracket and Braces Left)"},
267267
48: {"name": "] and } (Bracket and Braces Right)"},
268268
49: {"name": "\\ and | (Backslash and Bar)"},
269-
50: {"name": "# and ~ (Hash and Tilde, Non-US Keyboard near " "right shift)"},
269+
50: {"name": "# and ~ (Hash and Tilde, Non-US Keyboard near right shift)"},
270270
51: {"name": "; and : (Semicolon and Colon)"},
271271
52: {"name": '´ and " (Accent Acute and Double Quotes)'},
272272
53: {"name": "` and ~ (Accent Grace and Tilde)"},
@@ -315,8 +315,8 @@
315315
97: {"name": "Keypad 8 and Up Arrow"},
316316
98: {"name": "Keypad 8 and Page Up"},
317317
99: {"name": "Keypad . (decimal delimiter) and Delete"},
318-
100: {"name": "\\ and | (Backslash and Bar, UK and Non-US " "Keyboard near left shift)"},
319-
101: {"name": "Keyboard Application (Windows Key for Win95 " "or Compose)"},
318+
100: {"name": "\\ and | (Backslash and Bar, UK and Non-US Keyboard near left shift)"},
319+
101: {"name": "Keyboard Application (Windows Key for Win95 or Compose)"},
320320
102: {"name": "Power (not a key)"},
321321
103: {"name": "Keypad = (Equal Sign)"},
322322
104: {"name": "F13"},
@@ -356,7 +356,7 @@
356356
138: {"name": "International 4 (PC98)"},
357357
139: {"name": "International 5 (PC98)"},
358358
140: {"name": "International 6 (PC98)"},
359-
141: {"name": "International 7 (Toggle Single/Double Byte " "Mode)"},
359+
141: {"name": "International 7 (Toggle Single/Double Byte Mode)"},
360360
142: {"name": "International 8"},
361361
143: {"name": "International 9"},
362362
144: {"name": "LANG 1 (Hangul/English Toggle, Korea)"},

linuxpy/usb/ids/klass.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
0: {"name": "None"},
2424
1: {"name": "AT-commands (v.25ter)"},
2525
2: {"name": "AT-commands (PCCA101)"},
26-
3: {"name": "AT-commands (PCCA101 + " "wakeup)"},
26+
3: {"name": "AT-commands (PCCA101 + wakeup)"},
2727
4: {"name": "AT-commands (GSM)"},
2828
5: {"name": "AT-commands (3G)"},
2929
6: {"name": "AT-commands (CDMA)"},
30-
254: {"name": "Defined by command set " "descriptor"},
31-
255: {"name": "Vendor Specific (MSFT " "RNDIS?)"},
30+
254: {"name": "Defined by command set descriptor"},
31+
255: {"name": "Vendor Specific (MSFT RNDIS?)"},
3232
},
3333
"name": "Abstract (modem)",
3434
},
@@ -61,7 +61,7 @@
6161
5: {"name": "Physical Interface Device"},
6262
6: {
6363
"children": {
64-
1: {"children": {1: {"name": "Picture Transfer Protocol " "(PIMA 15470)"}}, "name": "Still Image Capture"}
64+
1: {"children": {1: {"name": "Picture Transfer Protocol (PIMA 15470)"}}, "name": "Still Image Capture"}
6565
},
6666
"name": "Imaging",
6767
},
@@ -72,7 +72,7 @@
7272
0: {"name": "Reserved/Undefined"},
7373
1: {"name": "Unidirectional"},
7474
2: {"name": "Bidirectional"},
75-
3: {"name": "IEEE 1284.4 compatible " "bidirectional"},
75+
3: {"name": "IEEE 1284.4 compatible bidirectional"},
7676
255: {"name": "Vendor Specific"},
7777
},
7878
"name": "Printer",
@@ -189,16 +189,16 @@
189189
1: {
190190
"children": {
191191
1: {"name": "Bluetooth"},
192-
2: {"name": "Ultra WideBand Radio " "Control"},
192+
2: {"name": "Ultra WideBand Radio Control"},
193193
3: {"name": "RNDIS"},
194194
},
195195
"name": "Radio Frequency",
196196
},
197197
2: {
198198
"children": {
199-
1: {"name": "Host Wire Adapter " "Control/Data Streaming"},
200-
2: {"name": "Device Wire Adapter " "Control/Data Streaming"},
201-
3: {"name": "Device Wire Adapter " "Isochronous Streaming"},
199+
1: {"name": "Host Wire Adapter Control/Data Streaming"},
200+
2: {"name": "Device Wire Adapter Control/Data Streaming"},
201+
3: {"name": "Device Wire Adapter Isochronous Streaming"},
202202
},
203203
"name": "Wireless USB Wire Adapter",
204204
},
@@ -211,7 +211,7 @@
211211
2: {
212212
"children": {
213213
1: {"name": "Interface Association"},
214-
2: {"name": "Wire Adapter Multifunction " "Peripheral"},
214+
2: {"name": "Wire Adapter Multifunction Peripheral"},
215215
},
216216
"name": "?",
217217
},
@@ -230,7 +230,7 @@
230230
},
231231
255: {
232232
"children": {
233-
255: {"children": {255: {"name": "Vendor Specific " "Protocol"}}, "name": "Vendor Specific Subclass"}
233+
255: {"children": {255: {"name": "Vendor Specific Protocol"}}, "name": "Vendor Specific Subclass"}
234234
},
235235
"name": "Vendor Specific Class",
236236
},

0 commit comments

Comments
 (0)