Code Monkey home page Code Monkey logo

edsdk4j's Introduction

EDSDK4J

Purpose

This is a Java wrapper around the Canon EOS Digital Software Development Kit EDSDK that gives you full access to your Canon SLR camera on Windows*. The features include:

  • Taking and downloading pictures
  • Manually adjusting focus
  • Setting apperature, exposure, ISO
  • Accessing live view

(*) With a few changes it might also work on Mac OSX.

Project

Documentation/Issues

Distribution

Available at Maven Central see

http://search.maven.org/#artifactdetails%7Ccom.bitplan%7Cedsdk4j%7C0.0.1%7Cjar

Maven dependency:

<dependency>
  <groupId>com.bitplan</groupId>
  <artifactId>edsdk4j</artifactId>
  <version>0.0.1</version>
</dependency>

How to build

You might want to make sure that you have your ESDK in place - see "Applying with Canon for ESDK ..." below

git clone https://github.com/kritzikratzi/edsdk4j
cd edsdk4j
mvn install -Dgpg.skip=true

Testing

Before running the Unit Tests you might want to connect your camera with an USB cable and make sure that no other application is using the USB connection to your camera.

If you have a maven command line installed you can run the tests from the command line with:

mvn test

or run the tests in you IDE.

  • e.g. in Eclipse click pom.xml and choose "Run As/Maven test".
  • e.g. in Eclipse you can run the src/main/test/TestSuite with "Run As/JUnit Test"

expected mvn test result

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running edsdk.TestCanonConstants
Begin checking whether CanonConstants has all constants from EdSdkLibrary
Completed checking
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.382 sec
Running edsdk.TestEDSDK
Camera saved an image file
Saved photo as: C:\Users\wf\AppData\Local\Temp\IMG_0001.JPG
EdsImageQuality_LJF/1310479
EdsImageQuality_LJN/1244943
EdsImageQuality_MJF/18087695
EdsImageQuality_MJN/18022159
EdsImageQuality_SJF/34864911
EdsImageQuality_SJN/34799375
EdsImageQuality_LRLJF/6553619
EdsImageQuality_LR/6618895
Canon Camera: Canon EOS 1000D is connected

Interrupt received in CanonCamera, stopping...
EDSDK Dispatcher thread says bye!
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 9.958 sec
Running edsdk.TestJNA
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running edsdk.TestLibrary
Versions:
ProductVersion   FileVersion      FileName                                     
--------------   -----------      --------                                     
3.4.20.6404      3.4.20.6404      C:\Users\wf\workspace\edsdk4j\EDSDK_64\EDS...



Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.346 sec
Hello, World
Argument 0: Welcome
Argument 1: to
Argument 2: JNA

Results :

Tests run: 8, Failures: 0, Errors: 0, Skipped: 0

Applying with Canon for ESDK Software Development kit access

Before you can use this library you need to obtain the EDSDK native library from Canon. You can do so via their developers program:

Once you were granted access - this may take a few days - download the latest version of their library and follow the usage instructions.

Architecture

edsdk4j architecture overview

Using the EDSDK from Java directly is possible using the edsdk.native package, but because of threading difficulties and the involved data types this can be a bit painful. In the edsdk.utils package you find a small layer built on top of the EDSDK that gives you more Java-like examples.

Most notably, all calls have synchroneous and async calls. The async variants give you a CanonTask and you can choose if you want to wait for the result or be notified when it's done.

CanonCamera slr = new CanonCamera(); 
slr.openSession();

// Use the blocking variant to get a result immediately. 
File file = slr.shoot()[0]; 
System.out.println( "File: " + file.getAbsolutePath() );

// Use async handlers to continue your code immediately 
slr.shootAsync().whenDone( f -> System.out.println( f ) ); 

// close session is always blocking.
// because commands are queued this won't be executed 
// until the above slr.shoot() finished it's work. 
slr.closeSession(); 

Pay attention to the parameters you're setting!

The EDSDK does not check whether the parameters you're setting are actually suitable for your camera model. This can lead to very strange and possibly unfixable configurations, in the worst case you can brick your camera with the infamous error 99.

I mostly tested with the EOS550/600 and had no problems so far, but one user reported a repair estimate of 400€ after bricking a 50D by just changing the quality setting. See #20 It's hard to tell what happened exactly and I'm almost 100% certain that that's not normal, but please be aware there is a slim chance of this happening to you as well.

Getting started

	CanonCamera slr = new CanonCamera(); 
	slr.openSession();
	File file = slr.shoot()[0]; // (*)
	slr.closeSession();
	
	(*) If you have raw+jpeg enabled you'll have two 
	images in that array. Usually it's just one. 

For more look at the examples in src/gettingstarted.

Notes

In case you need to regenerate the JNA wrapper classes:

set EDSDK_HOME=path-to-edsdk
ant generate-wrapper

This does not need to be run, unless you want to regenerate the bindings for the latest version of the EDSDK because you need to use the newest features.

Issues:

  • Currently JNAerator is not detecting __stdcall correctly so the Callbacks defined in EdSdkLibrary need to be manually modified to extend StdCallCallback. Technically EdSdkLibrary itself should also extend StdCallLibrary but it's possible to workaround this using options passed into the Native.loadLibrary() method (see CanonCamera class for this workaround).

Version history

  •  : pre 2014-08    https://github.com/kritzikratzi/edsdk-processing
    
  •  :     2014-08    https://github.com/kritzikratzi/edsdk4j
    
  • 0.0.1: 2016-08-24 First mavenized release via GitHub / Maven central

Links

EDSDK4J on github

Canon EDSDK questions on Stackoverflow

JNA

jnaerator

edsdk4j's People

Contributors

anantapalani avatar carstenartur avatar guimeira avatar kritzikratzi avatar wolfgangfahl avatar yeroc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edsdk4j's Issues

Java(TM) SE binary has stopped working

Hi,
Really grateful for what you've done with this! Very helpfull and great to use.
I've tried your examples and then started my own small project.
In combination with a JavaFX UI I'm trying to make a small easy to use photobooth, to use on a friends party.

I have 'some' experience in Java but not that much with threads and external libraries/wrappers. The problem I have is that most of the times (not everytime) when I call the 'shoot' command I get the above mentioned error... no exceptions or other errors, just my app crashes and I get the 'Java(TM) SE binary stopped working.'... I already tried a few things, also the shootAsync gives me the same issue.

Strange thing is that sometimes it just works... (but that's like 1/10 or even less)
Now I use it in it's simplest form (I think):
File file = new File("C:/.../Desktop/test.jpg"); camera.openSession(); camera.shoot(EdsSaveTo.kEdsSaveTo_Host, 3, file); camera.closeSession();
My camera (EOS 550D) actually takes the picture, and then gives the error.

Also sometimes the picture gets saved to the desired location as '...Desktop/test.jpg' but most of the times it doesn't (but that looks like another problem?).

When I try the liveView I have no troubles. I can start it and stop it and start it again... (also in my JavaFX UI).

So I'm not sure what the problem is...
I've already downloaded the latest jre and jdk (or could that be the issue), or could it be something else... Maybe you (or someone) already encountered this issue?

Best regards

MacOSX support

Today I experimented a bit with the https://github.com/WolfgangFahl/edsdk4j fork with intention to get MacOSX support running. Unfortunately it looks the latest 3.4 ESDK is not compatible with the current Java code. Regenerating the wrapper-classes also didn't quite work.

The User32.peekMessage approach probably would have to be totally reworked for OSX. What else would have to be done?

E04_LiveView as JApplet

Hi, The file E04_LiveView.java has a main method,
I removed it and added Applet's init method by extending to JApplet like below, It is giving
public class E04_LiveView extends JApplet{
// public static void main( final String[] args ) throws InterruptedException {
//public void init() {
....
Getting below error, but its fine when I use the main method, What might be the issue Hans ?
Java Architecture: x86 - Using EDSDK DLL: EDSDK/Dll/EDSDK.dll
java.lang.UnsatisfiedLinkError: Unable to load library 'EDSDK/Dll/EDSDK.dll': The specified module could not be found.

Cannot find CanonUtils.class [from Oliver Ellmers]

Oliver Elmers:
[quote]
I am currently building an application with your edsdk library for processing, where I need control over a 5D MK2 EOS camera.

The example sketches and my own sketch cannot find the edsdk.utils.CanonConstants class.

I was wondering if either of you two would be able to shine some light on my situation.

All the best!
[/quote]

edsdk\utils\CanonUtils.java is compilation failing with jdk1.6.0.10 version

Hello Hans, How are you..
CanonUtils.java is compiling failing using jdk 1.6, but its compiling fine in jdk 1.7

Compilation Error :

edsdk\utils\CanonUtils.java:[469,49] type parameters of T cannot be determined; no unique maximal instance exists for type variable T with upper bounds T,java.lang.Object

Thanks, Chaithanya.

computing library version using jna

it would be good to be able to check the library version from within the java code. Best would be a method to return the version within the edsdk4j api. For the moment just added a test to show how it can be done using jna. Can this method be integrated into the edsdk4j jar? see #28

EsdSaveImage

I'm getting a ESD_ERR_NOT_SUPPORTED error from EsdSaveImage. Here's a simple case that fails (error checking for other calls has been removed but these calls all succeed provided you've got an input RAW file in the right place). Btw, you don't need a camera attached to run this.

__EdsObject inStream[] = new __EdsObject[1];
ByteBuffer name = ByteBuffer.allocate(100);
name.put(Native.toByteArray("Test.CR2"));
EDSDK.EdsCreateFileStream(name, EdSdkLibrary.EdsFileCreateDisposition.kEdsFileCreateDisposition_OpenExisting, EdSdkLibrary.EdsAccess.kEdsAccess_Read, inStream);

__EdsObject imgRef[] = new __EdsObject[1];
EDSDK.EdsCreateImageRef(inStream[0], imgRef);

__EdsObject outStream[] = new __EdsObject[1];
name = ByteBuffer.allocate(100);
name.put(Native.toByteArray("output.jpg"));
EDSDK.EdsCreateFileStream(name, EdSdkLibrary.EdsFileCreateDisposition.kEdsFileCreateDisposition_CreateAlways, EdSdkLibrary.EdsAccess.kEdsAccess_Write, outStream);

EdsSaveImageSetting.ByValue set = new EdsSaveImageSetting.ByValue();
set.JPEGQuality = new NativeLong(8);
set.iccProfileStream = null;
NativeLong err = EDSDK.EdsSaveImage(imgRef[0], EdSdkLibrary.EdsTargetImageType.kEdsTargetImageType_Jpeg, set, outStream[0]);
System.out.printf("Save image error = 0x%x\n", err.intValue());

The C equivalent works as a console app. But putting the working C code into a dll and calling it from Java via JNI does not work. This makes me think there is something that EsdSaveImage is expecting from the calling environment that is missing when called from Java. But I don't know enough about that sort of low level Windows development to guess what it might be (I did try adding a CoInitalizeEx() call as mentioned in the SDK docs).

Incidentally the above code works with EDSDK 1.3, but not with any 2.x version I've tried.

Can't find where to put EDSDK.dll

Hi,

I'm trying to set up an Eclipse workspace to try your library.
I've downloaded the SDK from Canon and your library.

I've copied your library somewhere on my harddrive, and put the complete EDSDK folder I've downloaded from Canon at the root of your folder.
[...]edsdk4j-master\EDSDK\Dll

I then created a new Eclipse Workscape and imported the edsdk4j project.
Except some warnings, Eclipse is not complaining about anything.

But when I'm trying to run one of your sample, execution inevitably fails when trying to load the EDSDK dll.

I've tried copying the complete EDSDK folder in several places with no success. I've also tried copying the DLL folder from EDSDK on the root of my hard drive and changing the path to the DLL in the source code with no effect.

Could you please help me with this issue?

Many thanks!
Best greetings,
Terry

CloseSession freeze program

Somtimes function CloseSession freeze program. Nothing help, only power on and power off camera. Why this can be. How i can solve this problem ?

Strange java.lang.UnsatisfiedLinkError: Unable to load library

Hello!

I'm also getting the error on Unable to load library. After reading previous reports I've double checked all possible places where dll could be placed.

I've added file checking right to the code, so please see the output:

Java Architecture: amd64 - Using EDSDK DLL: C:/edsdk4j/EDSDK.dll
C:\edsdk4j.
file:C:\edsdk4j.classpath
directory:C:\edsdk4j.externalToolBuilders
directory:C:\edsdk4j.git
file:C:\edsdk4j.gitignore
directory:C:\edsdk4j.idea
file:C:\edsdk4j.project
directory:C:\edsdk4j.settings
file:C:\edsdk4j\arch.png
directory:C:\edsdk4j\bin
file:C:\edsdk4j\build.xml
file:C:\edsdk4j\config.jnaerator
file:C:\edsdk4j\DPPDLL.dll
file:C:\edsdk4j\DPPLibCom.dll
file:C:\edsdk4j\DPPRSC.dll
directory:C:\edsdk4j\EDSDK
file:C:\edsdk4j\EDSDK.dll
file:C:\edsdk4j\edsdk4j.iml
file:C:\edsdk4j\EdsImage.dll
directory:C:\edsdk4j\lib
file:C:\edsdk4j\license.txt
file:C:\edsdk4j\MLib.dll
file:C:\edsdk4j\README.md
file:C:\edsdk4j\readme.txt
directory:C:\edsdk4j\src
file:C:\edsdk4j\Ucs32P.dll
true
Exception in thread "Main Thread" java.lang.UnsatisfiedLinkError: Unable to load library 'C:/edsdk4j/EDSDK.dll': The specified module could not be found.

I have placed sdk's dlls to the working directory of the project as you can see from my output. And I haveset edsdkDllLoc = "C:/edsdk4j/EDSDK.dll"; to the real file path

So the problem is still unclear for me... I'm using jdk 1.6.0_45 for this project and run SinglePhoto.java with -d32 -Djava.library.path=C:\edsdk4j options (and tried without them)

Unrecognized calling convention: 3

Hey there! I was using your library sucessfully in a project but now my hdd blew and i had to re setup my project files. Now i am getting the "java.lang.IllegalArgumentException: Unrecognized calling convention: 3" error from jna.

i searched the whole web and tried to run the code with a 32bit jre, and tried different JNA versions and also tried to regenerate the JNA wrapper classes. i am not the moset versitile programmer, so did i miss something obvious?

java.lang.IllegalArgumentException: Unrecognized calling convention: 3 at com.sun.jna.Function.checkCallingConvention(Function.java:217) at com.sun.jna.Function.<init>(Function.java:168) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:344) at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:324) at com.sun.jna.Library$Handler.invoke(Library.java:203) at com.sun.proxy.$Proxy0.EdsInitializeSDK(Unknown Source) at edsdk.api.CanonCamera.dispatchMessages(CanonCamera.java:118) at edsdk.api.CanonCamera.access$000(CanonCamera.java:55) at edsdk.api.CanonCamera$1.run(CanonCamera.java:96)

Live view throwing 'error 97' after a few seconds of working (50D)

Hi Hansi!

Thank you so much for your library. It's incredible how easy it is to use.

I have been trying to use it with my canon 50D camera. The library used to work fine, but now the live view goes blank after a few seconds of working and I get a repeating error message :

"Could not check live view status: An error occurred while getting kEdsPropID_Evf_Mode data (error 97: EDS_ERR_INVALID_HANDLE - Function Handle Error)"

I commented out all the setting/quality changes, etc to see if any of those are affecting it but no luck. I am getting the same erratic behavior with the basic "Hello.pde" that you provided.

Did anyone else encounter something like this? what could be causing the problem?

Thanks!

Video Recording

please provide functionalty to record video using edsdk as , canon mention in his documentation of version 2.13 that now we can record video from canon camera.

JNAeration failed ! org.anarres.cpp.InternalException: Bad token [╗@1,1]:"╗"

wrapper could not be generated see image (or text following).

Is that due to Java 8?

C:\Users\Marcel\workspace\edsdk4j-master>ant generate-wrapper
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre8\li
b\tools.jar
Buildfile: C:\Users\Marcel\workspace\edsdk4j-master\build.xml

generate-wrapper:
[exec] Aug 19, 2014 9:38:22 PM com.ochafik.admin.visualstudio.VisualStudioU
tils getProp
[exec] INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
[exec] Aug 19, 2014 9:38:22 PM com.ochafik.admin.visualstudio.VisualStudioU
tils getProp
[exec] INFO: [environment] VISUAL_STUDIO_HOME=C:\Program Files (x86)\Micros
oft Visual Studio 9.0
[exec] Aug 19, 2014 9:38:22 PM com.ochafik.admin.visualstudio.VisualStudioU
tils getProp
[exec] INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
[exec] Aug 19, 2014 9:38:22 PM com.ochafik.admin.visualstudio.VisualStudioU
tils getProp
[exec] INFO: [environment] WINDOWS_SDK_HOME=C:\Program Files (x86)\Microsof
t SDKs\Windows\v6.0A
[exec] Aug 19, 2014 9:38:22 PM com.ochafik.admin.visualstudio.VisualStudioU
tils getProp
[exec] INFO: [environment] VISUAL_STUDIO_INCLUDES=C:\Program Files (x86)\Mi
crosoft Visual Studio 9.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windo
ws\v6.0A\Include
[exec] JNAeration failed !
[exec] org.anarres.cpp.InternalException: Bad token [╗@1,1]:"╗"
[exec] at org.anarres.cpp.Preprocessor._token(Preprocessor.java:1745)
[exec] at org.anarres.cpp.Preprocessor.token(Preprocessor.java:1977)
[exec] at org.anarres.cpp.CppReader.refill(CppReader.java:93)
[exec] at org.anarres.cpp.CppReader.read(CppReader.java:125)
[exec] at org.anarres.cpp.CppReader.read(CppReader.java:136)
[exec] at java.io.Reader.read(Unknown Source)
[exec] at com.ochafik.io.ReadText.readText(ReadText.java:52)
[exec] at com.ochafik.lang.jnaerator.PreprocessorUtils.preprocessSource
s(PreprocessorUtils.java:61)
[exec] at com.ochafik.lang.jnaerator.JNAeratorParser.parse(JNAeratorPar
ser.java:191)
[exec] at com.ochafik.lang.jnaerator.JNAerator.parseSources(JNAerator.j
ava:1111)
[exec] at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:
816)
[exec] at com.ochafik.lang.jnaerator.JNAerator$1.finished(JNAerator.jav
a:716)
[exec] at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$ArgsParse
r.parse(JNAeratorCommandLineArgs.java:98)
[exec] at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:290)

 [exec]     at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:171)

 [exec] Finished with errors.

BUILD SUCCESSFUL
Total time: 1 second

C:\Users\Marcel\workspace\edsdk4j-master>
capture

ant generate-wrapper is failing "[exec] # ERROR: JNAeration failed !"

Hi, Thanks first for this great java wrapper..
Below is the log in console when I run the ant build.xml
Some questions :

  1. What is this JNAeration used for ? but , "getting started" examples are executing well invoking my T2i Camera..though I get sometimes "Communication already in use" kind of error..

Console log :
Buildfile: C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master\build.xml
generate-wrapper:
[exec] Oct 17, 2014 4:13:10 PM com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
[exec] Oct 17, 2014 4:13:10 PM com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] VISUAL_STUDIO_HOME=C:\Program Files (x86)\Microsoft Visual Studio 9.0
[exec] Oct 17, 2014 4:13:10 PM com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
[exec] Oct 17, 2014 4:13:10 PM com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] WINDOWS_SDK_HOME=C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A
[exec] Oct 17, 2014 4:13:10 PM com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] VISUAL_STUDIO_INCLUDES=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Include
[exec] Credits: JNAerator is Copyright (c) 2008-2009 Olivier Chafik
[exec] Includes Anarres JCPP (Apache 2.0 license), Copyright (c) 2007-2008, Shevek
[exec] Includes Java Native Access (JNA) (LGPL license), Copyright (c) 2006-2009 Todd Fast, Timothy Wall, Wayne Meissner and others
[exec] Includes Rococoa (LGPL license), Copyright (c) Copyright Duncan McGregor and others
[exec] Includes ANTLR's runtime (BSD license), Copyright (c) 2003-2008, Terence Parr
[exec] Licensing & Copyright details : http://code.google.com/p/jnaerator/wiki/CreditsAndLicense
[exec] <file: OptionalFile>
[exec] Any header (or directory containing headers at any level of hierarchy), shared library, .bridgesupport file or *.jnaerator file
exec-noComp
exec Do not compile JNAerated headers
exec-noJar
exec Do not create an output JAR
exec-noLibBundle
[exec] Do not bundle libraries in output JAR
[exec] -?-h(?:elp)?
[exec] Show command line arguments help
[exec] -D([^=]
)(?:=(.))? <name: String> <value: String>
[exec] Define a macro symbol
[exec] -F(.+)? <dir: File>
[exec] Add a directory to the frameworks path. See doc of JNAERATOR_FRAMEWORKS_PATH
[exec] -I(.+)? <dir: File>
[exec] Add a directory to the include path or include a file. See doc of JNAERATOR_INCLUDE_PATH
[exec] -T([^=]
)(?:=(.))? <name: String> <value: String>
[exec] Define a type symbol
[exec] -U(.+) <symbolName: String>
[exec] Undefine a preprocessor symbol after the autoconfiguration phase.
[exec] -addRootDir <dir: ExistingDir>
[exec] Remove this directory from the path of descendant source files in the generated documentation.
[exec] -allowedFileExts <extensions: String>
[exec] Colon-separated list of file extensions used to restrict files used when recursing on directories, or "
" to parse all files (by default = h:hpp:hxx)
[exec] -arch <archName: linux_x64 | linux_x86 | armeabi | sunos_x86 | sunos_sparc | darwin_universal | win32 | win64>
[exec] Define the current architecture for libraries (state variable)
[exec] -beanStructs
[exec] Generate getters and setters for struct fields (JNA & JNAerator runtimes only)
[exec] -beautifyNames
[exec] Transform C names to Java-looking names : some_func() => someFunc()
[exec] -bridgeSupportOut <outFile: OutputFile>
[exec] Write the definitions extracted from bridgesupport files in a file (automatically set when ${Verbose} is used).
[exec] -callbacksInvokeMethodName <methodName: String>
[exec] Name of the invocation method of callbacks ('apply' by default)
[exec] -choices <choicesFile: ExistingFile>
[exec] Read the function alternative choices from a file in the format used by -choicesOut.
[exec] -choicesOut <outFile: OutputFile>
[exec] Write the function alternative choices made (automatically set when ${Verbose} is used).
[exec] -com
[exec] Generate Microsoft COM (C++) bindings.
[exec] -convertBodies
[exec] Experimental conversion of function bodies to equivalent Java code (BridJ only).
[exec] -defaultLibrary <libName: String>
[exec] Name of output library for elements declared in files not covered by a ${CurrentLibrary} switch
[exec] -direct
[exec] JNAerate libraries that use JNA's faster direct call convention
[exec] -dontCastConstants
[exec] Don't cast generated constants
[exec] -emptyStructsAsForwardDecls
[exec] Treat empty structs as forward declarations
[exec] -entryClass <entryClassName: String>
[exec] Generate a class entryclassName.EntryClassName that will contain all of the jnaerated libraries instances. User code will just need to static import or derive from this class to access to the instances.
[exec] -extractionOut <outFile: OutputFile>
[exec] Write the symbols extracted from libraries in a file (automatically set when ${Verbose} is used).
[exec] -f
[exec] Force the overwrite of existing files
[exec] -fpreprocessed
[exec] Consider source files as being already preprocessed (preprocessor won't be run)
[exec] -framework <frameworkName: String>
[exec] JNAerate a framework using its headers and its .bridgesupport files if available
[exec] -frameworksPath <path1:path2...: String>
[exec] See doc of JNAERATOR_FRAMEWORKS_PATH
[exec] -gccLong
[exec] Use GCC convention for size of 'long' (4 bytes on 32 bits platforms, 8 bytes on 64 bits platforms).
[exec] -genCPlusPlus
[exec] [Experimental, Not working at all] Generate C++ classes.
[exec] -genPrivateMembers
[exec] Generate wrappers for private fields and methods (will be protected and deprecated).
[exec] -genRawBindings
[exec] Generate raw bindings amenable for assembler optimizations.
[exec] -gui
[exec] Show minimalist progression GUI
[exec] -ifRegexMatch <javaProperty: String> <regex: String> <thenArg: String> <elseArg: String>
[exec] Conditional evaluation of an argument if a java system property matches a regular expression
[exec] -jar <outFile: OutputFile>
[exec] Jar file where all generated sources and the compiled classes go
[exec] -libFile <resourceFile: ExistingFile>
[exec] Bundle the provided file with the JNAerated JAR so that it is extracted with the library when it is first used.
[exec] -library <libName: String>
[exec] Define the name of the output library. This is a state parameter, it will affect all files listed after it, until another -library switch is provided. It does not affect sources included from a project file (Visual Studio...).
[exec] C functions exported in library "test" will end up in class "TestLibrary", for instance.
[exec] The name of the library is the one fed to JNA to find the shared library, so library "test" must be in "test.dll" on Windows, "libtest.dylib" on Mac OS X and "libtest.so" on other Unices.
[exec] Note that a special hack is done for library "c" on Windows systems : the output name is set to "msvcrt" instead of "c".
[exec] -libraryNamingPrefixes <commaSeparatedPrefixes: String>
[exec] Define prefixes commonly used in the library so that reification of functions is optimal (See -reification)
[exec] -limitComments
[exec] Avoid useless comments (source file + line, skipped items...)
[exec] -macrosOut <outFile: OutputFile>
[exec] Write the preprocessor macros in a file (automatically set when ${Verbose} is used).
[exec] -mavenArtifactId <artifactId: String>
[exec] Set artifact id of the generated Maven project
[exec] -mavenGroupId <groupId: String>
[exec] Set group id of the generated Maven project
[exec] -mavenVersion <version: String>
[exec] Set version of the generated Maven project
[exec] -maxConstrFields <fieldCount: Int>
[exec] Maximum number of fields allowed for structure fields constructors. If a struct has more fields, it will only get a default constructor.
[exec] -mode <mode: 'Jar' : JAR with bindings only | 'StandaloneJar' : JAR with bindings and runtime dependencies | 'Directory' : Bindings sources in simple file hierarchy | 'Maven' : Bindings sources in Maven project ready to build | 'AutoGeneratedMaven' : Maven project that automatically regenerates its bindings>
[exec] Choose the output mode of JNAerator
[exec] -noAuto
[exec] No auto-configuration of preprocessor symbols and paths
[exec] -noAutoImport
[exec] Don't add import statements automatically to output java source files
[exec] -noComments
[exec] Don't output any member comment.
[exec] -noMangling
[exec] Don't output any C++ name mangling information (may cause C++-decorated symbols not to be found at execution time).
[exec] -noPrimitiveArrays
[exec] Never output primitive arrays for function arguments (use NIO buffers instead)
[exec] -noStringReturns
[exec] Prevent const char
and const wchar_t* return types from being converted to String and WString.
[exec] -nocpp
[exec] Do not define the _cplusplus symbol
[exec] -o <outDir: OutputDir>
[exec] Output directory for all artifacts
[exec] -onlineDoc <linkDisplayFormat: MessageFormat> <urlMessageFormat: MessageFormat>
[exec] Define a format for online documentation URLs (uses MessageFormat syntax, with arg 0 being the name of the function / structure).
[exec] -package <forcedPackageName: String>
[exec] Set the Java package in which all the output will reside (by default, set to the library name).
[exec] -parseChunks
[exec] Splits the pre-processor output into multiple smaller parts and parse them separately (in theory everything should be parsed in one chunk, but in practice this means errors are not isolated from the rest of the parsing)
[exec] -preferJavac
[exec] Use Sun's Javac compiler instead of Eclipse's ecj, if possible
[exec] -preprocessingOut <outFile: OutputFile>
[exec] Write the preprocessor output in a file (automatically set when ${Verbose} is used).
[exec] -project <solutionFile: ExistingFile> <"Config|Platform": String>
[exec] Read Visual Studio 2008 project or solution file and use the configuration specified (e.g. "Release|Win32").
[exec] -reification
[exec] Automatically create OO shortcuts for functions that look like methods (typedPtr.someFunc() for someFunc(typedPtr))
[exec] -removeInlineAsm
[exec] Remove inline asm from preprocessed source, useful when its unsupported syntax makes parsing to fail.
[exec] -root(?:Package)? <package: String>
[exec] Define the root package for all output classes
[exec] -runtime <enum: JNA | JNAerator (based on JNA) | BridJ (faster runtime that supports C++)>
[exec] Choose target runtime library between JNA, JNAerator (based on JNA), BridJ (faster runtime that supports C++) (default: BridJ (faster runtime that supports C++)).
[exec] -scalaOut <outDir: OutputDir>
[exec] [Experimental] Output Scala wrappers (callbacks implicits...)
[exec] -scalaStructSetters
[exec] Generate Scala-style setters for BridJ structs (with a name like fieldName
$eq)
[exec] -scanSymbols
[exec] Extract, unmangle and parse the symbols all listed shared libraries
[exec] -sizeAsLong
[exec] Treat size_t and ptrdiff_t values as 'long' values. ONLY HERE FOR COMPATIBILITY WITH PREVIOUS VERSIONS, WILL EVENTUALLY BE REMOVED.
[exec] -skipIncludedFrameworks
[exec] Skip Included Frameworks
[exec] -skipLibraryInstance
[exec] Skip library instance declarations
[exec] -structsInLibrary
[exec] Force structs to be JNAerated as inner classes of their declaring libraries (otherwise, each top-level structure is defined as a top-level class in its library's package)
[exec] -studio
[exec] Launch JNAeratorStudio
[exec] -synchronized
[exec] Generate synchronized native methods
[exec] -v(?:erbose)?
[exec] Verbose output (both console and files)
[exec] -wcharAsShort
[exec] Force treatment of wchar_t as short (char by default)
[exec] -wikiHelp
[exec] Output a wiki-friendly help
[exec] @(.+)? <argumentsFile.jnaerator: ExistingFile>
[exec] Read command-line arguments from a file. File may contain multiple lines (those beginning with "//" will be skipped), file wildcards will be resolved within the file content, as well as variables substitutions : $(someEnvOrJavaVarName), with $(DIR) being the parent directory of the current arguments file.
[exec] com.ochafik.lang.jnaerator.JNAerator$CommandLineException: Error parsing arguments :
[exec] config.jnaerator -o src -f -mode Directory -noMangling -runtime JNA -package edsdk -library EdSdk C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master/EDSDK/Header/EDSDKErrors.h C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master/EDSDK/Header/EDSDKTypes.h C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master/EDSDK/Header/EDSDK.h : java.io.FileNotFoundException: C:\Users\rbangaru\Adobe
[exec] at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$ArgsParser.parse(JNAeratorCommandLineArgs.java:133)
[exec] at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:239)
[exec] at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:212)
[exec] Caused by: java.io.FileNotFoundException: C:\Users\rbangaru\Adobe
[exec] at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$OptionDef$ArgDef.convertArg(JNAeratorCommandLineArgs.java:367)
[exec] at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$ArgsParser.parse(JNAeratorCommandLineArgs.java:123)
[exec] ... 2 more
[exec] #
[exec] # ERROR: JNAeration failed !
[exec] #
[exec] # Error parsing arguments :
[exec] # config.jnaerator -o src -f -mode Directory -noMangling -runtime JNA -package edsdk -library EdSdk C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master/EDSDK/Header/EDSDKErrors.h C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master/EDSDK/Header/EDSDKTypes.h C:\Users\rbangaru\Adobe Flash Builder 4.7\edsdk4j-master/EDSDK/Header/EDSDK.h : java.io.FileNotFoundException: C:\Users\rbangaru\Adobe
[exec] # Please use -h for help on the command-line options available.
[exec] #
BUILD SUCCESSFUL
Total time: 1 second

Cam detection in Win 64 bit machine

Hello, Am unable to get the canon 600d cam detected in Windows 7 64 bit machine although it worked with my Win 7 32 bit machine, tried with using JDK 6 and 7, Do you have any info of which systems are supporting this edsdk4j api, I know canon cam is compatible with Windows 7.
Pre Java 7 file:// is correct, and in java 7 or more is file:/// , Is this correct statement Hans?

TakePhoto error with SL1/100D

Hello

I'm getting an error sometimes when i take the photo. Sometimes it works fine but some other times it doesn't.

I call the shoot command, it processes the method run() and finishes it with ERR_OK.
It enters the final if on the mehtod run();
if ( err == EdsError.EDS_ERR_OK ) {
//System.out.println( "Took image, waiting for camera" );
notYetFinished();
}
But after that, nothing. It never goes into the mehtod apply().

I'm invoking the take picture method with:
final File[] photos = camera.shoot(EdsSaveTo.kEdsSaveTo_Host);

Do you have any tips on what i could check or what could be going wrong?

Sorry for my english..

Thanks.

Host computer save path

By default the image is saving to temp directory,am using WIndows 7 any way to change this?, because I need to upload the taken image file for cropping purposes.I need to generalize the file path, When I use the below hardcoded path the image is loading, but I do not know the user profile (xprk689) in other systems..
cropWindow.uploadedImage.source = "file:///C:/Users/xprk689/AppData/Local/Temp/IMG_0001.jpg";
tried with this but did not work , file:///%TEMP%/IMG_0001.jpg
Hope you got it, any ideas please ?

Using the dependency in Gradle

Hi I want to use the generated dependency in Gradle using compile 'com.bitplan:edsdk4j:0.0.1' but I don't know where to put the EDSDK dll. Could you please provide some info on this topic?

Some methods are package private

Why those methods are not accessible in EdSdkLibrary?

  • EdsSetCameraAddedHandler
  • EdsSetPropertyEventHandler
  • EdsSetCameraStateEventHandler

Should it not be public? So we can register some event handlers

Zoom

It's not an issue but a question.
How can I use zoom features during liveview mode?
Any example is helpful.

Thanks

JNAeration failed

Hi,
I followed all instructions and downloaded
the canon SDK file EDSDKv214W.zip

When i try to build the wrapper classes I get the error below. Any ideas?

Buildfile: C:\dev\canon\edsdk4j-master\build.xml

generate-wrapper:
[exec] 24-Jun-2014 08:36:14 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
[exec] 24-Jun-2014 08:36:14 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] VISUAL_STUDIO_HOME=C:\Program Files (x86)\Microsoft Visual Studio 9.0
[exec] 24-Jun-2014 08:36:14 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] ProgramFiles(x86)=C:\Program Files (x86)
[exec] 24-Jun-2014 08:36:14 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] WINDOWS_SDK_HOME=C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A
[exec] 24-Jun-2014 08:36:14 com.ochafik.admin.visualstudio.VisualStudioUtils getProp
[exec] INFO: [environment] VISUAL_STUDIO_INCLUDES=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include;C:\Program Fi
[exec] org.anarres.cpp.InternalException: Bad token [╗@1,1]:"╗"
[exec] at org.anarres.cpp.Preprocessor._token(Preprocessor.java:1745)
[exec] at org.anarres.cpp.Preprocessor.token(Preprocessor.java:1977)
[exec] at org.anarres.cpp.CppReader.refill(CppReader.java:93)
[exec] at org.anarres.cpp.CppReader.read(CppReader.java:125)
[exec] at org.anarres.cpp.CppReader.read(CppReader.java:136)
[exec] at java.io.Reader.read(Reader.java:123)
[exec] at com.ochafik.io.ReadText.readText(ReadText.java:52)
[exec] at com.ochafik.lang.jnaerator.PreprocessorUtils.preprocessSources(PreprocessorUtils.java:61)
[exec] at com.ochafik.lang.jnaerator.JNAeratorParser.parse(JNAeratorParser.java:191)
[exec] at com.ochafik.lang.jnaerator.JNAerator.parseSources(JNAerator.java:1111)
[exec] at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:816)
[exec] at com.ochafik.lang.jnaerator.JNAerator$1.finished(JNAerator.java:716)
[exec] at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$ArgsParser.parse(JNAeratorCommandLineArgs.java:98)
[exec] at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:290)
[exec] at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:171)
[exec] Finished with errors.
[exec] JNAeration failed !

Invalid Memory issue while executing E04-Live_View.java

Hi,
I am trying to run the java wrapper for my canon EOS 1300D and it is giving erro of type INVALID MEMORY ACCESS after debug i got the issue in this line "err = CanonUtils.toEdsError( CanonCamera.EDSDK.EdsCreateMemoryStream( new NativeLong( 0 ), streamRef ) );" after this line my code is giving error. please help.

EDSDK failed to initialize, most likely you won't be able to speak to your camera

Hi,

I am using edsdk to connect with cannon 1300d camera
I had done complete setup with ESSDK lib obtained from Canon Asia

I am using below configuration as per requirement
jdk 6u43 x64bit
edsdk4j

When i run any example code and HansiTest file. Windows shows error of Java not reponding. By checking into more example code. I came by below error

EDSDK failed to initialize, most likely you won't be able to speak to your camera

E01_Simple.java example directory

I am unable to understand how i should resolve this problem

Regards.

issue in edsdk4j invalid memory

Long datatype in c and java is different so This is a reason behind issue when executing this wrapper. So please help me to solve this issue.

Issue with Error 99 on EOS 50D

Hi there, first of all thank you for your library!

I got a 50D and got it working to capture images on request, live view etc.
But the transfer of the captured image took to long so i wanted to lower the image quality.

I used the E06_ListImageQuality to list all the qualities and choosed one.
Before the next capture the quality was set and there happened an exception.

Since this moment my cam is kinda broken. Every time i turn it on it says Error 99.
I did battery resets and nearly everything found in the internet.
I realized that i am able to go into the custom modes C1 and C2, there i can shoot pictures etc.
I also could reflash the firmware from the menu while in C Mode.
But everytime i switch back to another mode it always tells me Error 99.
I cannot make a factory reset cause this is not possible within C Mode Menus.

So anyone has an idea what i should do!?
My last hope currently is to send the camera to Canon, but i would love to prevent this if possible.

My idea of what happened is that maybe the camera quality i selected made an issue and is now the default setting. Within the custom modes there is a different setting and no problem.

For any help thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.