-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
8 changed files
with
135 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" path="src/main/html"/> | ||
<classpathentry kind="src" path="src/etc/resources"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
webcam-capture-examples/webcam-capture-applet/src/main/java/WebcamAppletExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import java.awt.Dimension; | ||
|
||
import javax.swing.JApplet; | ||
|
||
import com.github.sarxos.webcam.Webcam; | ||
import com.github.sarxos.webcam.WebcamPanel; | ||
import com.github.sarxos.webcam.WebcamResolution; | ||
import com.github.sarxos.webcam.ds.buildin.WebcamDefaultDriver; | ||
|
||
|
||
public class WebcamAppletExample extends JApplet { | ||
|
||
private static final long serialVersionUID = 3517366452510566924L; | ||
|
||
private Dimension size = WebcamResolution.QQVGA.getSize(); | ||
private Webcam webcam = null; | ||
private WebcamPanel panel = null; | ||
|
||
public WebcamAppletExample() { | ||
super(); | ||
System.out.println("Construct"); | ||
} | ||
|
||
@Override | ||
public void start() { | ||
|
||
System.out.println("Start"); | ||
|
||
super.start(); | ||
|
||
try { | ||
Webcam.setDriver(new WebcamDefaultDriver()); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
webcam = Webcam.getDefault(); | ||
webcam.setViewSize(size); | ||
|
||
panel = new WebcamPanel(webcam, false); | ||
panel.setFPSDisplayed(true); | ||
|
||
add(panel); | ||
|
||
if (webcam.isOpen()) { | ||
webcam.close(); | ||
} | ||
|
||
int i = 0; | ||
do { | ||
if (webcam.getLock().isLocked()) { | ||
System.out.println("Waiting for lock to be released " + i); | ||
try { | ||
Thread.sleep(2000); | ||
} catch (InterruptedException e1) { | ||
return; | ||
} | ||
} else { | ||
break; | ||
} | ||
} while (i++ < 3); | ||
|
||
webcam.open(); | ||
panel.start(); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
System.out.println("Destroy"); | ||
super.destroy(); | ||
webcam.close(); | ||
webcam.close(); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
System.out.println("Stop"); | ||
super.stop(); | ||
webcam.close(); | ||
webcam.getLock().unlock(); | ||
panel.stop(); | ||
} | ||
|
||
@Override | ||
public void init() { | ||
System.out.println("Init"); | ||
super.init(); | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
...les/webcam-capture-applet/src/main/java/com/github/sarxos/webcam/WebcamAppletExample.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters