Skip to content

Commit

Permalink
* Disable DocLint, which prevents the build from succeeding on Java …
Browse files Browse the repository at this point in the history
…8 (issue javacpp#5)

 * Add `FlyCapture2FrameGrabber` with cross-platform support of FlyCapture2 (pull #45)
  • Loading branch information
saudet committed Nov 1, 2014
1 parent 9e5b16c commit 6f74e7b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 31 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

* Disable DocLint, which prevents the build from succeeding on Java 8 ([issue javacpp#5](https://github.com/bytedeco/javacpp/issues/5))
* Add `FlyCapture2FrameGrabber` with cross-platform support of FlyCapture2 ([pull #45](https://github.com/bytedeco/javacv/pull/45))
* Fix issue that would prevent `CanvasFrame` from working on Mac OS X with recent versions of the JDK ([issue #39](https://github.com/bytedeco/javacv/issues/39) and [issue #314](http://code.google.com/p/javacv/issues/detail?id=314))
* Upgrade `RecordActivity` sample with a continuous record loop, thanks to Federico Sendra and Juan Manuel Sobral
* Make `FrameGrabber.createDefault()` throw an exception on unsupported input, instead of returning a cryptic `null` ([issue #30](https://github.com/bytedeco/javacv/issues/30))
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ We can also have everything downloaded and installed automatically with:
}
```

* SBT (inside the `build.sbt` file)
* SBT (inside the `build.sbt` file)
```scala
classpathTypes += "maven-plugin"
libraryDependencies += "org.bytedeco" % "javacv" % "0.9"
```

Additionally, we need to either set the `platform.dependency` system property (via the `-D` command line option) to something like `android-arm`, or set the `platform.dependencies` one to `true` to get all the binaries for Linux, Mac OS X, and Windows.

Additionally, we need to either set the `platform.dependency` system property (via the `-D` command line option) to something like `android-arm`, or set the `platform.dependencies` one to `true` to get all the binaries for Linux, Mac OS X, and Windows. On build systems where this does not work, we need to add the platform-specific artifacts manually.


Required Software
Expand All @@ -69,17 +68,6 @@ Further, although not always required, some functionality of JavaCV also relies
Finally, please make sure everything has the same bitness: **32-bit and 64-bit modules do not mix under any circumstances**.


Build Instructions
------------------
To rebuild the source code, please note that the project files were created for:

* Maven 2 or 3 http://maven.apache.org/download.html
* JavaCPP 0.9 https://github.com/bytedeco/javacpp
* JavaCPP Presets 0.9 https://github.com/bytedeco/javacpp-presets

Once installed, simply call the usual `mvn install` command for JavaCPP, its Presets, and JavaCV. By default, all the dependencies listed above are NOT required, except for OpenCV and a C++ compiler for JavaCPP. Please refer to the comments inside the `pom.xml` files for further details.


Manual Installation for OpenCV and FFmpeg
-----------------------------------------
Simply put all the JAR files of JavaCPP, JavaCV, OpenCV, and FFmpeg (`javacpp.jar`, `javacv.jar`, `opencv-*.jar`, and `ffmpeg-*.jar`, respectively) somewhere in your CLASSPATH. Here are some more specific instructions for common cases:
Expand Down Expand Up @@ -261,6 +249,17 @@ public class Demo {
```


Build Instructions
------------------
If the binary files available above are not enough for your needs, you might need to rebuild them from the source code. To this end, the project files were created for:

* Maven 2 or 3 http://maven.apache.org/download.html
* JavaCPP 0.9 https://github.com/bytedeco/javacpp
* JavaCPP Presets 0.9 https://github.com/bytedeco/javacpp-presets

Once installed, simply call the usual `mvn install` command for JavaCPP, its Presets, and JavaCV. By default, no other dependencies than a C++ compiler for JavaCPP are required. Please refer to the comments inside the `pom.xml` files for further details.


----
Project lead: Samuel Audet [samuel.audet `at` gmail.com](mailto:samuel.audet at gmail.com)
Developer site: https://github.com/bytedeco/javacv
Expand Down
28 changes: 25 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMddhhmm</maven.build.timestamp.format>
<javacpp.version>0.9</javacpp.version>
<javacpp.version>${project.version}</javacpp.version>
<!-- Reinclude the following with profiles, either all: -Pall
or selectively: -Pmarkers,ffmpeg,dc1394,flycapture,openkinect,ps3eye,videoinput,jogamp -->
<exclude.markers>**/Mark*.java</exclude.markers>
Expand Down Expand Up @@ -78,12 +78,12 @@
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>ffmpeg</artifactId>
<version>2.3-${javacpp.version}</version>
<version>2.4.2-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>flycapture</artifactId>
<version>2.6.3.4-${javacpp.version}</version>
<version>2.7.3.13-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
Expand All @@ -105,6 +105,11 @@
<artifactId>artoolkitplus</artifactId>
<version>2.3.0-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>flandmark</artifactId>
<version>1.07-${javacpp.version}</version>
</dependency>

<dependency>
<groupId>org.jogamp.gluegen</groupId>
Expand Down Expand Up @@ -277,6 +282,23 @@
</build>

<profiles>
<profile>
<id>doclint-java8-disable</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>sign-artifacts</id>
<activation>
Expand Down
19 changes: 7 additions & 12 deletions src/main/java/org/bytedeco/javacv/FlyCapture2FrameGrabber.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011,2012,2013 Samuel Audet
* Copyright (C) 2014 Jeremy Laviole, Samuel Audet
*
* This file is part of JavaCV.
*
Expand Down Expand Up @@ -32,10 +32,6 @@
import static org.bytedeco.javacpp.opencv_imgproc.*;
import org.bytedeco.javacpp.FlyCapture2.Error;
import static org.bytedeco.javacpp.FlyCapture2.*;
import static org.bytedeco.javacv.FrameGrabber.SENSOR_PATTERN_BGGR;
import static org.bytedeco.javacv.FrameGrabber.SENSOR_PATTERN_GBRG;
import static org.bytedeco.javacv.FrameGrabber.SENSOR_PATTERN_GRBG;
import static org.bytedeco.javacv.FrameGrabber.SENSOR_PATTERN_RGGB;

/**
*
Expand All @@ -55,7 +51,7 @@ public static String[] getDeviceDescriptions() throws FrameGrabber.Exception {

for (int i = 0; i < numCameras[0]; i++) {
PGRGuid guid = new PGRGuid();
error = busMgr.GetCameraFromIndex(i, guid);
Error error = busMgr.GetCameraFromIndex(i, guid);
if (error.notEquals(PGRERROR_OK)) {
PrintError(error);
System.exit(-1);
Expand Down Expand Up @@ -128,7 +124,7 @@ public FlyCapture2FrameGrabber(int deviceNumber) throws FrameGrabber.Exception {

// Get the camera
PGRGuid guid = new PGRGuid();
error = busMgr.GetCameraFromIndex(deviceNumber, guid);
Error error = busMgr.GetCameraFromIndex(deviceNumber, guid);
if (error.notEquals(PGRERROR_OK)) {
PrintError(error);
System.exit(-1);
Expand Down Expand Up @@ -174,7 +170,6 @@ protected void finalize() throws Throwable {
IMAGE_DATA_FORMAT = 0x1048;

private BusManager busMgr = new BusManager();
private static Error error;
private Camera camera;
private CameraInfo cameraInfo;
private Image raw_image = new Image();
Expand Down Expand Up @@ -272,15 +267,15 @@ public void start() throws FrameGrabber.Exception {
}
}

error = camera.StartCapture();
Error error = camera.StartCapture();
if (error.notEquals(PGRERROR_OK)) {
PrintError(error);
}

}

public void stop() throws FrameGrabber.Exception {
error = camera.StopCapture();
Error error = camera.StopCapture();
if (error.notEquals(PGRERROR_OK)) {
throw new FrameGrabber.Exception("flycapture camera StopCapture() Error " + error);
}
Expand All @@ -297,7 +292,7 @@ public void stop() throws FrameGrabber.Exception {
*/
public void trigger() throws FrameGrabber.Exception {
// waitForTriggerReady();
error = camera.FireSoftwareTrigger();
Error error = camera.FireSoftwareTrigger();
if (error.notEquals(PGRERROR_OK)) {
throw new FrameGrabber.Exception("flycaptureSetCameraRegister() Error " + error);
}
Expand Down Expand Up @@ -373,7 +368,7 @@ private void setStride(Image image, int stride) {
}

public IplImage grab() throws FrameGrabber.Exception {
error = camera.RetrieveBuffer(raw_image);
Error error = camera.RetrieveBuffer(raw_image);
if (error.notEquals(PGRERROR_OK)) {
throw new FrameGrabber.Exception("flycaptureGrabImage2() Error " + error + " (Has start() been called?)");
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/bytedeco/javacv/JavaCVCL.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.bytedeco.javacv;

import com.jogamp.opencl.CLCommandQueue;
import com.jogamp.opencl.CLCommandQueue.Mode;
import com.jogamp.opencl.CLBuffer;
import com.jogamp.opencl.CLContext;
import com.jogamp.opencl.CLDevice;
Expand Down Expand Up @@ -107,7 +106,7 @@ public JavaCVCL(GLCapabilitiesImmutable caps, GLContext shareWith, CLDevice devi
GLPbuffer pbuffer = null;
if (caps != null) {
GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
if (factory.canCreateGLPbuffer(null)) {
if (factory.canCreateGLPbuffer(null, caps.getGLProfile())) {
try {
// makes a new buffer
pbuffer = factory.createGLPbuffer(null, caps, null, 32, 32, shareWith);
Expand Down

0 comments on commit 6f74e7b

Please sign in to comment.