Giter Club home page Giter Club logo

libuvc's People

Contributors

alexey-pelykh avatar chadrockey avatar cybercastle avatar d235j avatar ds-hwang avatar ftaiolivista avatar hipersayanx avatar ivadasz avatar jamesfidell avatar joshvillbrandt avatar ktossell avatar lobsteroh avatar luca-nardelli avatar mkassner avatar nneonneo avatar papr avatar patrickfuerst avatar pointcontrols avatar saki4510t avatar stevecotton avatar stevenlovegrove avatar suryaambrose avatar tcsantini avatar v4hn avatar willpatera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libuvc's Issues

How to Link JPEG library into this UVC library

Hi,my project need to use the JPEG relative API, but I use the steps described in the INSTALL_WINDOWS.md, It doesn't seem to provide a path to the JPEG library,Please give me a hand,thanks

Can't compile on some non-Windows targets

A change to compile on Windows broke non-Windows builds (at least on my mac). This change isn't portable to Windows, so I'm not submitting it as a pull request, but I had to make the following changes to build on MacOS (High Sierra):

git diff CMakeLists.txt  | cat
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 762f2b6..e3fafe7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,11 +24,12 @@ if(WIN32)
   find_library(LIBUSB_LIBRARIES usb-1.0
   PATHS /opt/local/lib)

-  find_path(LIBUSB_INCLUDE_DIR libusb-1.0/libusb.h
+  find_path(LIBUSB_INCLUDEDIR libusb-1.0/libusb.h
   PATHS /opt/local/include)
 else()
   find_package(PkgConfig)
   pkg_check_modules(LIBUSB libusb-1.0)
+  find_library(LIBUSB usb-1.0)
 endif()


@@ -54,7 +55,7 @@ SET(SOURCES src/ctrl.c src/ctrl-gen.c src/device.c src/diag.c
 include_directories(
   ${libuvc_SOURCE_DIR}/include
   ${libuvc_BINARY_DIR}/include
-  ${LIBUSB_INCLUDE_DIR}
+  ${LIBUSB_INCLUDEDIR}
   ${PTHREAD_INCLUDE_DIR}
 )

@@ -92,7 +93,7 @@ foreach(target_name ${UVC_TARGETS})
 endforeach()

 if(BUILD_UVC_SHARED)
-  target_link_libraries(uvc ${LIBUSB_LIBRARIES} ${PTHREAD_LIBRARIES})
+  target_link_libraries(uvc ${LIBUSB} ${PTHREAD_LIBRARIES})

   #add_executable(test src/test.c)
   #target_link_libraries(test uvc ${LIBUSB_LIBRARIES} opencv_highgui

Build issue under MSYS2 (MinGW-w64)

"struct timespec ts" is causing the problem.

ephwy@ephwy-HP MINGW64 /c/work/libuvc/fork/libuvc/build
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-7.3.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 7.3.0 (Rev2, Built by MSYS2 project)

ephwy@ephwy-HP MINGW64 /c/work/libuvc/fork/libuvc/build
$ make -i
[ 11%] Building C object CMakeFiles/uvc.dir/src/ctrl.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/ctrl.c:43:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/ctrl.c:43:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/ctrl.c:42:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

[ 22%] Building C object CMakeFiles/uvc.dir/src/ctrl-gen.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/ctrl-gen.c:3:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/ctrl-gen.c:3:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/ctrl-gen.c:2:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

[ 33%] Building C object CMakeFiles/uvc.dir/src/device.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/device.c:40:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/device.c:40:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/device.c:39:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

[ 44%] Building C object CMakeFiles/uvc.dir/src/diag.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/diag.c:40:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/diag.c:40:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/diag.c:39:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

[ 55%] Building C object CMakeFiles/uvc.dir/src/frame.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/frame.c:39:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/frame.c:39:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/frame.c:38:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

[ 66%] Building C object CMakeFiles/uvc.dir/src/init.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/init.c:79:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/init.c:79:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/init.c:78:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

[ 77%] Building C object CMakeFiles/uvc.dir/src/stream.c.obj
In file included from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:12:0,
                 from C:/work/libuvc/fork/libuvc/src/stream.c:40:
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1041:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1099:50: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                     const struct timespec *abstime);
                                                  ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1135:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1140:53: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
                                        const struct timespec *abstime);
                                                     ^~~~~~~~
C:/work/libuvc/pthreads-w32-2-9-1-release/Pre-built.2/include/pthread.h:1177:56: warning: 'struct timespec' declared inside parameter list will not be visible outside of this definition or declaration
 PTW32_DLLPORT int PTW32_CDECL pthread_delay_np (struct timespec * interval);
                                                        ^~~~~~~~
In file included from C:/work/libuvc/fork/libuvc/src/stream.c:40:0:
C:/work/libuvc/fork/libuvc/include/libuvc/libuvc_internal.h:72:0: warning: "ARRAYSIZE" redefined
 #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock.h:10,
                 from C:/work/libuvc/fork/libuvc/include/libuvc/libuvc.h:13,
                 from C:/work/libuvc/fork/libuvc/src/stream.c:39:
C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:668:0: note: this is the location of the previous definition
 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)

In file included from C:/work/libuvc/fork/libuvc/src/stream.c:50:0:
C:/work/libuvc/fork/libuvc/src/time_windows.h:16:17: error: return type is an incomplete type
 struct timespec get_abs_future_time_coarse(unsigned milli)
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/work/libuvc/fork/libuvc/src/time_windows.h: In function 'get_abs_future_time_coarse':
C:/work/libuvc/fork/libuvc/src/time_windows.h:22:21: error: storage size of 'future' isn't known
     struct timespec future;
                     ^~~~~~
C:/work/libuvc/fork/libuvc/src/time_windows.h:26:12: warning: 'return' with a value, in function returning void
     return future;
            ^~~~~~
C:/work/libuvc/fork/libuvc/src/time_windows.h:16:17: note: declared here
 struct timespec get_abs_future_time_coarse(unsigned milli)
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:/work/libuvc/fork/libuvc/src/stream.c: In function 'get_precise_timestamp_freq':
C:/work/libuvc/fork/libuvc/src/stream.c:472:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   perf_freq = li.QuadPart;
             ^
C:/work/libuvc/fork/libuvc/src/stream.c: In function 'uvc_stream_get_frame':
C:/work/libuvc/fork/libuvc/src/stream.c:1237:19: error: storage size of 'ts' isn't known
   struct timespec ts;
                   ^~
C:/work/libuvc/fork/libuvc/src/stream.c: In function 'uvc_stream_stop':
C:/work/libuvc/fork/libuvc/src/stream.c:1312:19: error: storage size of 'ts' isn't known
   struct timespec ts;
                   ^~
[ 88%] Building C object CMakeFiles/uvc.dir/src/misc.c.obj
[100%] Linking C shared library libuvc.dll
C:\msys64\mingw64\bin\ar.exe: CMakeFiles/uvc.dir/src/stream.c.obj: No such file or directory
[100%] Built target uvc

uvc_open: Not supported (-12) on Windows 10 64-bit

I've tried using libuvc to access my See3CAM_CU40 camera. I've followed https://github.com/pupil-labs/libuvc/blob/master/INSTALL_WINDOWS.md. Then tried the below code:

int main()
{

	uvc_context_t *ctx;
	uvc_device_t *dev;
	uvc_device_handle_t *devh;
	uvc_stream_ctrl_t ctrl;
	uvc_error_t res;
	/* Initialize a UVC service context. Libuvc will set up its own libusb
	* context. Replace NULL with a libusb_context pointer to run libuvc
	* from an existing libusb context. */
	res = uvc_init(&ctx, NULL);
	if (res < 0) {
		uvc_perror(res, "uvc_init");
		return res;
	}
	puts("UVC initialized");

	// list_devices(ctx);

	/* Locates the first attached UVC device, stores in dev */
	res = uvc_find_device(
		ctx, &dev,
		0x2560, 0xc140, NULL); /* filter devices: vendor_id, product_id, "serial_num" */
	if (res < 0) {
		uvc_perror(res, "uvc_find_device"); /* no devices found */
	}
	else {
		puts("Device found");
		/* Try to open the device: requires exclusive access */
		res = uvc_open(dev, &devh);
		if (res < 0) {
			uvc_perror(res, "uvc_open"); /* unable to open device */
		}
		else {
			puts("Device opened");
			/* Print out a message containing all the information that libuvc
			* knows about the device */
			uvc_print_diag(devh, stderr);
			/* Try to negotiate a 640x480 30 fps YUYV stream profile */
			res = uvc_get_stream_ctrl_format_size(
				devh, &ctrl, /* result stored in ctrl */
							 // corresponds to 'Y16 '
				UVC_FRAME_FORMAT_GRAY16, /* YUV 422, aka YUV 4:2:2. try _COMPRESSED */
				672, 380, 300 /* width, height, fps */
			);
			/* Print out the result */
			uvc_print_stream_ctrl(&ctrl, stderr);
			if (res < 0) {
				uvc_perror(res, "get_mode"); /* device doesn't provide a matching stream */
			}
			else {
				/* Start the video stream. The library will call user function cb:
				*   cb(frame, (void*) 12345)
				*/
				res = uvc_start_streaming(devh, &ctrl, cb, NULL, 0);
				if (res < 0) {
					uvc_perror(res, "start_streaming"); /* unable to start stream */
				}
				else {
					puts("Streaming...");
					// uvc_set_ae_mode(devh, 1); /* e.g., turn on auto exposure */
#ifdef __unix__
					sleep(3); /* stream for 10 seconds */
#else
					Sleep(3000);
#endif
					/* End the stream. Blocks until last callback is serviced */
					uvc_stop_streaming(devh);
					puts("Done streaming.");
				}
			}
			/* Release our handle on the device */
			uvc_close(devh);
			puts("Device closed");
		}
		/* Release the device descriptor */
		uvc_unref_device(dev);
	}

	/* Close the UVC context. This closes and cleans up any existing device handles,
	* and it closes the libusb context if one was not provided. */
	uvc_exit(ctx);
	puts("UVC exited");

	getchar();

    return 0;
}

I've compiled libusb following https://github.com/pupil-labs/libusb/blob/master/INSTALL_WIN.txt, with ENABLE_DEBUG_LOGGING. Here is what I'm getting when I run the above code:

[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
[ 0.000000] [00003064] libusb: debug [libusb_init] created default context
[ 0.000000] [00003064] libusb: debug [libusb_init] libusb v1.0.21.11156
[ 0.000000] [00003064] libusb: debug [windows_init] Windows 8 64-bit
[ 0.000000] [00003064] libusb: debug [setup_cancel_io] Will use CancelIoEx for I/O cancellation
[ 0.031215] [00003064] libusb: debug [winusbx_init] using libusbK DLL for universal access
[ 0.031215] [00003064] libusb: debug [winusbx_init] libusbK version: 3.0.7.0
[ 0.046842] [00003064] libusb: debug [winusbx_init] initalized sub API libusbK
[ 0.046842] [00003064] libusb: debug [winusbx_init] initalized sub API libusb0
[ 0.046842] [00003064] libusb: debug [winusbx_init] initalized sub API WinUSB
[ 0.046842] [00003064] libusb: debug [windows_init_clock] hires timer available (Frequency: 2531250 Hz)
[ 0.046842] [00003064] libusb: debug [windows_init_clock] timer thread will run on core #0
[ 0.062469] [00003064] libusb: debug [htab_create] using 1021 entries hash table
[ 0.062469] [00003064] libusb: debug [usbi_add_pollfd] add fd 0 events 1
UVC initialized
[ 0.062469] [00003064] libusb: debug [libusb_get_device_list]
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [91]
[ 0.062469] [00003064] libusb: debug [get_api_type] driver(s): USBHUB3
[ 0.062469] [00003064] libusb: debug [get_api_type] matched driver name against HUB API
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [3D4]
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [B7]
[ 0.062469] [00003064] libusb: debug [init_device] got bus number from ancestor #2
[ 0.062469] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.062469] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 700 bytes)
[ 0.062469] [00003064] libusb: debug [init_device] (bus: 1, addr: 3, depth: 1, port: 4): '\\.\USB#VID_174F&PID_2407#5&3279CB56&0&4'
[ 0.062469] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [33]
[ 0.062469] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.062469] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 59 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 2, depth: 1, port: 2): '\\.\USB#VID_046D&PID_C52F&MI_00#6&247989BB&0&0000'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [1E7]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 177 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 5, depth: 1, port: 7): '\\.\USB#VID_8087&PID_0A2A#5&3279CB56&0&7'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [2CC]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 59 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 2, depth: 1, port: 2): '\\.\USB#VID_046D&PID_C52F#5&3279CB56&0&2'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] found existing device for session [3D4] (1.0)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 1, depth: 0, port: 0): '\\.\USB#ROOT_HUB30#4&2A97E603&0&0'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] extra GUID: {5CD1E681-C2D8-427D-8AD2-EE2C9B43DA98}
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [3E8]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 373 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 10, depth: 1, port: 14): '\\.\USB#VID_2560&PID_C140&MI_00#6&2887BC08&1&0000'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [232]
[ 0.078095] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.078095] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 373 bytes)
[ 0.078095] [00003064] libusb: debug [init_device] (bus: 1, addr: 10, depth: 1, port: 14): '\\.\USB#VID_2560&PID_C140#181F9503'
[ 0.078095] [00003064] libusb: debug [windows_get_device_list] allocating new device for session [F2]
[ 0.093722] [00003064] libusb: debug [init_device] found 1 configurations (active conf: 1)
[ 0.093722] [00003064] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 39 bytes)
[ 0.093722] [00003064] libusb: debug [init_device] (bus: 1, addr: 4, depth: 1, port: 5): '\\.\USB#VID_0BDA&PID_0129#20100201396000000'
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] extra GUID: {4BA2D189-D0F3-499B-AAFC-2B5293C627D9}
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): usbccgp
[ 0.093722] [00003064] libusb: debug [get_api_type] matched driver name against Composite API
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [B7] (1.3)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): usbccgp
[ 0.093722] [00003064] libusb: debug [get_api_type] matched driver name against Composite API
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [2CC] (1.2)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): BTHUSB
[ 0.093722] [00003064] libusb: debug [get_api_type] lower filter driver(s): ibtusb
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [1E7] (1.5)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): RTSUER
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [F2] (1.4)
[ 0.093722] [00003064] libusb: debug [get_api_type] driver(s): usbccgp
[ 0.093722] [00003064] libusb: debug [get_api_type] matched driver name against Composite API
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] found existing device for session [232] (1.10)
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [2CC]:
[ 0.093722] [00003064] libusb: debug [set_composite_interface] interface[1] = \\.\HID#VID_046D&PID_C52F&MI_01&COL01#7&2246F788&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [2CC]:
[ 0.093722] [00003064] libusb: debug [set_composite_interface] interface[1] already set - ignoring HID collection: \\.\HID#VID_046D&PID_C52F&MI_01&COL02#7&2246F788&0&0001
[ 0.093722] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [2CC]:
[ 0.109348] [00003064] libusb: debug [set_composite_interface] interface[1] already set - ignoring HID collection: \\.\HID#VID_046D&PID_C52F&MI_01&COL03#7&2246F788&0&0002
[ 0.109348] [00003064] libusb: debug [windows_get_device_list] unlisted ancestor for '\\.\HID#LENOVOVHID#1&632D18&0&0000' (non USB HID, newly connected, etc.) - ignoring
[ 0.109348] [00003064] libusb: debug [get_api_type] driver(s): libusbK
[ 0.109348] [00003064] libusb: debug [get_api_type] matched driver name against libusbK
[ 0.109348] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [232]:
[ 0.109348] [00003064] libusb: debug [set_composite_interface] interface[0] = \\.\USB#VID_2560&PID_C140&MI_00#6&2887BC08&1&0000#{5CD1E681-C2D8-427D-8AD2-EE2C9B43DA98}
[ 0.109348] [00003064] libusb: debug [get_api_type] driver(s): libusbK
[ 0.109348] [00003064] libusb: debug [get_api_type] matched driver name against libusbK
[ 0.109348] [00003064] libusb: debug [windows_get_device_list] setting composite interface for [232]:
[ 0.109348] [00003064] libusb: debug [set_composite_interface] interface[2] = \\.\USB#VID_2560&PID_C140&MI_02#6&2887BC08&1&0002#{4BA2D189-D0F3-499B-AAFC-2B5293C627D9}
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [parse_configuration] skipping descriptor 0xb
[ 0.109348] [00003064] libusb: debug [parse_endpoint] skipping descriptor 25
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.109348] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.109348] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.124975] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.124975] [00003064] libusb: debug [parse_configuration] skipping descriptor 0xb
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 25
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.124975] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.124975] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.140602] [00003064] libusb: debug [parse_configuration] skipping descriptor 0xb
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 25
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [parse_endpoint] skipping descriptor 30
[ 0.140602] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.140602] [00003064] libusb: debug [libusb_get_config_descriptor] index 0
[ 0.140602] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.2
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.5
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.2
[ 0.140602] [00003064] libusb: debug [libusb_unref_device] destroy device 1.4
[ 0.140602] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.140602] [00003064] libusb: debug [libusb_open] open 1.3
[ 0.156229] [00003064] libusb: debug [libusb_open] open 1.3 returns -5
[ 0.156229] [00003064] libusb: debug [libusb_get_device_descriptor]
[ 0.156229] [00003064] libusb: debug [libusb_open] open 1.10
[ 0.156229] [00003064] libusb: debug [unsupported_open] unsupported API call for 'open' (unrecognized device driver)
[ 0.156229] [00003064] libusb: debug [libusb_open] open 1.10 returns -12
[ 0.156229] [00003064] libusb: debug [libusb_unref_device] destroy device 1.3
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.10
Device found
[ 0.171855] [00003064] libusb: debug [libusb_open] open 1.10
[ 0.171855] [00003064] libusb: debug [unsupported_open] unsupported API call for 'open' (unrecognized device driver)
[ 0.171855] [00003064] libusb: debug [libusb_open] open 1.10 returns -12
uvc_open: Not supported (-12)
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.10
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.1
[ 0.171855] [00003064] libusb: debug [libusb_unref_device] destroy device 1.0
[ 0.171855] [00003064] libusb: debug [libusb_exit]
[ 0.171855] [00003064] libusb: debug [libusb_exit] destroying default context
[ 0.171855] [00003064] libusb: debug [usbi_remove_pollfd] remove fd 0
[ 0.201649] [000006b4] libusb: debug [windows_clock_gettime_threaded] timer thread quitting
UVC exited

I've made sure I've installed the libusbK driver with the Zadig program. I've verified my camera appears under "libusbK USB Devices" in the Device Manager.

Any clues please?

How to capture pupil images by using the libuvc

Hi, after many efforts, I have complied and run successfully the libuvc lib in C++ environment. Although there is a example, I don't know how to print the name of device_list and capture the pupil image from the usb. Is there any more detailed codes that read Pupil images by using the libuvc?
Looking forward to your reply.

Using usbdk on Windows

Hi all,
Dose this fork support Usbdk?
I mean, when I modify the func uvc_init() in init.c (Reference from the libusb wiki)

libusb_init(&ctx->usb_ctx);
libusb_set_option(ctx->usb_ctx, LIBUSB_OPTION_USE_USBDK);

Then operate UsbDk_1.0.22_x64.msi
Finally run the code.

I got the log:

"uvc: device has a status interrupt endpoint, but unable to read from it"

The reason I want to use Usbdk is,
when I use the WinUSB, I can set command but can't open stream,
when I use the libusbK, I can set command and show stream but some device unplugging will cause my Windows blue-screen.

Any idea? thanks.

Upstreaming changes

Hi! libuvc has now been moved to a GitHub organization, and I'm trying to get all the changes from the disparate forks upstream. Would you have time to prepare a PR; or if not, at least note what commit(s) you think should/should not be merged in? Thanks!

Win32 compiled libuvc for grabbing frames from PupilLab cameras

Hello everyone,
hope you are fine.
I am trying to grab frames from some PupilLab cameras.
Everything works fine using libuvc if this library is compiled for x64 architecture. On the other hand, when I compile libuvc targeting Win32, my grabbing frames homemade application crashes here: https://github.com/libusb/libusb/blob/master/libusb/io.c#L1694 with the following error message: Exception thrown at 0x78D0982B (uvc.dll) in PupilLab32Bits.exe: 0xC0000094: Integer division by zero..
Has anyone tried to use Win32 compiled libuvc to grab frames from PupilLab cameras successfully?
Thank you in advance!

import issue w/ uvc

mj@mjUbuntu:~/Documents/libuvc/build$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

import uvc
Traceback (most recent call last):
File "", line 1, in
ImportError: /usr/local/lib/libuvc.so: undefined symbol: libusb_handle_events_completed

i keep running into this problem any help?

Windows, error: Integer division by zero

Hi, anyone still here~

When I use the device with UVC 1.0, it's good.

When I use the device with UVC 1.1, the first time call function get_dev_time_us( ),
the parameter "strmh->corrected_clock_freq" is zero, that cause "Integer division by zero".

Any idea for this question? why be zero? how to fix?

thanks

Add windows support

currently libuvc does not work on windows. An issue that discusses the problem can be found here: libuvc#12

Below are the steps required to close this issue:

  1. Add isochronous transfer support to the windows backend of libusb: libusb/libusb#46
  2. Test/fix libuvc functions (device enumeration, streaming and control) on windows.
  3. Successfully stream mjpeg images from uvc compatible camera at 1080p 30fps.
  4. Add documentation for building and use of libuvc and libusb on windows.
  5. Add documentation for building and use of pyuvc on windows.

libuvc should support windows 8.2 and later.

Linux: Fix timeout fn

the libuvc methods for linux do not properly implement timeouts.

This needs to be fixed.

Correcting clock frequency to 0

I'm using libuvc together with pyuvc
It seems like sometimes libuvc attempts to adjust the clock frequency to 0 which results in a Floating point exception: 8 and causes my app to crash.

here is a log of my app which is capturing a feed from a USB camera:

*** Correcting clock frequency to 18446744073709064655
*** Correcting clock frequency to 773985841442795
*** Correcting clock frequency to 24394025013
*** Correcting clock frequency to 18446744073705623779
*** Correcting clock frequency to 566162578616199
*** Correcting clock frequency to 26614331558
*** Correcting clock frequency to 993905
*** Correcting clock frequency to 40
*** Correcting clock frequency to 0
Floating point exception: 8

And another sample output:

*** Correcting clock frequency to 18446744073709542761
*** Correcting clock frequency to 706809490210815
*** Correcting clock frequency to 29107193129
*** Correcting clock frequency to 1273591
*** Correcting clock frequency to 57
*** Correcting clock frequency to 0
Floating point exception: 8

Is there any way to fix this?
I am also unable to catch this exception in my code or via the debugger either, which results in my app crashing every 5-10 minutes or so.

Can't compile on Mac OSX Catalina 10.15.1

On Mac OSX 10.15.1, running make && sudo make install

Retutns the following output with 2 errors:

[ 11%] Linking C shared library libuvc.dylib
Undefined symbols for architecture x86_64:
  "_libusb_alloc_transfer", referenced from:
      _uvc_open in device.c.o
      _uvc_stream_start in stream.c.o
  "_libusb_attach_kernel_driver", referenced from:
      _uvc_open in device.c.o
      _uvc_release_if in device.c.o
      _uvc_close in device.c.o
  "_libusb_cancel_transfer", referenced from:
      _uvc_stream_stop in stream.c.o
  "_libusb_claim_interface", referenced from:
      _uvc_open in device.c.o
      _uvc_claim_if in device.c.o
  "_libusb_close", referenced from:
      _uvc_get_device_descriptor in device.c.o
      _uvc_open in device.c.o
      _uvc_close in device.c.o
  "_libusb_control_transfer", referenced from:
      _uvc_get_ctrl_len in ctrl.c.o
      _uvc_get_ctrl in ctrl.c.o
      _uvc_set_ctrl in ctrl.c.o
      _uvc_get_power_mode in ctrl.c.o
      _uvc_set_power_mode in ctrl.c.o
      _uvc_get_scanning_mode in ctrl-gen.c.o
      _uvc_set_scanning_mode in ctrl-gen.c.o
      ...
  "_libusb_detach_kernel_driver", referenced from:
      _uvc_open in device.c.o
      _uvc_claim_if in device.c.o
  "_libusb_exit", referenced from:
      _uvc_exit in init.c.o
  "_libusb_free_config_descriptor", referenced from:
      _uvc_get_device_list in device.c.o
      _uvc_free_device_info in device.c.o
  "_libusb_free_device_list", referenced from:
      _uvc_get_device_list in device.c.o
  "_libusb_free_transfer", referenced from:
      _uvc_open in device.c.o
      _uvc_free_devh in device.c.o
      _uvc_close in device.c.o
      __uvc_stream_callback in stream.c.o
      _uvc_stream_start in stream.c.o
      _uvc_stream_stop in stream.c.o
  "_libusb_get_bus_number", referenced from:
      _uvc_get_bus_number in device.c.o
  "_libusb_get_config_descriptor", referenced from:
      _uvc_get_device_list in device.c.o
      _uvc_open in device.c.o
      _uvc_get_device_info in device.c.o
  "_libusb_get_device_address", referenced from:
      _uvc_get_device_address in device.c.o
  "_libusb_get_device_descriptor", referenced from:
      _uvc_get_device_list in device.c.o
      _uvc_get_device_descriptor in device.c.o
      _uvc_open in device.c.o
  "_libusb_get_device_list", referenced from:
      _uvc_get_device_list in device.c.o
  "_libusb_get_string_descriptor_ascii", referenced from:
      _uvc_get_device_descriptor in device.c.o
  "_libusb_handle_events_completed", referenced from:
      __uvc_handle_events in init.c.o
  "_libusb_init", referenced from:
      _uvc_init in init.c.o
  "_libusb_open", referenced from:
      _uvc_get_device_descriptor in device.c.o
      _uvc_open in device.c.o
  "_libusb_ref_device", referenced from:
      _uvc_find_device in device.c.o
      _uvc_get_device_list in device.c.o
      _uvc_ref_device in device.c.o
      _uvc_find_devices in device.c.o
      _uvc_open in device.c.o
      _uvc_get_device in device.c.o
  "_libusb_release_interface", referenced from:
      _uvc_open in device.c.o
      _uvc_release_if in device.c.o
      _uvc_close in device.c.o
  "_libusb_set_interface_alt_setting", referenced from:
      _uvc_open in device.c.o
      _uvc_release_if in device.c.o
      _uvc_close in device.c.o
      _uvc_stream_start in stream.c.o
  "_libusb_submit_transfer", referenced from:
      _uvc_open in device.c.o
      __uvc_status_callback in device.c.o
      __uvc_stream_callback in stream.c.o
      _uvc_stream_start in stream.c.o
  "_libusb_unref_device", referenced from:
      _uvc_find_device in device.c.o
      _uvc_free_device_list in device.c.o
      _uvc_find_devices in device.c.o
      _uvc_open in device.c.o
      _uvc_unref_device in device.c.o
      _uvc_close in device.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libuvc.0.0.9.dylib] Error 1
make[1]: *** [CMakeFiles/uvc.dir/all] Error 2

Is there any solution to make it compile on Catalina?

File "uvc.pyx", line 544: The uvc. uvc_stream_open_ctrl Error.

Hello,

I've met the error on Windows 10 64-bit, when I tried to run the pyuvc example code with my Integrated Webcam on the computer. . This is what I get:

import uvc
import logging
import cv2
logging.basicConfig(level=logging.INFO)
dev_list = uvc.device_list()
print(dev_list)
cap1 = uvc.Capture(dev_list[0]["uid"])
Output:
[{'name': 'unknown', 'manufacturer': 'unknown', 'serialNumber': 'unknown', 'idProduct': 11146, 'idVendor': 7119, 'device_address': 4, 'bus_number': 1, 'uid': '1:4'}]
Traceback (most recent call last):
  File "F:/pyuvc/uvc_example.py", line 12, in <module>
    cap1 = uvc.Capture(dev_list[0]["uid"])
  File "uvc.pyx", line 455, in uvc.Capture.__init__
  File "uvc.pyx", line 507, in uvc.Capture._init_device
uvc.OpenError

I have also tried install libusbK to replace the composite parent in the Zadig. I get some device information. But I also failed. This is what I get:

from __future__ import print_function
import uvc
import logging
import cv2
logging.basicConfig(level=logging.INFO)

dev_list = uvc.device_list()
print(dev_list)
cap1 = uvc.Capture(dev_list[0]["uid"])

print(cap1.avaible_modes)
for x in range(10):
    print(x)
    cap1.frame_mode = (1280, 720, 30)
    for x in range(100):
        frame2 = cap1.get_frame_robust()
        print(frame2.img.shape)
        cv2.imshow("img2", frame2.gray)
        cv2.waitKey(1)
cap = None

[{'name': 'Integrated_Webcam_HD', 'manufacturer': 'CNFDH73M4160178A2D52', 'serialNumber': 'unknown', 'idProduct': 11146, 'idVendor': 7119, 'device_address': 4, 'bus_number': 1, 'uid': '1:4'}]
[(848, 480, 30), (960, 540, 30), (1280, 720, 30)]
0
Traceback (most recent call last):
  File "F:/pyuvc/uvc_example.py", line 27, in <module>
    frame2 = cap1.get_frame_robust()
  File "uvc.pyx", line 572, in uvc.Capture.get_frame_robust
  File "uvc.pyx", line 588, in uvc.Capture.get_frame
  File "uvc.pyx", line 544, in uvc.Capture._start
uvc.InitError

The line 544 code:

status = uvc.uvc_stream_open_ctrl(self.devh, &self.strmh, &self.ctrl)
 if status != uvc.UVC_SUCCESS:
        raise InitError("Can't open stream control: Error:'%s'."%uvc_error_codes[status])

I have tried to run the Pupil Integrated Camera, which can work successfully.

Can you help me? Looking forward to your reply.

Sample code not giving any output neither any error

Hi,
I built libuvc in windows without any error following your instructions. I wrote few lines just to check if it is working. It is running without any error but it is also not printing out anything.

Screenshot (33)

main.cpp

#include <iostream>
#include <libuvc/libuvc.h>

int main(){
  std::cout<<"UVC Test:"<<std::endl;
  uvc_context_t *ctx = nullptr;
  uvc_error_t res = uvc_init(&ctx, nullptr);
  if (res < 0)
    {
        uvc_perror(res, "uvc_init error");
        std::cout<<"error"<<std::endl;
    }
    uvc_exit(ctx);
    std::cout<<"Done!"<<std::endl;
  return 0;
}

CMakeLists.txt

cmake_minimum_required(VERSION 3.0.0)
project(WebCam_MicrosoftMediaFoundation VERSION 0.1.0)

include_directories(include)
file(GLOB SOURCES "src/*.cpp")

find_package(OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )

set(libuvc_DIR C:/libuvc/build/CMakeFiles)
find_package(libuvc REQUIRED)
include_directories( C:/libuvc/include )

include(CTest)
enable_testing()

add_executable(OpenCV_Test
                ${SOURCES})

target_link_libraries( OpenCV_Test ${OpenCV_LIBS} C:/libuvc/build/Release/uvc.lib)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

Only few streaming lines on windows in UVC_FRAME_FORMAT_YUYV

Hi,

I'm using your libusb and libuvc with opencv.

My device support UVC_FRAME_FORMAT_YUYV mode.

On Linux I can get a full frame streaming but on windows i can get only few lines of video streaming, but that few lines are working at least :)

screenshot_20171110_115932

Any idea on how I can fix that?

I'm on windows 10, device driver libusbK (v3.0.7.0). Tested with many device, same results.

Thank you for your great work on windows platform.

How to "block" a command

When sending a command, for example uvc_set_pantilt_abs, it may take several seconds to complete the move. Is there a way to get feedback as to when the command has completed?

unable to receive uncompressed image frames directly from camera

Hi - Is it possible to receive uncompressed (YUYV) image frames directly from cameras without having to decode?

I am passing UVC_FRAME_FORMAT_YUYV in uvc_get_stream_ctrl_format_size like this
status = uvc_get_stream_ctrl_format_size ( devh, &ctrl, UVC_FRAME_FORMAT_YUYV, 640, 480, 30)

In the received uvc_frame, frame_format(uvc_frame_format) is UVC_FRAME_FORMAT_YUYV which is correct but the frame dump shows it is still an mjpeg frame. Please tell me what am I missing here.

OS - Windows 10, Cameras - USB cameras in Pupil ET addon for Oculus DK2
Camera Device Configuration file attached
camera_configuration.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.