Crates.io | gphoto2-sys |
lib.rs | gphoto2-sys |
version | 0.1.2 |
source | src |
created_at | 2015-10-10 20:30:44.50657 |
updated_at | 2017-12-03 23:09:55.211184 |
description | FFI bindings to libgphoto2 |
homepage | https://github.com/dcuddeback/gphoto2-sys |
repository | https://github.com/dcuddeback/gphoto2-sys |
max_upload_size | |
id | 3193 |
size | 41,193 |
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.
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
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 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
.
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
:
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.