diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-svc2.jar
new file mode 100644
index 0000000000..a2d74e5f2a
Binary files /dev/null and b/bbb-screenshare/app/jws/lib/ffmpeg-svc2.jar differ
diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-native-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-native-svc2.jar
new file mode 100644
index 0000000000..5c53f67dd6
Binary files /dev/null and b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-native-svc2.jar differ
diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar
new file mode 100644
index 0000000000..da55767c28
Binary files /dev/null and b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86-svc2.jar differ
diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-native-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-native-svc2.jar
new file mode 100644
index 0000000000..49ad45d6b5
Binary files /dev/null and b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-native-svc2.jar differ
diff --git a/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar
new file mode 100644
index 0000000000..accc9d301b
Binary files /dev/null and b/bbb-screenshare/app/jws/lib/ffmpeg-win-x86_64-svc2.jar differ
diff --git a/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar b/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar
index adac97051f..abc34b669b 100755
Binary files a/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar and b/bbb-screenshare/app/jws/lib/javacv-screenshare-0.0.1.jar differ
diff --git a/bbb-screenshare/app/jws/screenshare.jnlp b/bbb-screenshare/app/jws/screenshare.jnlp
index 08bd5b2a65..d69d21e14b 100755
--- a/bbb-screenshare/app/jws/screenshare.jnlp
+++ b/bbb-screenshare/app/jws/screenshare.jnlp
@@ -12,15 +12,16 @@
-
-
+
+
-
+
+
diff --git a/bbb-screenshare/app/screenshare.jnlp b/bbb-screenshare/app/screenshare.jnlp
deleted file mode 100755
index 08bd5b2a65..0000000000
--- a/bbb-screenshare/app/screenshare.jnlp
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
- BigBlueButton Screen Share
- BigBlueButton
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $$publishUrl
- $$serverUrl
- $$meetingId
- $$streamId
- $$fullScreen
- $$codecOptions
- $$session
- $$errorMessage
-
-
-
-
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/build.xml b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/build.xml
new file mode 100755
index 0000000000..449e42c0c1
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/build.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/ffmpeg-3.0.2-1.2-svc2.jar b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/ffmpeg-3.0.2-1.2-svc2.jar
new file mode 100755
index 0000000000..a1b10cabad
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/ffmpeg-3.0.2-1.2-svc2.jar differ
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/sign-ffmpeg-svc2.sh b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/sign-ffmpeg-svc2.sh
new file mode 100755
index 0000000000..c7dbc57dd6
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/api/sign-ffmpeg-svc2.sh
@@ -0,0 +1,16 @@
+FFMPEG=ffmpeg-3.0.2-1.2-svc2.jar
+if [ -d "workdir" ]; then
+ rm -rf workdir
+fi
+mkdir workdir
+cp $FFMPEG workdir
+cd workdir
+jar xf $FFMPEG
+rm $FFMPEG
+rm -rf META-INF
+jar cf ffmpeg.jar *
+cd ..
+ant sign-ffmpeg-jar
+cp workdir/ffmpeg.jar ../../../../../app/jws/lib/ffmpeg-win-x86-svc2.jar
+rm -rf workdir
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/build.gradle b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/build.gradle
new file mode 100755
index 0000000000..3ab1f6fe39
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/build.gradle
@@ -0,0 +1,10 @@
+apply plugin: 'java'
+apply plugin: 'eclipse'
+
+sourceCompatibility=1.6
+targetCompatibility=1.6
+
+version = '0.0.1'
+archivesBaseName = 'ffmpeg-windows-x86'
+
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/build.xml b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/build.xml
new file mode 100755
index 0000000000..54ca846d98
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/build.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/ffmpeg-3.0.2-1.2-windows-x86.jar b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/ffmpeg-3.0.2-1.2-windows-x86.jar
new file mode 100755
index 0000000000..2eb41a3209
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/ffmpeg-3.0.2-1.2-windows-x86.jar differ
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/sign-jar.sh b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/sign-jar.sh
new file mode 100755
index 0000000000..9e0f77ac24
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86/svc2/native/sign-jar.sh
@@ -0,0 +1,17 @@
+FFMPEG=ffmpeg-3.0.2-1.2-windows-x86.jar
+mkdir workdir
+cp $FFMPEG workdir/ffmpeg-windows-x86.jar
+rm -rf src
+mkdir -p src/main/resources
+mkdir -p src/main/java
+cd workdir
+jar xvf ffmpeg-windows-x86.jar
+cp org/bytedeco/javacpp/windows-x86/*.dll ../src/main/resources
+cd ..
+rm -rf workdir
+gradle jar
+cp build/libs/ffmpeg-windows-x86-0.0.1.jar ../../../unsigned-jars/ffmpeg-win-x86-native-svc2-unsigned.jar
+ant sign-jar
+cp build/libs/ffmpeg-windows-x86-0.0.1.jar ../../../../../app/jws/lib/ffmpeg-win-x86-native-svc2.jar
+rm -rf src
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/sign-jar.sh b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/sign-jar.sh
index ac1216e767..7dce386a5d 100755
--- a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/sign-jar.sh
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/sign-jar.sh
@@ -10,8 +10,8 @@ cp org/bytedeco/javacpp/windows-x86_64/*.dll ../src/main/resources
cd ..
rm -rf workdir
gradle jar
-cp build/libs/ffmpeg-windows-x86_64-0.0.1.jar ../unsigned-jars/ffmpeg-windows-x86_64-unsigned.jar
+cp build/libs/ffmpeg-windows-x86_64-0.0.1.jar ../unsigned-jars/ffmpeg-win-x86_64-svc2--unsigned.jar
ant sign-jar
-cp build/libs/ffmpeg-windows-x86_64-0.0.1.jar ../../../app/jws/lib/ffmpeg-windows-x86_64.jar
+cp build/libs/ffmpeg-windows-x86_64-0.0.1.jar ../../../app/jws/lib/ffmpeg-win-x86_64-svc2.jar
rm -rf src
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/build.xml b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/build.xml
new file mode 100755
index 0000000000..449e42c0c1
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/build.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/ffmpeg-3.0.2-1.2-svc2.jar b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/ffmpeg-3.0.2-1.2-svc2.jar
new file mode 100755
index 0000000000..9ef2ae2262
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/ffmpeg-3.0.2-1.2-svc2.jar differ
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/sign-ffmpeg-svc2.sh b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/sign-ffmpeg-svc2.sh
new file mode 100755
index 0000000000..7d69a02f14
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/api/sign-ffmpeg-svc2.sh
@@ -0,0 +1,16 @@
+FFMPEG=ffmpeg-3.0.2-1.2-svc2.jar
+if [ -d "workdir" ]; then
+ rm -rf workdir
+fi
+mkdir workdir
+cp $FFMPEG workdir
+cd workdir
+jar xf $FFMPEG
+rm $FFMPEG
+rm -rf META-INF
+jar cf ffmpeg.jar *
+cd ..
+ant sign-ffmpeg-jar
+cp workdir/ffmpeg.jar ../../../../../app/jws/lib/ffmpeg-win-x86_64-svc2.jar
+rm -rf workdir
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/build.gradle b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/build.gradle
new file mode 100755
index 0000000000..1d9791a055
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/build.gradle
@@ -0,0 +1,10 @@
+apply plugin: 'java'
+apply plugin: 'eclipse'
+
+sourceCompatibility=1.6
+targetCompatibility=1.6
+
+version = '0.0.1'
+archivesBaseName = 'ffmpeg-windows-x86_64'
+
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/build.xml b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/build.xml
new file mode 100755
index 0000000000..769a2130bd
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/build.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/ffmpeg-3.0.2-1.2-windows-x86_64.jar b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/ffmpeg-3.0.2-1.2-windows-x86_64.jar
new file mode 100755
index 0000000000..ec52a38f10
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/ffmpeg-3.0.2-1.2-windows-x86_64.jar differ
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/sign-jar.sh b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/sign-jar.sh
new file mode 100755
index 0000000000..b9ab51caf4
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/dll/sign-jar.sh
@@ -0,0 +1,17 @@
+FFMPEG=ffmpeg-3.0.2-1.2-windows-x86_64.jar
+mkdir workdir
+cp $FFMPEG workdir/ffmpeg-windows-x86_64.jar
+rm -rf src
+mkdir -p src/main/resources
+mkdir -p src/main/java
+cd workdir
+jar xvf ffmpeg-windows-x86_64.jar
+cp org/bytedeco/javacpp/windows-x86_64/*.dll ../src/main/resources
+cd ..
+rm -rf workdir
+gradle jar
+cp build/libs/ffmpeg-windows-x86_64-0.0.1.jar ../../../unsigned-jars/ffmpeg-win-x86_64-native-svc2-unsigned.jar
+ant sign-jar
+cp build/libs/ffmpeg-windows-x86_64-0.0.1.jar ../../../../../app/jws/lib/ffmpeg-win-x86_64-native-svc2.jar
+rm -rf src
+
diff --git a/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/ffmpeg-3.0.2-1.2.jar b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/ffmpeg-3.0.2-1.2.jar
new file mode 100755
index 0000000000..efcc7bdaeb
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/ffmpeg-windows-x86_64/svc2/ffmpeg-3.0.2-1.2.jar differ
diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-3.0.2-1.2-svc2.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-3.0.2-1.2-svc2.jar
new file mode 100755
index 0000000000..9ef2ae2262
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-3.0.2-1.2-svc2.jar differ
diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-native-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-native-svc2-unsigned.jar
new file mode 100644
index 0000000000..5d0d435411
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-native-svc2-unsigned.jar differ
diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar
new file mode 100644
index 0000000000..f759260339
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86-svc2-unsigned.jar differ
diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-native-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-native-svc2-unsigned.jar
new file mode 100644
index 0000000000..c15535c7cb
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-native-svc2-unsigned.jar differ
diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar
new file mode 100644
index 0000000000..7ace3ca93e
Binary files /dev/null and b/bbb-screenshare/jws/native-libs/unsigned-jars/ffmpeg-win-x86_64-svc2-unsigned.jar differ
diff --git a/bbb-screenshare/jws/native-libs/unsigned-jars/sign-ffmpeg-svc2.sh b/bbb-screenshare/jws/native-libs/unsigned-jars/sign-ffmpeg-svc2.sh
new file mode 100755
index 0000000000..d5d8d74129
--- /dev/null
+++ b/bbb-screenshare/jws/native-libs/unsigned-jars/sign-ffmpeg-svc2.sh
@@ -0,0 +1,16 @@
+FFMPEG=ffmpeg-3.0.2-1.2-svc2.jar
+if [ -d "workdir" ]; then
+ rm -rf workdir
+fi
+mkdir workdir
+cp $FFMPEG workdir
+cd workdir
+jar xf $FFMPEG
+rm $FFMPEG
+rm -rf META-INF
+jar cf ffmpeg.jar *
+cd ..
+ant sign-ffmpeg-jar
+cp workdir/ffmpeg.jar ../../../app/jws/lib/ffmpeg-svc2.jar
+rm -rf workdir
+
diff --git a/bbb-screenshare/jws/webstart/deploy.sh b/bbb-screenshare/jws/webstart/deploy.sh
new file mode 100755
index 0000000000..d8322cc802
--- /dev/null
+++ b/bbb-screenshare/jws/webstart/deploy.sh
@@ -0,0 +1,2 @@
+cp build/libs/javacv-screenshare-0.0.1.jar /usr/share/red5/webapps/screenshare/lib
+
diff --git a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/DeskshareMain.java b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/DeskshareMain.java
index b037aedf11..32fd323656 100755
--- a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/DeskshareMain.java
+++ b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/DeskshareMain.java
@@ -221,7 +221,7 @@ public class DeskshareMain implements ClientListener, LifeLineListener {
try {
System.out.println("Trigger stop client. " + exitReasonQ.remainingCapacity());
exitReasonQ.put(reason);
- System.out.println("Triggered stop client.");
+ System.out.println("Triggered stop client. reason=" + reason.getExitCode());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
diff --git a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenRegionSharer.java b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenRegionSharer.java
index 4fdea997d3..d726575eee 100755
--- a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenRegionSharer.java
+++ b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenRegionSharer.java
@@ -114,14 +114,14 @@ public class ScreenRegionSharer implements ScreenSharer, NetworkConnectionListen
public void networkConnectionException(ExitCode reason, String streamId) {
if (listener != null) {
if (reason.getExitCode() == ExitCode.PAUSED.getExitCode()) {
- //System.out.println(NAME + "Pausing. Reason=" + reason.getExitCode());
+ System.out.println(NAME + "Pausing. Reason=" + reason.getExitCode());
pause();
} else if (reason.getExitCode() == ExitCode.START.getExitCode()) {
this.streamId = streamId;
- //System.out.println(NAME + "starting. StreamId=" + this.streamId + " fullScreen=" + fullScreen);
+ System.out.println(NAME + "starting. StreamId=" + this.streamId + " fullScreen=" + fullScreen);
start();
} else {
- //System.out.println(NAME + "Closing. Reason=" + reason.getExitCode());
+ System.out.println(NAME + "Closing. Reason=" + reason.getExitCode());
listener.onClientStop(reason);
}
}
diff --git a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenSharerRunner.java b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenSharerRunner.java
index 8e76fc8d28..33eba24f14 100755
--- a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenSharerRunner.java
+++ b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/ScreenSharerRunner.java
@@ -39,8 +39,8 @@ public class ScreenSharerRunner {
this.ssi = ssi;
this.listener = listener;
-// System.out.println("ScreenSharerRunner[captureWidth=" + ssi.captureWidth + ",captureHeight=" + ssi.captureHeight + "][" + ssi.x + "," + ssi.y +"]"
-// + "[scaleWidth=" + ssi.scaleWidth + ",scaleHeight=" + ssi.scaleHeight + "]");
+ System.out.println("ScreenSharerRunner[captureWidth=" + ssi.captureWidth + ",captureHeight=" + ssi.captureHeight + "][" + ssi.x + "," + ssi.y +"]"
+ + "[scaleWidth=" + ssi.scaleWidth + ",scaleHeight=" + ssi.scaleHeight + "]");
jcs = new FfmpegScreenshare(ssi, listener);
}
@@ -76,12 +76,12 @@ public class ScreenSharerRunner {
}
public void disconnectSharing(){
- //System.out.println(NAME + "Disconnected");
+ System.out.println(NAME + "Disconnected");
jcs.stop();
}
public void stopSharing() {
- //System.out.println(NAME + "Stopping");
+ System.out.println(NAME + "Stopping");
jcs.stop();
}
diff --git a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/javacv/FfmpegScreenshare.java b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/javacv/FfmpegScreenshare.java
index 05fcbe5c23..19171edaa8 100755
--- a/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/javacv/FfmpegScreenshare.java
+++ b/bbb-screenshare/jws/webstart/src/main/java/org/bigbluebutton/screenshare/client/javacv/FfmpegScreenshare.java
@@ -101,6 +101,7 @@ public class FfmpegScreenshare {
ignoreDisconnect = false;
grabber.start();
} catch (Exception e) {
+ System.out.println("Exception starting grabber.");
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
@@ -111,6 +112,7 @@ public class FfmpegScreenshare {
try {
mainRecorder.start();
} catch (Exception e) {
+ System.out.println("Exception starting recorder. \n" + e.toString());
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
}
@@ -155,13 +157,14 @@ public class FfmpegScreenshare {
//System.out.println("frame timestamp=[" + frame.timestamp + "] ");
mainRecorder.record(frame);
} catch (Exception e) {
- //System.out.println("CaptureScreen Exception 1");
+ System.out.println("CaptureScreen Exception 1");
if (!ignoreDisconnect) {
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
}
}
} catch (Exception e1) {
+ System.out.println("Exception grabbing image");
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
@@ -170,7 +173,7 @@ public class FfmpegScreenshare {
//System.out.println("timestamp=[" + timestamp + "]");
mainRecorder.setFrameNumber(frameNumber);
-// System.out.println("[ENCODER] encoded image " + frameNumber + " in " + (System.currentTimeMillis() - now));
+ //System.out.println("[ENCODER] encoded image " + frameNumber + " in " + (System.currentTimeMillis() - now));
frameNumber++;
long execDuration = (System.currentTimeMillis() - now);
@@ -183,6 +186,7 @@ public class FfmpegScreenshare {
try{
Thread.sleep(dur);
} catch (Exception e){
+ System.out.println("Exception pausing screen share.");
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
}
@@ -194,28 +198,29 @@ public class FfmpegScreenshare {
while (startBroadcast){
captureScreen();
}
- //System.out.println("*******************Stopped screen capture. !!!!!!!!!!!!!!!!!!!");
+ System.out.println("*******************Stopped screen capture. !!!!!!!!!!!!!!!!!!!");
}
};
startBroadcastExec.execute(startBroadcastRunner);
}
public void stop() {
- //System.out.println("Stopping screen capture.");
+ System.out.println("Stopping screen capture.");
startBroadcast = false;
if (mainRecorder != null) {
try {
ignoreDisconnect = true;
- //System.out.println("mainRecorder.stop.");
+ System.out.println("mainRecorder.stop.");
mainRecorder.stop();
- //System.out.println("mainRecorder.release.");
+ System.out.println("mainRecorder.release.");
mainRecorder.release();
- //System.out.println("grabber.stop.");
+ System.out.println("grabber.stop.");
// Do not invoke grabber.stop as it exits the JWS app.
// Not sure why. (ralam - aug 10, 2016)
//grabber.stop();
//System.out.println("End stop sequence.");
} catch (Exception e) {
+ System.out.println("Exception stopping screen share.");
listener.networkConnectionException(ExitCode.INTERNAL_ERROR, null);
}
}
@@ -291,6 +296,7 @@ private FFmpegFrameRecorder setupWindowsRecorder(String url, int width, int hei
winRecorder.setFormat("flv");
if (useH264) {
+ System.out.println("Using H264 codec");
// H264
winRecorder.setVideoCodec(AV_CODEC_ID_H264);
winRecorder.setPixelFormat(AV_PIX_FMT_YUV420P);
@@ -299,6 +305,7 @@ private FFmpegFrameRecorder setupWindowsRecorder(String url, int width, int hei
winRecorder.setVideoOption("tune", "zerolatency");
winRecorder.setVideoOption("intra-refresh", "1");
} else {
+ System.out.println("Using SVC2 codec");
// Flash SVC2
winRecorder.setVideoCodec(AV_CODEC_ID_FLASHSV2);
winRecorder.setPixelFormat(AV_PIX_FMT_BGR24);