Skip to content

Commit

Permalink
Automated resources management and drivers loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Jul 12, 2012
1 parent 12dcb46 commit aa6cfc0
Show file tree
Hide file tree
Showing 32 changed files with 723 additions and 386 deletions.
12 changes: 6 additions & 6 deletions .gitignore
@@ -1,11 +1,11 @@
.settings
target
webcam-capture-civil-ds/.settings
webcam-capture-civil-ds/target
webcam-capture-jmf-ds/.settings
webcam-capture-jmf-ds/target
webcam-capture-driver-civil/.settings
webcam-capture-driver-civil/target
webcam-capture-driver-jmf/.settings
webcam-capture-driver-jmf/target
webcam-capture/.settings
webcam-capture/target
webcam-capture-openimaj-ds/.settings
webcam-capture-openimaj-ds/target
webcam-capture-driver-openimaj/.settings
webcam-capture-driver-openimaj/target

File renamed without changes.
244 changes: 220 additions & 24 deletions pom.xml
Expand Up @@ -6,45 +6,63 @@

<groupId>com.github.sarxos</groupId>
<artifactId>webcam-capture-parent</artifactId>
<version>0.3</version>
<version>0.3.1</version>
<packaging>pom</packaging>

<name>Webcam Capture - Root POM</name>
<description>This is Webcam Capture root POM</description>
<packaging>pom</packaging>

<organization>
<name>SarXos Design</name>
<url>http://www.sarxos.pl</url>
<name>Bartosz Firyn (SarXos)</name>
<url>https://github.com/sarxos</url>
</organization>

<licenses>
<license>
<name>MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.html</url>
<distribution>repo</distribution>
</license>
</licenses>

<distributionManagement>
<repository>
<id>sarxos-ftp-repo</id>
<url>ftp://ftp.sarxos.pl/maven2</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
<scm>
<connection>scm:git:git@github.com:sarxos/webcam-capture.git</connection>
<developerConnection>scm:git:git@github.com:sarxos/webcam-capture.git</developerConnection>
<url>git@github.com:sarxos/webcam-capture.git</url>
</scm>

</build>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/sarxos/webcam-capture/issues</url>
</issueManagement>

<modules>
<module>webcam-capture</module>
<module>webcam-capture-civil-ds</module>
<module>webcam-capture-jmf-ds</module>
<module>webcam-capture-openimaj-ds</module>
<module>webcam-capture-driver-civil</module>
<module>webcam-capture-driver-jmf</module>
<module>webcam-capture-driver-openimaj</module>
</modules>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.18</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>notest</id>
Expand All @@ -60,11 +78,189 @@
</plugins>
</build>
</profile>
<profile>
<id>sign</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>copy-dependencies</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- <version>2.5.1</version> -->
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependencies</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>webcam-capture-openimaj-ds/README</file>
<replacements>
<replacement>
<token>${version}</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>distribution.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>1.0-beta-7</version>
</extension>
</extensions>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<show>public</show>
<keywords>cam,webcam,camera,spycam,capture</keywords>
</configuration>
</plugin>
</plugins>
</reporting>


<!--
<reporting>
<plugins>
<plugin>
Expand All @@ -80,7 +276,6 @@
</reportSet>
</reportSets>
</plugin>
<!-- The JXR plugin produces a cross-reference of the project's sources. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
Expand Down Expand Up @@ -140,5 +335,6 @@
</plugin>
</plugins>
</reporting>
-->

</project>
</project>
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
File renamed without changes.
Expand Up @@ -2,32 +2,21 @@

<modelVersion>4.0.0</modelVersion>

<groupId>com.github.sarxos.webcam-capture</groupId>
<artifactId>webcam-capture-civil-ds</artifactId>
<version>0.3-SNAPSHOT</version>
<parent>
<groupId>com.github.sarxos</groupId>
<artifactId>webcam-capture-parent</artifactId>
<version>0.3.1</version>
</parent>

<artifactId>webcam-capture-driver-civil</artifactId>
<name>Webcam Capture - LTI CIVIL Data Source</name>
<description>This is LTI Civil implementation of webcam data source. It allows you to capture webcam media without JMF installed.</description>

<distributionManagement>
<repository>
<id>sarxos-ftp-repo</id>
<url>ftp://ftp.sarxos.pl/maven2</url>
</repository>
</distributionManagement>

<repositories>
<repository>
<id>sarxos-repo</id>
<url>http://repo.sarxos.pl/maven2</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.github.sarxos</groupId>
<artifactId>webcam-capture</artifactId>
<version>0.3-SNAPSHOT</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.lti-civil</groupId>
Expand Down
Expand Up @@ -28,9 +28,9 @@
*
* @author Bartosz Firyn (SarXos)
*/
public class CivilDevice implements WebcamDevice, CaptureObserver {
public class LtiCivilDevice implements WebcamDevice, CaptureObserver {

private static final Logger LOG = LoggerFactory.getLogger(CivilDevice.class);
private static final Logger LOG = LoggerFactory.getLogger(LtiCivilDevice.class);

private CaptureDeviceInfo cdi = null;
private List<Dimension> dimensions = null;
Expand All @@ -40,7 +40,7 @@ public class CivilDevice implements WebcamDevice, CaptureObserver {
private boolean open = false;
private boolean capturing = false;

public CivilDevice(CaptureDeviceInfo cdi) {
public LtiCivilDevice(CaptureDeviceInfo cdi) {
this.cdi = cdi;
}

Expand All @@ -53,7 +53,7 @@ public Dimension[] getSizes() {
if (dimensions == null) {
dimensions = new ArrayList<Dimension>();

CaptureSystem system = CivilDataSource.getCaptureSystem();
CaptureSystem system = LtiCivilDriver.getCaptureSystem();
Set<Dimension> set = new HashSet<Dimension>();

try {
Expand Down Expand Up @@ -114,7 +114,7 @@ public void open() {
return;
}
try {
stream = CivilDataSource.getCaptureSystem().openCaptureDeviceStream(cdi.getDeviceID());
stream = LtiCivilDriver.getCaptureSystem().openCaptureDeviceStream(cdi.getDeviceID());
stream.setVideoFormat(findFormat());
stream.setObserver(this);
stream.start();
Expand Down

0 comments on commit aa6cfc0

Please sign in to comment.