Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSC working, VideoCapture plugin still not being recognized properly - specific feature section always removed from config.xml on compilation :\ Signed-off-by: Stefan Nussbaumer <st9fan@gmail.com>
- Loading branch information
Showing
32 changed files
with
203 additions
and
20 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,7 +1,27 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<plugin id="org.basislager.videocapture" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<name>VideoCapture</name> | ||
<js-module name="VideoCapture" src="www/VideoCapture.js"> | ||
<clobbers target="window.VideoCapture" /> | ||
</js-module> | ||
<name>VideoCapture</name> | ||
<js-module name="VideoCapture" src="www/VideoCapture.js"> | ||
<clobbers target="window.VideoCapture" /> | ||
</js-module> | ||
<!-- android --> | ||
<platform name="android"> | ||
<!-- bind the correct module --> | ||
<config-file target="res/xml/config.xml" parent="/*"> | ||
<feature name="VideoCapture" > | ||
<param name="android-package" value="org.basislager.videocapture.VideoCapture"/> | ||
</feature> | ||
</config-file> | ||
|
||
<!-- allow it to access the network --> | ||
<config-file target="AndroidManifest.xml" parent="/*"> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
</config-file> | ||
|
||
<!-- copy the source files --> | ||
<source-file src="src/android/VideoCapture.java" target-dir="src/org/basislager/VideoCapture" /> | ||
|
||
<!-- copy the VideoCapture source files --> | ||
<source-file src="src/android/libs/VideoCapture.jar" target-dir="libs" /> | ||
</platform> | ||
</plugin> |
File renamed without changes.
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
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,5 +1,5 @@ | ||
#Last build type | ||
#Mon, 11 May 2015 12:58:00 +0200 | ||
#Tue, 12 May 2015 00:02:09 +0200 | ||
|
||
build.last.target=debug | ||
|
||
|
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
Binary file modified
BIN
+11 Bytes
(100%)
platforms/android/ant-build/CordovaApp-debug-unaligned.apk
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
Binary file not shown.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#Last build type | ||
#Mon, 11 May 2015 12:58:10 +0200 | ||
#Tue, 12 May 2015 00:02:17 +0200 | ||
|
||
build.last.target=debug | ||
|
||
|
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
Binary file added
BIN
+996 Bytes
platforms/android/ant-build/dexedLibs/VideoCapture-208e78d09ac0a67f4ab09885860d9faa.jar
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# view AndroidManifest.xml #generated:10 | ||
# view AndroidManifest.xml #generated:9 | ||
-keep class org.basislager.videoscplus.CordovaApp { <init>(...); } | ||
|
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
Binary file not shown.
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
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,10 @@ | ||
{ | ||
"org.basislager.videocapture": { | ||
"source": { | ||
"type": "local", | ||
"path": "VideoCapture" | ||
}, | ||
"is_top_level": true, | ||
"variables": {} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
platforms/android/cordova/plugins/org.basislager.videocapture/.fetch.json
This file was deleted.
Oops, something went wrong.
28 changes: 24 additions & 4 deletions
28
platforms/android/cordova/plugins/org.basislager.videocapture/plugin.xml
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,7 +1,27 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<plugin id="org.basislager.videocapture" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<name>VideoCapture</name> | ||
<js-module name="VideoCapture" src="www/VideoCapture.js"> | ||
<clobbers target="cordova.plugins.VideoCapture" /> | ||
</js-module> | ||
<name>VideoCapture</name> | ||
<js-module name="VideoCapture" src="www/VideoCapture.js"> | ||
<clobbers target="window.VideoCapture" /> | ||
</js-module> | ||
<!-- android --> | ||
<platform name="android"> | ||
<!-- bind the correct module --> | ||
<config-file target="res/xml/config.xml" parent="/*"> | ||
<feature name="VideoCapture" > | ||
<param name="android-package" value="org.basislager.videocapture.VideoCapture"/> | ||
</feature> | ||
</config-file> | ||
|
||
<!-- allow it to access the network --> | ||
<config-file target="AndroidManifest.xml" parent="/*"> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
</config-file> | ||
|
||
<!-- copy the source files --> | ||
<source-file src="src/android/VideoCapture.java" target-dir="src/org/basislager/VideoCapture" /> | ||
|
||
<!-- copy the VideoCapture source files --> | ||
<source-file src="src/android/libs/VideoCapture.jar" target-dir="libs" /> | ||
</platform> | ||
</plugin> |
File renamed without changes.
Binary file added
BIN
+822 Bytes
...rms/android/cordova/plugins/org.basislager.videocapture/src/android/libs/VideoCapture.jar
Binary file not shown.
Binary file not shown.
File renamed without changes.
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,10 @@ | ||
{ | ||
"org.basislager.videocapture": { | ||
"source": { | ||
"type": "local", | ||
"path": "VideoCapture" | ||
}, | ||
"is_top_level": true, | ||
"variables": {} | ||
} | ||
} |
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,27 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<plugin id="org.basislager.videocapture" version="0.0.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<name>VideoCapture</name> | ||
<js-module name="VideoCapture" src="www/VideoCapture.js"> | ||
<clobbers target="window.VideoCapture" /> | ||
</js-module> | ||
<!-- android --> | ||
<platform name="android"> | ||
<!-- bind the correct module --> | ||
<config-file target="res/xml/config.xml" parent="/*"> | ||
<feature name="VideoCapture" > | ||
<param name="android-package" value="org.basislager.VideoCapture"/> | ||
</feature> | ||
</config-file> | ||
|
||
<!-- allow it to access the network --> | ||
<config-file target="AndroidManifest.xml" parent="/*"> | ||
<uses-permission android:name="android.permission.CAMERA" /> | ||
</config-file> | ||
|
||
<!-- copy the source files --> | ||
<source-file src="src/android/VideoCapture.java" target-dir="src/org/basislager/videocapture" /> | ||
|
||
<!-- copy the osc source files --> | ||
<source-file src="libs/VideoCapture.jar" target-dir="libs" /> | ||
</platform> | ||
</plugin> |
64 changes: 64 additions & 0 deletions
64
plugins/org.basislager.videocapture/src/android/VideoCapture.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,64 @@ | ||
package VideoCapture; | ||
|
||
import java.net.InetAddress; | ||
import java.net.SocketException; | ||
import java.net.UnknownHostException; | ||
import java.util.Date; | ||
import java.util.HashMap; | ||
import java.util.Iterator; | ||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
|
||
import org.apache.cordova.CallbackContext; | ||
import org.apache.cordova.CordovaPlugin; | ||
import org.apache.cordova.PluginResult; | ||
import org.json.JSONArray; | ||
import org.json.JSONException; | ||
|
||
import android.content.Context; | ||
import android.hardware.camera2.CameraCaptureSession; | ||
import android.hardware.camera2.CameraDevice; | ||
import android.hardware.camera2.CameraManager; | ||
import android.util.Log; | ||
|
||
public class VideoCapture extends CordovaPlugin { | ||
private static final String TAG = "VideoCapture"; | ||
private final CameraManager mCameraManager = (CameraManager) context | ||
.getSystemService(Context.CAMERA_SERVICE);; | ||
private CameraDevice mCameraDevice; | ||
private CameraCaptureSession mCameraSession; | ||
|
||
private static Context context; | ||
private static final CameraManager manager = (CameraManager) context | ||
.getSystemService(Context.CAMERA_SERVICE); | ||
|
||
/* constructor */ | ||
public VideoCapture() { | ||
} | ||
|
||
public boolean execute(String action, JSONArray args, | ||
CallbackContext callbackContext) throws JSONException { | ||
try { | ||
if (action.equals("startCapture")) { | ||
Log.d(TAG, "start capturing"); | ||
startCapture(args.getInt(0), callbackContext); | ||
} else if (action.equals("stopCapture")) { | ||
stopCapture(args.getInt(0), callbackContext); | ||
} else { | ||
return false; | ||
} | ||
} catch (Exception e) { | ||
callbackContext.error(e.getMessage()); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
private void startCapture(final int deviceID, | ||
final CallbackContext callbackContext) { | ||
} | ||
|
||
private void stopCapture(final int deviceID, | ||
final CallbackContext callbackContext) { | ||
} | ||
} |
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,21 @@ | ||
// var exec = require('cordova/exec'); | ||
|
||
// exports.coolMethod = function(arg0, success, error) { | ||
// exec(success, error, "VideoCapture", "coolMethod", [arg0]); | ||
// }; | ||
|
||
var VideoCapture = function(device) { | ||
this.device = device; | ||
} | ||
|
||
OSCListener.prototype.startCapture = function(successCallback, errorCallback){ | ||
cordova.exec(successCallback, errorCallback, "VideoCapture", "startCapture", [this.device]); | ||
} | ||
|
||
OSCListener.prototype.stopCapture = function(successCallback){ | ||
cordova.exec(successCallback, function(err){ | ||
console.log(err); | ||
}, "VideoCapture", "stopCapture", [this.device]); | ||
} | ||
|
||
module.exports = VideoCapture; |
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