Skip to content

Commit

Permalink
Added new parameter to control framerate
Browse files Browse the repository at this point in the history
  • Loading branch information
olajide.dele committed Jun 6, 2011
1 parent 754c2ce commit 97ee10f
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 84 deletions.
2 changes: 0 additions & 2 deletions do_run.cmd

This file was deleted.

2 changes: 0 additions & 2 deletions do_run2.cmd

This file was deleted.

48 changes: 0 additions & 48 deletions log/screenshare.log

This file was deleted.

Binary file modified org/redfire/screen/ScreenShare$1.class
Binary file not shown.
Binary file modified org/redfire/screen/ScreenShare$2.class
Binary file not shown.
Binary file modified org/redfire/screen/ScreenShare$3.class
Binary file not shown.
Binary file modified org/redfire/screen/ScreenShare$4.class
Binary file not shown.
Binary file modified org/redfire/screen/ScreenShare$5.class
Binary file not shown.
Binary file modified org/redfire/screen/ScreenShare$CaptureScreen.class
Binary file not shown.
Binary file modified org/redfire/screen/ScreenShare.class
Binary file not shown.
21 changes: 16 additions & 5 deletions org/redfire/screen/ScreenShare.java
Expand Up @@ -51,7 +51,8 @@ public class ScreenShare {
public Integer playStreamId;
public Integer publishStreamId;
public String publishName;
public String codec = "flashsv1";
public String codec = "flashsv2";
public int frameRate = 10;

public CaptureScreen capture = null;
public Thread thread = null;
Expand Down Expand Up @@ -107,19 +108,23 @@ public static void main(String[] args)
{
instance = ScreenShare.getInstance();

if (args.length == 5) {
if (args.length == 6) {
instance.host = args[0];
instance.app = args[1];
instance.port = Integer.parseInt(args[2]);
instance.publishName = args[3];
instance.codec = args[4];

try {
instance.frameRate = Integer.parseInt(args[5]);
} catch (Exception e) {}

System.out.println("User home " + System.getProperty("user.home"));
System.out.println("User Dir " + System.getProperty("user.dir"));

} else {
instance = null;
System.out.println("\nRed5 SceenShare: use as java ScreenShare <host> <app name> <port> <stream name>\n Example: SceenShare localhost oflaDemo 1935 screen_stream");
System.out.println("\nRed5 SceenShare: use as java ScreenShare <host> <app name> <port> <stream name> <codec> <frame rate>\n Example: SceenShare localhost oflaDemo 1935 screen_stream flashsv2 15");
System.exit(0);
}

Expand Down Expand Up @@ -598,7 +603,7 @@ public void run()
double widthTransformScale = 0.5;
double heightTransformScale = 0.5;

final int timeBetweenFrames = 1000; //frameRate
final int timeBetweenFrames = 1000 / frameRate;

widthTransformScale = width > 1024 ? (double) (width/1024) : 1;
heightTransformScale = height > 768 ? (double) (height/768) : 1;
Expand Down Expand Up @@ -636,8 +641,14 @@ public void run()
}

final int spent = (int) (System.currentTimeMillis() - ctime);
final int sleep = Math.max(0, timeBetweenFrames - spent);

if ( kt < 50 ) {
logger.debug( "Sleep " + sleep );
System.out.println( "Sleep " + sleep);
}

Thread.sleep(Math.max(0, timeBetweenFrames - spent));
Thread.sleep(sleep);
}
}
catch (Exception e)
Expand Down
Binary file removed screenshare.jar
Binary file not shown.
25 changes: 0 additions & 25 deletions screenshare.jnlp

This file was deleted.

2 changes: 1 addition & 1 deletion webapp/screenshare/do_run1.cmd
@@ -1,2 +1,2 @@
"C:\Program Files\Java\jdk1.6.0_01\bin\java" -classpath screenshare.jar org.redfire.screen.ScreenShare btg199251 screenshare 1935 screen_share flashsv1
"C:\Program Files\Java\jdk1.6.0_01\bin\java" -classpath screenshare.jar org.redfire.screen.ScreenShare btg199251 screenshare 1935 screen_share flashsv1 30
pause
2 changes: 1 addition & 1 deletion webapp/screenshare/do_run2.cmd
@@ -1,2 +1,2 @@
"C:\Program Files\Java\jdk1.6.0_01\bin\java" -classpath screenshare.jar org.redfire.screen.ScreenShare btg199251 screenshare 1935 screen_share flashsv2
"C:\Program Files\Java\jdk1.6.0_01\bin\java" -classpath screenshare.jar org.redfire.screen.ScreenShare btg199251 screenshare 1935 screen_share flashsv2 30
pause
Binary file modified webapp/screenshare/screenshare.jar
Binary file not shown.
1 change: 1 addition & 0 deletions webapp/screenshare/screenshare.jnlp
Expand Up @@ -21,5 +21,6 @@
<argument>1935</argument>
<argument>screen_share</argument>
<argument>flashsv2</argument>
<argument>30</argument>
</application-desc>
</jnlp>

0 comments on commit 97ee10f

Please sign in to comment.