This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
praxis / praxis.video.* - add JNA Platform library, extract GStreamer…
… settings, add support for platform-specific library paths.
- Loading branch information
1 parent
5979227
commit c25f568
Showing
21 changed files
with
338 additions
and
157 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
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- You may freely edit this file. See harness/README in the NetBeans platform --> | ||
<!-- for some information on what you could do (e.g. targets to override). --> | ||
<!-- If you delete this file and reopen the project it will be recreated. --> | ||
<project name="com.sun.jna.platform" default="netbeans" basedir="."> | ||
<description>Builds, tests, and runs the project com.sun.jna.platform.</description> | ||
<import file="nbproject/build-impl.xml"/> | ||
</project> |
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,6 @@ | ||
Manifest-Version: 1.0 | ||
AutoUpdate-Show-In-Client: true | ||
OpenIDE-Module: com.sun.jna.platform | ||
OpenIDE-Module-Localizing-Bundle: com/sun/jna/platform/Bundle.properties | ||
OpenIDE-Module-Specification-Version: 1.0 | ||
|
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,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
*** GENERATED FROM project.xml - DO NOT EDIT *** | ||
*** EDIT ../build.xml INSTEAD *** | ||
--> | ||
<project name="com.sun.jna.platform-impl" basedir=".."> | ||
<fail message="Please build using Ant 1.7.1 or higher."> | ||
<condition> | ||
<not> | ||
<antversion atleast="1.7.1"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
<property file="nbproject/private/suite-private.properties"/> | ||
<property file="nbproject/suite.properties"/> | ||
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail> | ||
<property file="${suite.dir}/nbproject/private/platform-private.properties"/> | ||
<property file="${suite.dir}/nbproject/platform.properties"/> | ||
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
<attribute name="name"/> | ||
<attribute name="value"/> | ||
<sequential> | ||
<property name="@{name}" value="${@{value}}"/> | ||
</sequential> | ||
</macrodef> | ||
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2"> | ||
<attribute name="property"/> | ||
<attribute name="value"/> | ||
<sequential> | ||
<property name="@{property}" value="@{value}"/> | ||
</sequential> | ||
</macrodef> | ||
<property file="${user.properties.file}"/> | ||
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/> | ||
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness)."> | ||
<condition> | ||
<not> | ||
<contains string="${cluster.path.evaluated}" substring="platform"/> | ||
</not> | ||
</condition> | ||
</fail> | ||
<import file="${harness.dir}/build.xml"/> | ||
</project> |
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,8 @@ | ||
build.xml.data.CRC32=5dd71efe | ||
build.xml.script.CRC32=c08ae6e9 | ||
build.xml.stylesheet.CRC32=[email protected] | ||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
nbproject/build-impl.xml.data.CRC32=5dd71efe | ||
nbproject/build-impl.xml.script.CRC32=a5bb51d6 | ||
nbproject/build-impl.xml.stylesheet.CRC32=[email protected] |
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,3 @@ | ||
is.autoload=true | ||
javac.compilerargs=-Xlint -Xlint:-serial | ||
javac.source=1.8 |
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,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://www.netbeans.org/ns/project/1"> | ||
<type>org.netbeans.modules.apisupport.project</type> | ||
<configuration> | ||
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3"> | ||
<code-name-base>com.sun.jna.platform</code-name-base> | ||
<suite-component/> | ||
<module-dependencies> | ||
<dependency> | ||
<code-name-base>com.sun.jna</code-name-base> | ||
<build-prerequisite/> | ||
<compile-dependency/> | ||
<run-dependency> | ||
<specification-version>3.5.1</specification-version> | ||
</run-dependency> | ||
</dependency> | ||
</module-dependencies> | ||
<public-packages> | ||
<package>com.sun.jna.platform</package> | ||
<package>com.sun.jna.platform.dnd</package> | ||
<package>com.sun.jna.platform.mac</package> | ||
<package>com.sun.jna.platform.unix</package> | ||
<package>com.sun.jna.platform.win32</package> | ||
<package>com.sun.jna.platform.win32.COM</package> | ||
<package>com.sun.jna.platform.win32.COM.tlb</package> | ||
<package>com.sun.jna.platform.win32.COM.tlb.imp</package> | ||
<package>com.sun.jna.platform.win32.COM.util</package> | ||
<package>com.sun.jna.platform.win32.COM.util.annotation</package> | ||
<package>com.sun.jna.platform.wince</package> | ||
</public-packages> | ||
<class-path-extension> | ||
<runtime-relative-path>ext/jna-platform-4.2.2.jar</runtime-relative-path> | ||
<binary-origin>release/modules/ext/jna-platform-4.2.2.jar</binary-origin> | ||
</class-path-extension> | ||
</data> | ||
</configuration> | ||
</project> |
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 @@ | ||
suite.dir=${basedir}/.. |
Binary file not shown.
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 @@ | ||
OpenIDE-Module-Name=lib.jna.platform |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
build.xml.data.CRC32=0c087fce | ||
build.xml.data.CRC32=5f78fa18 | ||
build.xml.script.CRC32=c35d8958 | ||
build.xml.stylesheet.CRC32=a56c6a5b@2.67.1 | ||
build.xml.stylesheet.CRC32=a56c6a5b@2.71.1 | ||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
nbproject/build-impl.xml.data.CRC32=0c087fce | ||
nbproject/build-impl.xml.data.CRC32=5f78fa18 | ||
nbproject/build-impl.xml.script.CRC32=fb5821b9 | ||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.67.1 | ||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.71.1 |
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
97 changes: 97 additions & 0 deletions
97
praxis.video.gst1/src/net/neilcsmith/praxis/video/gst1/GStreamerSettings.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,97 @@ | ||
/* | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
* | ||
* Copyright 2016 Neil C Smith. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 3 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 3 for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License version 3 | ||
* along with this work; if not, see http://www.gnu.org/licenses/ | ||
* | ||
* | ||
* Please visit http://neilcsmith.net if you need additional information or | ||
* have any questions. | ||
*/ | ||
package net.neilcsmith.praxis.video.gst1; | ||
|
||
import com.sun.jna.Platform; | ||
import net.neilcsmith.praxis.settings.Settings; | ||
|
||
/** | ||
* | ||
* @author Neil C Smith (http://neilcsmith.net) | ||
*/ | ||
public class GStreamerSettings { | ||
|
||
private final static String KEY_CAPTURE_PREFIX = "video.gstreamer.capture"; | ||
private final static String KEY_LIBRARY_PATH = "video.gstreamer.path"; | ||
|
||
private final static String DEFAULT_CAPTURE_PREFIX; | ||
private final static String DEFAULT_LIBRARY_PATH; | ||
|
||
static { | ||
if (Platform.isWindows()) { | ||
DEFAULT_CAPTURE_PREFIX = "ksvideosrc device-index="; | ||
if (Platform.is64Bit()) { | ||
DEFAULT_LIBRARY_PATH = "C:\\gstreamer\\1.0\\x86_64\\bin\\"; | ||
} else { | ||
DEFAULT_LIBRARY_PATH = "C:\\gstreamer\\1.0\\x86\\bin\\"; | ||
} | ||
} else if (Platform.isMac()) { | ||
DEFAULT_CAPTURE_PREFIX = "qtkitvideosrc device-index="; | ||
DEFAULT_LIBRARY_PATH = "/Library/Frameworks/GStreamer.framework/Libraries/"; | ||
} else { | ||
DEFAULT_CAPTURE_PREFIX = "v4l2src device=/dev/video"; | ||
DEFAULT_LIBRARY_PATH = ""; | ||
} | ||
} | ||
|
||
public static String getDefaultCaptureDevice(int idx) { | ||
if (idx < 1) { | ||
throw new IllegalArgumentException(); | ||
} | ||
return DEFAULT_CAPTURE_PREFIX + (idx - 1); | ||
} | ||
|
||
public static void resetCaptureDevice(int idx) { | ||
setCaptureDevice(idx, null); | ||
} | ||
|
||
public static String getCaptureDevice(int idx) { | ||
if (idx < 1) { | ||
throw new IllegalArgumentException(); | ||
} | ||
return Settings.get(KEY_CAPTURE_PREFIX + idx, getDefaultCaptureDevice(idx)); | ||
} | ||
|
||
public static void setCaptureDevice(int idx, String device) { | ||
if (idx < 1) { | ||
throw new IllegalArgumentException(); | ||
} | ||
Settings.put(KEY_CAPTURE_PREFIX + idx, device); | ||
} | ||
|
||
public static String getDefaultLibraryPath() { | ||
return DEFAULT_LIBRARY_PATH; | ||
} | ||
|
||
public static void resetLibraryPath() { | ||
setLibraryPath(null); | ||
} | ||
|
||
public static String getLibraryPath() { | ||
return Settings.get(KEY_LIBRARY_PATH, getDefaultLibraryPath()); | ||
} | ||
|
||
public static void setLibraryPath(String libPath) { | ||
Settings.put(KEY_LIBRARY_PATH, libPath); | ||
} | ||
|
||
} |
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
Oops, something went wrong.