Skip to content

Commit

Permalink
VLCj driver resolution problem and cannot choose camera, fixes #124
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Jul 21, 2013
1 parent e027631 commit 19b4b7b
Show file tree
Hide file tree
Showing 7 changed files with 263 additions and 83 deletions.
53 changes: 27 additions & 26 deletions webcam-capture-drivers/webcam-capture-driver-vlcj/.classpath
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<?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/example/java"/>
<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>
17 changes: 1 addition & 16 deletions webcam-capture-drivers/webcam-capture-driver-vlcj/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@

<name>Webcam Capture - VLCj Driver</name>
<description>Webcam Capture driver using VLCj framework to grab frames from camera</description>

<repositories>
<repository>
<id>caprica</id>
<name>Caprica Software</name>
<url>http://www.capricasoftware.co.uk/repo</url>
</repository>
</repositories>

<dependencies>
<dependency>
Expand All @@ -31,7 +23,7 @@
<dependency>
<groupId>uk.co.caprica</groupId>
<artifactId>vlcj</artifactId>
<version>2.2.0-SNAPSHOT</version>
<version>2.4.1</version>
</dependency>
</dependencies>

Expand All @@ -41,13 +33,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import com.github.sarxos.webcam.WebcamDevice;
import com.github.sarxos.webcam.WebcamDriver;
import com.github.sarxos.webcam.ds.vlcj.VlcjDriver;


/**
* This class intends to be used only for VLCj Webcam Driver test purpose!
*
* @author Bartosz Firyn (sarxos)
*/
public class ListPureDevicesExample {

public static void main(String[] args) {
WebcamDriver driver = new VlcjDriver();
for (WebcamDevice device : driver.getDevices()) {
System.out.println(device);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import java.util.List;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.ds.vlcj.VlcjDriver;


/**
* This class provides a simple example of how to use VLCj driver to list
* webcams available in the system.<br>
* <br>
*
* WARNING: It works correctly only in case when used on Linux box. Windows VLCj
* implementation does not support webcam discovery!!!
*
* @author Bartosz Firyn (sarxos)
*/
public class ListWebcamsExample {

static {
Webcam.setDriver(new VlcjDriver());
}

public static void main(String[] args) {

List<Webcam> webcams = Webcam.getWebcams();

System.out.format("Webcams detected: %d \n", webcams.size());

for (int i = 0; i < webcams.size(); i++) {
System.out.format("%d: %s \n", i + 1, webcams.get(i));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import javax.swing.JFrame;

import com.github.sarxos.webcam.Webcam;
import com.github.sarxos.webcam.WebcamPanel;
import com.github.sarxos.webcam.WebcamResolution;
import com.github.sarxos.webcam.ds.vlcj.VlcjDriver;


public class WebcamPanelExample {

static {
Webcam.setDriver(new VlcjDriver());
}

public static void main(String[] args) throws InterruptedException {

Webcam webcam = Webcam.getWebcams().get(0);
webcam.setViewSize(WebcamResolution.VGA.getSize());

WebcamPanel panel = new WebcamPanel(webcam);
panel.setFPSDisplayed(true);

JFrame window = new JFrame("Webcam Panel using VLCj");
window.add(panel);
window.setResizable(false);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.pack();
window.setVisible(true);
}
}
Loading

0 comments on commit 19b4b7b

Please sign in to comment.