[Red5commits] [1299] minor changes

pgregoire luke at codegent.com
Fri Sep 1 03:10:07 EDT 2006


minor changes


Timestamp: 09/01/06 02:00:23 EST (less than one hour ago) 
Change: 1299 
Author: pgregoire

Files (see diff or trac for details): 
java/scripting/branches/paulg_0.6/samples/application.groovy
java/scripting/branches/paulg_0.6/samples/application.js
java/scripting/branches/paulg_0.6/samples/application.rb


Trac: http://mirror1.cvsdude.com/trac/osflash/red5/changeset/1299

Index: /java/scripting/branches/paulg_0.6/samples/application.rb
===================================================================
--- /java/scripting/branches/paulg_0.6/samples/application.rb (revision 1298)
+++ /java/scripting/branches/paulg_0.6/samples/application.rb (revision 1299)
@@ -1,34 +1,31 @@
+# JRuby - style
 require 'java'
-
 module RedFive
-	include_class 'org.red5.server.api.IConnection'
-	include_class 'org.red5.server.api.IScope'
-	include_class 'org.red5.server.api.stream.IPlayItem'
-	include_class 'org.red5.server.api.stream.IServerStream'
-	include_class 'org.red5.server.api.stream.IStreamCapableConnection'
-	include_class 'org.red5.server.api.stream.support.SimpleBandwidthConfigure'
-	include_class 'org.red5.server.api.stream.support.SimplePlayItem'
-	include_class 'org.red5.server.api.stream.support.StreamUtils'
+    include_package "org.red5.server.api"
+	include_package "org.red5.server.api.stream"
+	include_package "org.red5.server.api.stream.support"
+	include_package "org.red5.server.adapter"
+	include_package "org.red5.server.stream"
 end
-
-include_class 'org.red5.server.adapter.ApplicationAdapter'
+#include_class "org.red5.server.adapter.ApplicationAdapter"
 
 #
-# application.js - a translation into JavaScript of the olfa demo application, a red5 example.
+# application.js - a translation into Ruby of the olfa demo application, a red5 example.
 #
 # @author Paul Gregoire
 #
-class Application < ApplicationAdapter
+class Application < RedFive::ApplicationAdapter
 
-	attr_reader :appScope, :serverStream
+    attr_reader :appScope, :serverStream
 	attr_writer :appScope, :serverStream
 	 
 	def initialize
-		super
-		puts "Initializing ruby application"
+	   #call super to init the superclass, in this case a Java class
+	   super
+	   puts "Initializing ruby application"
 	end
 
 	def appStart(app)
-		puts "Ruby appStart"
+        puts "Ruby appStart"
 		@appScope = app
 		return true
@@ -37,11 +34,13 @@
 	def appConnect(conn, params) 
 		puts "Ruby appConnect"
-		super.measureBandwidth(conn)
-		if conn.kind_of?(RedFive::IStreamCapableConnection)
+		measureBandwidth(conn)
+		puts "Ruby appConnect 2"
+		if conn.instance_of?(RedFive::IStreamCapableConnection)
+		    puts "Got stream capable connection"
 			streamConn = conn
 			sbc = RedFive::SimpleBandwidthConfigure.new
-			sbc.setMaxBurst(8*1024*1024)
-			sbc.setBurst(8*1024*1024)
-			sbc.setOverallBandwidth(2*1024*1024)
+			sbc.setMaxBurst(8388608)
+			sbc.setBurst(8388608)
+			sbc.setOverallBandwidth(8388608)
 			streamConn.setBandwidthConfigure(sbc)
 		end
@@ -62,2 +61,10 @@
 
 end
+
+puts "Ruby application"
+a = Application.new
+puts "Application started?", a.appStart(nil)
+a.appConnect(nil, nil)
+
+#aa = RedFive::ApplicationAdapter.new
+#puts aa.appStart(nil)
Index: /java/scripting/branches/paulg_0.6/samples/application.groovy
===================================================================
--- /java/scripting/branches/paulg_0.6/samples/application.groovy (revision 1298)
+++ /java/scripting/branches/paulg_0.6/samples/application.groovy (revision 1299)
@@ -31,7 +31,7 @@
 			def streamConn = conn
 			def sbc = new SimpleBandwidthConfigure()
-			sbc.setMaxBurst(8*1024*1024)
-			sbc.setBurst(8*1024*1024)
-			sbc.setOverallBandwidth(2*1024*1024)
+			sbc.setMaxBurst(8388608)
+			sbc.setBurst(8388608)
+			sbc.setOverallBandwidth(8388608)
 			streamConn.setBandwidthConfigure(sbc)
 		}
Index: /java/scripting/branches/paulg_0.6/samples/application.js
===================================================================
--- /java/scripting/branches/paulg_0.6/samples/application.js (revision 1298)
+++ /java/scripting/branches/paulg_0.6/samples/application.js (revision 1299)
@@ -23,5 +23,5 @@
 
 	with(javaNames) {
-
+		//has-a instead of is-a until i figure out extends in JS
 		var adapter = new ApplicationAdapter();
 	
@@ -70,6 +70,7 @@
 with (javaNames) {
     try {
-    	var supr = new Application();
-    	print('testing js app: ' + supr.appStart(null));
+    	var ap = new Application();
+    	print('Testing js app: ' + ap.appStart(null));
+    	ap.appConnect(null, null);
     } catch(e) {
     	print('Exception: ' + e);


Note:
Diffs are chopped if more than 25k.
This is to get past the limit on the mailing list.



More information about the Red5commits mailing list