diff options
author | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 22:42:34 +0000 |
---|---|---|
committer | wjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 22:42:34 +0000 |
commit | 879d8326db0d5ad4c4cc84c709e84e4ed9d96777 (patch) | |
tree | 1cef1ba8ee543b0511f0c3b964e6740fbbc26c05 /media/video | |
parent | dd4267cca27e84b3318b7c4111413504b28dc00c (diff) | |
download | chromium_src-879d8326db0d5ad4c4cc84c709e84e4ed9d96777.zip chromium_src-879d8326db0d5ad4c4cc84c709e84e4ed9d96777.tar.gz chromium_src-879d8326db0d5ad4c4cc84c709e84e4ed9d96777.tar.bz2 |
open camera with O_RDWR.
This is somehow needed for Linux kernel 3.3 and above. If camera is opened with O_RDONLY, mmap will fail.
However, since we are not going to modify device memory, it should be allowed to open camera with O_RDONLY.
BUG=http://code.google.com/p/webrtc/issues/detail?id=512
Review URL: https://chromiumcodereview.appspot.com/10542080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r-- | media/video/capture/linux/video_capture_device_linux.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/media/video/capture/linux/video_capture_device_linux.cc b/media/video/capture/linux/video_capture_device_linux.cc index 56f5727..9ba2570 100644 --- a/media/video/capture/linux/video_capture_device_linux.cc +++ b/media/video/capture/linux/video_capture_device_linux.cc @@ -197,7 +197,8 @@ void VideoCaptureDeviceLinux::OnAllocate(int width, observer_ = observer; - if ((device_fd_ = open(device_name_.unique_id.c_str(), O_RDONLY)) < 0) { + // Need to open camera with O_RDWR after Linux kernel 3.3. + if ((device_fd_ = open(device_name_.unique_id.c_str(), O_RDWR)) < 0) { SetErrorState("Failed to open V4L2 device driver."); return; } |