File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 20
20
import subprocess
21
21
import sys
22
22
from timeit import default_timer as timer
23
- import v4l2
23
+ import videodev2
24
24
import numpy as np
25
25
26
26
27
27
def get_platform ():
28
28
platform = 'vc4'
29
29
try :
30
- for num in range (5 ):
30
+ for num in range (64 ):
31
31
device = '/dev/video' + str (num )
32
32
if os .path .exists (device ):
33
33
with open (device , 'rb+' , buffering = 0 ) as fd :
34
- caps = v4l2 .v4l2_capability ()
35
- fcntl .ioctl (fd , v4l2 .VIDIOC_QUERYCAP , caps )
36
- decoded = caps .card . decode ( 'utf-8' )
37
- if decoded == 'rp1-cfe' :
34
+ caps = videodev2 .v4l2_capability ()
35
+ fcntl .ioctl (fd , videodev2 .VIDIOC_QUERYCAP , caps )
36
+ decoded = videodev2 . arr_to_str ( caps .card )
37
+ if decoded == "pispbe" :
38
38
platform = 'pisp'
39
39
break
40
- elif decoded == ' unicam' :
40
+ elif decoded == " unicam" :
41
41
break
42
42
except Exception :
43
43
pass
You can’t perform that action at this time.
0 commit comments