Testing libgphoto2/gphoto2 is a long winding task and currently requires physical cameras.

There is some testsuite, but it does not test the actual camera driver(s).

The idea was to write a virtual usb device in libgphoto2_port that emulates a PTP camera.

It should do regular behaviour, but it can also be improved to react on errors (like random unplug, bit errors, or even as a malicious device).

The virtual PTP camera can be found in https://github.com/gphoto/libgphoto2/tree/master/libgphoto2_port/vusb

It currently supports:

  • basic camera information
  • listing files (from a local directory)
  • downloading files (from a local directory)
  • downloading thumbnails (extracted using libexif)
  • deleting files (but only in the in-memory structure)
  • querying device properties (battery level and datetime implemented)
  • event handling via USB Interrupts
  • triggering capture and downloading captured images

Current state:

Future development steps:

  • tethering (external driven events)
  • random unplug testing
  • data protocol fuzzing

Looking for hackers with the skills:

Nothing? Add some keywords!

This project is part of:

Hack Week 13

Activity

  • over 8 years ago: msmeissn liked this project.
  • over 8 years ago: msmeissn started this project.
  • over 8 years ago: msmeissn originated this project.

  • Comments

    • msmeissn
      over 8 years ago by msmeissn | Reply

      The virtual PTP camera can be found in https://github.com/gphoto/libgphoto2/tree/master/libgphoto2_port/vusb

      It currently supports:

      • basic camera information
      • listing files (from a local directory)
      • downloading files (from a local directory)
      • downloading thumbnails (extracted using libexif)
      • deleting files (but only in the in-memory structure)
      • querying device properties (battery level and datetime implemented)

      The camera is recognized by gphoto2, digikam, darktable, gtkam, konqueror camera:// ioslave. (not visible by shotwell as it uses udev detection)

      Next to do: - add capture support - add event handling

      Future ideas: - random unplug testing - data fuzzing

    Similar Projects

    This project is one of its kind!