Skip to content

Latest commit

 

History

History

camera-binding

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Camera binding java

Canon (EDSDK) EOS SDK binding in java

Bindings generation

Bindings are generated via maven plugin jnaerator and execute

jnaerator:generate

Bindings are manually modified and some methods removed (deprecated). Reason behind is class names are wrong for structures and a generated overloaded method is wrongly typed which fails compilation.

Type safe

Bindings have been modified to ensure type-safe for most functions of library.

Technology used for bindings

JNA has been chosen over BridJ as headers (*.h) are in C and to keep same technology with previous project.

Execution time between JNA and BridJ should not affect camera communications.

Mapping between Java and Native

Prefer ByReference style

JNAerator GitHub

JNAerator wiki

JNA config

Mode 'Directory' is used but 'Maven' or 'AutoGeneratedMaven' output same result.

JNA error

If get:

org.anarres.cpp.InternalException: Bad token [Invalid65279@1,0]:"TOK65279"

Can solve with:

grep -rl $'\xEF\xBB\xBF' . | xargs perl -i -pe 's{\xEF\xBB\xBF}{}'

Headers file from Canon SDK have some bad encoding characters.