diff --git a/v4l2.go b/v4l2.go index 03083a8..79dc65d 100644 --- a/v4l2.go +++ b/v4l2.go @@ -499,7 +499,7 @@ func mmapQueryBuffer(fd uintptr, index uint32, length *uint32) (buffer []byte, e *length = req.length - buffer, err = unix.Mmap(int(fd), int64(offset), int(req.length), unix.PROT_READ, unix.MAP_SHARED) + buffer, err = unix.Mmap(int(fd), int64(offset), int(req.length), unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED) return } diff --git a/webcam.go b/webcam.go index 66f236a..bf72815 100644 --- a/webcam.go +++ b/webcam.go @@ -35,7 +35,7 @@ type Control struct { // Checks if device is a v4l2 device and if it is // capable to stream video func Open(path string) (*Webcam, error) { - handle, err := unix.Open(path, unix.O_RDONLY|unix.O_NONBLOCK, 0666) + handle, err := unix.Open(path, unix.O_RDWR|unix.O_NONBLOCK, 0666) if err != nil { return nil, err }