Android之USB Camera摄像头节点后移

Android上usb camera在预览或者录像的时候,如果插拔摄像头会导致摄像头节点后移(/dev/video2->/dev/video3->/dev/video4->/dev/video5),可修改如下:

diff --git a/kernel/drivers/media/v4l2-core/v4l2-dev.c b/kernel/drivers/media/v4l2-core/v4l2-dev.c
index ed5040e..920646e 100644
--- a/kernel/drivers/media/v4l2-core/v4l2-dev.c
+++ b/kernel/drivers/media/v4l2-core/v4l2-dev.c
@@ -976,6 +976,7 @@ void video_unregister_device(struct video_device *vdev)
*/
clear_bit(V4L2_FL_REGISTERED, &vdev->flags);
mutex_unlock(&videodev_lock);
+ devnode_clear(vdev); //增加这行
device_unregister(&vdev->dev);
}
EXPORT_SYMBOL(video_unregister_device);

你可能感兴趣的:(Android,Usb,Camera)