Skip to content

Commit

Permalink
slow advance
Browse files Browse the repository at this point in the history
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
nuss committed May 11, 2015
1 parent b13b7c2 commit be86d34
Show file tree
Hide file tree
Showing 32 changed files with 203 additions and 20 deletions.
28 changes: 24 additions & 4 deletions VideoCapture/plugin.xml
@@ -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 added VideoCapture/src/android/libs/VideoCapture.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion platforms/android/AndroidManifest.xml
Expand Up @@ -2,7 +2,6 @@
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="org.basislager.videoscplus" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.camera" />
Expand All @@ -14,4 +13,5 @@
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.CAMERA" />
</manifest>
2 changes: 1 addition & 1 deletion platforms/android/CordovaLib/ant-build/build.prop
@@ -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

Expand Down
Binary file modified platforms/android/CordovaLib/bin/cordovaapp-cordovalib.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion platforms/android/ant-build/AndroidManifest.cordova.xml
Expand Up @@ -2,7 +2,6 @@
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="org.basislager.videoscplus" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.camera" />
Expand All @@ -14,4 +13,5 @@
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.CAMERA" />
</manifest>
Binary file modified platforms/android/ant-build/CordovaApp-debug-unaligned.apk
Binary file not shown.
Expand Up @@ -3,3 +3,4 @@
/home/stefan/phonegap/videoscplus/platforms/android/ant-build/classes.dex \
/home/stefan/phonegap/videoscplus/platforms/android/CordovaLib/ant-build/classes.jar \
/home/stefan/phonegap/videoscplus/platforms/android/libs/JavaOsc.jar \
/home/stefan/phonegap/videoscplus/platforms/android/libs/VideoCapture.jar \
Binary file modified platforms/android/ant-build/CordovaApp-debug.apk
Binary file not shown.
Binary file modified platforms/android/ant-build/CordovaApp.ap_
Binary file not shown.
2 changes: 1 addition & 1 deletion platforms/android/ant-build/build.prop
@@ -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

Expand Down
1 change: 1 addition & 0 deletions platforms/android/ant-build/classes.dex.d
Expand Up @@ -72,3 +72,4 @@
/home/stefan/phonegap/videoscplus/platforms/android/ant-build/classes/com/mediamatrixdoo/keepscreenon/KeepScreenOn$2.class \
/home/stefan/phonegap/videoscplus/platforms/android/ant-build/dexedLibs/classes-fe68aa2e3490e15426e7741f63c0f514.jar \
/home/stefan/phonegap/videoscplus/platforms/android/ant-build/dexedLibs/JavaOsc-3a79f0c920637fc02b7f797d56c7d817.jar \
/home/stefan/phonegap/videoscplus/platforms/android/ant-build/dexedLibs/VideoCapture-208e78d09ac0a67f4ab09885860d9faa.jar \
Binary file not shown.
2 changes: 1 addition & 1 deletion platforms/android/ant-build/proguard.txt
@@ -1,3 +1,3 @@
# view AndroidManifest.xml #generated:10
# view AndroidManifest.xml #generated:9
-keep class org.basislager.videoscplus.CordovaApp { <init>(...); }

5 changes: 3 additions & 2 deletions platforms/android/assets/www/index.html
Expand Up @@ -46,9 +46,9 @@
document.getElementById('send').addEventListener('click', sendOnClick, false);

// console.log([window.innerWidth, window.innerHeight]);
// var capture = new VideoCapture('test');
console.log(["sender: "+sender, "listener: "+listener]);
sender = new OSCSender('192.168.1.4', 57120);
// sender = new OSCSender('192.168.1.4', 57120);
sender = new OSCSender('10.42.0.1', 57120);
listener = new OSCListener(9000);
console.log(["sender: "+sender, "listener: "+listener]);
// capture.startCapture(function(success) {
Expand All @@ -60,6 +60,7 @@
listener.on('/reply', function(success) {
document.getElementById("test").innerHTML = success[0];
});
var capture = new VideoCapture('test');
}

function sendOnClick() {
Expand Down
4 changes: 2 additions & 2 deletions platforms/android/bin/AndroidManifest.xml
Expand Up @@ -2,16 +2,16 @@
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="org.basislager.videoscplus" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.camera" />
<application android:allowBackup="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="adjustResize">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="CordovaApp" android:screenOrientation="landscape" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.CAMERA" />
</manifest>
Binary file modified platforms/android/bin/VideOSC+.apk
Binary file not shown.
Binary file modified platforms/android/bin/resources.ap_
Binary file not shown.
8 changes: 8 additions & 0 deletions platforms/android/cordova/plugins/android.json
Expand Up @@ -11,6 +11,10 @@
{
"xml": "<feature name=\"OSC\"><param name=\"android-package\" value=\"nl.sylvain.cordova.osc.OSCUtils\" /></feature>",
"count": 1
},
{
"xml": "<feature name=\"VideoCapture\"><param name=\"android-package\" value=\"org.basislager.videocapture.VideoCapture\" /></feature>",
"count": 1
}
]
}
Expand All @@ -21,6 +25,10 @@
{
"xml": "<uses-permission android:name=\"android.permission.INTERNET\" />",
"count": 1
},
{
"xml": "<uses-permission android:name=\"android.permission.CAMERA\" />",
"count": 1
}
]
}
Expand Down
10 changes: 10 additions & 0 deletions platforms/android/cordova/plugins/fetch.json
@@ -0,0 +1,10 @@
{
"org.basislager.videocapture": {
"source": {
"type": "local",
"path": "VideoCapture"
},
"is_top_level": true,
"variables": {}
}
}

This file was deleted.

@@ -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>
Binary file not shown.
Binary file added platforms/android/libs/VideoCapture.jar
Binary file not shown.
10 changes: 10 additions & 0 deletions plugins/fetch.json
@@ -0,0 +1,10 @@
{
"org.basislager.videocapture": {
"source": {
"type": "local",
"path": "VideoCapture"
},
"is_top_level": true,
"variables": {}
}
}
27 changes: 27 additions & 0 deletions plugins/org.basislager.videocapture/plugin.xml
@@ -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 plugins/org.basislager.videocapture/src/android/VideoCapture.java
@@ -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) {
}
}
21 changes: 21 additions & 0 deletions plugins/org.basislager.videocapture/www/VideoCapture.js
@@ -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;
5 changes: 3 additions & 2 deletions www/index.html
Expand Up @@ -46,9 +46,9 @@
document.getElementById('send').addEventListener('click', sendOnClick, false);

// console.log([window.innerWidth, window.innerHeight]);
// var capture = new VideoCapture('test');
console.log(["sender: "+sender, "listener: "+listener]);
sender = new OSCSender('192.168.1.4', 57120);
// sender = new OSCSender('192.168.1.4', 57120);
sender = new OSCSender('10.42.0.1', 57120);
listener = new OSCListener(9000);
console.log(["sender: "+sender, "listener: "+listener]);
// capture.startCapture(function(success) {
Expand All @@ -60,6 +60,7 @@
listener.on('/reply', function(success) {
document.getElementById("test").innerHTML = success[0];
});
var capture = new VideoCapture('test');
}

function sendOnClick() {
Expand Down

0 comments on commit be86d34

Please sign in to comment.