inspirit / PS3EYEDriver

PS3EYE Camera Driver for OSX and Windows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I compile/use this?

clemens-tolboom opened this issue · comments

The link https://github.com/libusbx/libusbx is dead but https://github.com/libusbx has project https://github.com/libusbx/libusb-compat-0.1

Next I installed brew install libusb

PS3EYEDriver/sdl % make
make: sdl2-config: Command not found
c++ -I../src -I. -std=c++11 -O3 -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0    -c -o main.o main.cpp
main.cpp:7:10: fatal error: 'SDL.h' file not found
#include <SDL.h>

Next brew install sdl2

PS3EYEDriver/sdl % make              
c++ -I../src -I. -std=c++11 -O3 -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -I/usr/local/include/SDL2 -D_THREAD_SAFE   -c -o main.o main.cpp
c++ -I../src -I. -std=c++11 -O3 -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -I/usr/local/include/SDL2 -D_THREAD_SAFE   -c -o ../src/ps3eye.o ../src/ps3eye.cpp
../src/ps3eye.cpp:403:16: warning: braces around scalar initializer [-Wbraced-scalar-init]
        exit_signaled({ false }),
                      ^~~~~~~~~
../src/ps3eye.cpp:404:22: warning: braces around scalar initializer [-Wbraced-scalar-init]
        active_camera_count({ 0 })
                            ^~~~~
2 warnings generated.
c++ -I../src -I. -std=c++11 -O3 -I/usr/local/Cellar/libusb/1.0.20/include/libusb-1.0 -I/usr/local/include/SDL2 -D_THREAD_SAFE   -c -o ../src/ps3eye_capi.o ../src/ps3eye_capi.cpp
c++ -o ps3eye_sdl main.o ../src/ps3eye.o ../src/ps3eye_capi.o -L/usr/local/Cellar/libusb/1.0.20/lib -lusb-1.0 -L/usr/local/lib -lSDL2

Running the code

PS3EYEDriver/sdl % ./ps3eye_sdl       
Renderer: opengl
Camera mode: 640x480@60
FPS: 53.68
FPS: 60.04
FPS: 60.04
FPS: 59.98

so it work but I expected I could use the camera with ie Skype or ScreenFlow.

What do I miss?

You didn't miss anything. PS3EYEDriver is more of a wrapper around libusb for convenient PS3 Eye interfacing than it is a true driver. The camera is not installed and available to use as a system-identifiable webcam. In Linux it works because a true driver is built into the kernel. In Windows it can work with the non-free CL Eye Driver.

PS3EYEDriver does most of the hard work in implementing a real system-level driver. It would be up to someone else to write the OS interface. Or, it might be possible to hack macam or something similar to support PS3EYEDriver.

Thanks for the prompt answer. Not sure what I'll do next.

Maybe you could use my warnings?

And add my brew commands to the README?

brew install libusb
brew install sdl2
cd sdl
make

Thanks anyway :-)

'Teach a man to fish...'

  1. Fork the repo.
  2. Create a branch called something like 'sdl_osx_doc': git checkout -b sdl_osx_doc
  3. Add a file called README.macos to PS3EYEDriver/sdl
    • In this file, add a note about how to install homebrew, and the commands to install libusb and sdl2
  4. Add a file called README.md to PS3EYEDriver/sdl that says something like "See platform-specific README files"
    • Note that no sane *nix user would ever use PS3EYEDriver because the camera is supported in the kernel. Win/Mac is sufficient.
  5. Push to your fork. git push --set-upstream origin sdl_osx_doc
  6. Create a pull request in GitHub.
  7. Pat yourself on the back and accept our gratitude.

Bonus:

  1. Checkout master again. git checkout master
  2. Create a new branch for the new edit. git checkout -b sdl_makefile_nowarn
  3. Modify PS3EYEDriver/sdl/makefile by adding a line like CXXFLAGS += -Wbraced-scalar-init (near line 7 seems good).
  4. Push to your fork. git push --set-upstream origin sdl_makefile_nowarn
  5. Create a pull request in Github.

On MacOS also pkg-config is needed:

brew install pkg-config