diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-09-19 17:50:15 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2014-09-19 17:50:15 +0200 |
commit | 65fd912c67ad76ad7ef6dee1ade7d76d26b08efd (patch) | |
tree | c9e3813e9de70d1074b9d042639e482ff3749b28 /src/v4l.cc | |
parent | cddfe69635bcb66bc254d20f4973eeabb4061b7e (diff) |
Add video device argument.
Diffstat (limited to 'src/v4l.cc')
-rw-r--r-- | src/v4l.cc | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -66,7 +66,7 @@ struct buffer { size_t length; }; -static const char *dev_name; +static char *dev_name; static enum io_method io = IO_METHOD_MMAP; static int fd = -1; struct buffer *buffers; @@ -788,14 +788,19 @@ int main(int argc, char **argv) } #endif/*0*/ -V4L::V4L() +V4L::V4L(QString device) { + dev_name = strdup(device.toStdString().c_str()); + v4l = this; // Set global V4L object pointer. + start(); } V4L::~V4L() { + free(dev_name); + v4l = NULL; // Unset global V4L object pointer. // TODO: Stop thread.... somehow. @@ -803,7 +808,6 @@ V4L::~V4L() void V4L::run() { - dev_name = "/dev/video0"; force_format = true; open_device(); |