MTK6739 uvccamera 调试

1、kernel config 配置宏:

uvc配置

 CONFIG_MEDIA_SUPPORT=y
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L2=y
CONFIG_VIDEOBUF2_CORE=y
CONFIG_VIDEOBUF2_MEMOPS=y
CONFIG_VIDEOBUF2_VMALLOC=y
CONFIG_MEDIA_USB_SUPPORT=y
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y

OTG 配置

CONFIG_USB_MTK_OTG=y 
CONFIG_USB_MTK_HDRC=y

 

2、插入USB camera,查看设备驱动节点。发现有节点/dev/video0 dev/video1节点生成

修改system\core\rootdir ueventd.rc

/dev/video0 0666 root root 
/dev/video1 0666 root root  

3、修改selinux 

alps\device\mediatek\sepolicy\basic\non_plat 

device.te 

type video0_device, dev_type,mlstrustedobject;   //包含了所有能越过MLS检查的客体type。


type video1_device, dev_type,mlstrustedobject

file_contexts

/dev/video0(/.*)? u:object_r:video0_device:s0
/dev/video1(/.*)? u:object_r:video1_device:s0

system_app.te

allow system_app video0_device:chr_file { getattr open read write ioctl };
allow system_app video1_device:chr_file { getattr open read write ioctl };

untrusted_app.te

allow untrusted_app_25 video0_device:chr_file { getattr open read write ioctl};
allow untrusted_app_25 video1_device:chr_file { getattr open read write ioctl};

4、下载SimpleWebCam.apk验证

你可能感兴趣的:(mtk)