gphoto2-sys

Crates.iogphoto2-sys
lib.rsgphoto2-sys
version0.1.2
sourcesrc
created_at2015-10-10 20:30:44.50657
updated_at2017-12-03 23:09:55.211184
descriptionFFI bindings to libgphoto2
homepagehttps://github.com/dcuddeback/gphoto2-sys
repositoryhttps://github.com/dcuddeback/gphoto2-sys
max_upload_size
id3193
size41,193
David Cuddeback (dcuddeback)

documentation

README

libgphoto2 Rust Bindings

The gphoto2-sys crate provides declarations and linkage for the libgphoto2 C library. Following the *-sys package conventions, the gphoto2-sys crate does not define higher-level abstractions over the native libgphoto2 library functions.

Dependencies

In order to use the gphoto2-sys crate, you must have a Unix system with the libgphoto2 library installed where it can be found by pkg-config.

On Debian-based Linux distributions, install the libgphoto2-dev package:

sudo apt-get install libgphoto2-dev

On OS X, install libgphoto2 with Homebrew:

brew install libgphoto2

Usage

Add gphoto2-sys as a dependency in Cargo.toml:

[dependencies]
gphoto2-sys = "0.1.2"

Import the gphoto2_sys crate and use the functions as they're defined in the native libgphoto2 library. See the libgphoto2 API documention for more usage information.

extern crate gphoto2_sys as gphoto2;

OS X Usage

OS X opens cameras automatically when connected, which prevents other applications from opening the camera device. When attempting to open a camera that is already opened by the operating system, you will get an error message like the following:

Could not claim the USB device

To fix this, you have to kill the PTPCamera process after connecting a camera to your system:

killall PTPCamera

Each camera is opened with a separate instance of the PTPCamera application. If you have several cameras connected, you may want to kill individual PTPCamera processes instead of using killall.

Finding Help

Since gphoto2-sys does nothing more than export symbols from the native libgphoto2 library, the best source for help is the information already available for the native libgphoto2:

License

Copyright © 2015 David Cuddeback

Distributed under the MIT License.

Note: By using this crate, your executable will link to the libgphoto2 C library, which is licensed under the LGPL version 2.1.

Commit count: 13

cargo fmt