longmen11 发表于 2021-12-8 20:14:35

V4L2没办法打开摄像头

通过jni调用c++ .so
.so里面要通过v4l2取数据,但是第一步查询状态就失败了。
提示avc: denied

网上查了一大堆都没办法解决。不知道各位大神有没办法。

[ 2456.730005] type=1400 audit(1638956391.976:15462): avc: denied { getattr } for comm="e.cameracap1207" path="/dev/video1" dev="tmpfs" ino=4500 scontext=u:r:system_app:s0 tcontext=u:object_r:video_device:s0 tclass=chr_file permissive=0
[ 2456.753693] type=1400 audit(1638956391.976:15462): avc: denied { getattr } for comm="e.cameracap1207" path="/dev/video1" dev="tmpfs" ino=4500 scontext=u:r:system_app:s0 tcontext=u:object_r:video_device:s0 tclass=chr_file permissive=0
[ 2456.777096] type=1400 audit(1638956391.976:15463): avc: denied { getattr } for comm="e.cameracap1207" path="/dev/video2" dev="tmpfs" ino=491 scontext=u:r:system_app:s0 tcontext=u:object_r:video_device:s0 tclass=chr_file permissive=0
[ 2456.800643] type=1400 audit(1638956391.976:15463): avc: denied { getattr } for comm="e.cameracap1207" path="/dev/video2" dev="tmpfs" ino=491 scontext=u:r:system_app:s0 tcontext=u:object_r:video_device:s0 tclass=chr_file permissive=0
[ 2456.824072] type=1400 audit(1638956391.976:15464): avc: denied { getattr } for comm="e.cameracap1207" path="/dev/video3" dev="tmpfs" ino=488 scontext=u:r:system_app:s0 tcontext=u:object_r:video_device:s0 tclass=chr_file permissive=0

鬼屋I 发表于 2022-2-9 16:02:32

调试阶段    命令行输入getenforce ,看看selinux是否关闭,如没有关闭,输入setenforce 0,关闭selinux权限
页: [1]
查看完整版本: V4L2没办法打开摄像头