Author: solomax
Date: Thu Feb 28 14:09:18 2013
New Revision: 1451205

URL: http://svn.apache.org/r1451205
Log:
SIP: video codec is changed to be h.264

Modified:
    
openmeetings/trunk/singlewebapp/WebContent/swf10/base/remote/baseVideoStream.lzx
    
openmeetings/trunk/singlewebapp/WebContent/swf10/video/editRecordStreamSWF10.lzx

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/base/remote/baseVideoStream.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/base/remote/baseVideoStream.lzx?rev=1451205&r1=1451204&r2=1451205&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/base/remote/baseVideoStream.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/base/remote/baseVideoStream.lzx
 Thu Feb 28 14:09:18 2013
@@ -211,53 +211,45 @@
         ]]>
     </method>
 
-       <!---
-               BroadCasts a Stream
-               @param string streamName the streamname to broadcast
-               @param camera camReference a reference to the Camera-Object to 
stream
-               @param micropone micReference a reference to the Micropohne 
Object to stream
-        -->
-       <method name="broadcast" args="streamName,camReference,micReference">
-               if (this._ns!=null){
+       <method name="prepare" args="mode,streamName,camReference,micReference">
+               if (this._ns != null){
                        this._stop();
                }
-               this.mode = "broadcast";
+               this.mode = mode;
                this.createStream();
-               if (camReference!=null) {
-                       this.setAttribute('camera',camReference);
+               
+               if (camReference != null) {
+                       this.setAttribute('camera', camReference);
                        this._ns.attachCamera(camReference);
                        //invokes Method in baseVideoView which shows the cam
                        this.attachCamera(camReference);
+                       
+                       var h264Settings:H264VideoStreamSettings = new 
H264VideoStreamSettings();
+                       h264Settings.setProfileLevel(H264Profile.BASELINE, 
H264Level.LEVEL_1_2);
+                       h264Settings.setQuality(camReference.bandwidth, 
camReference.quality);
+                       
h264Settings.setKeyFrameInterval(camReference.keyFrameInterval);
+                       h264Settings.setMode(camReference.width, 
camReference.height, camReference.fps);
+                       this._ns.videoStreamSettings = h264Settings;
+               }
+               if (micReference != null) {
+                       this.setAttribute('micro', micReference);
+                       this._ns.attachAudio(micReference);
                }
-           if (micReference!=null) {
-               this.setAttribute('micro',micReference);
-               this._ns.attachAudio(micReference);
-           }
-
-           this._ns.publish(streamName,"live");
+               
+               this._ns.publish(streamName, (mode == "broadcast") ? "live" : 
mode);
+       </method>
+       <!---
+               BroadCasts a Stream
+               @param string streamName the streamname to broadcast
+               @param camera camReference a reference to the Camera-Object to 
stream
+               @param micropone micReference a reference to the Micropohne 
Object to stream
+        -->
+       <method name="broadcast" args="streamName,camReference,micReference">
+               prepare("broadcast", streamName, camReference, micReference);
        </method>
 
        <method name="record" args="streamName,camReference,micReference">
-        if (this._ns!=null){
-            this._stop();
-        }
-        this.mode = "record";
-        this.createStream();
-
-        this.setBuffer(6);
-
-        if (camReference!=null) {
-            this.setAttribute('camera',camReference);
-            this._ns.attachCamera(camReference);
-            //invokes Method in baseVideoView which shows the cam
-            this.attachCamera(camReference);
-        }
-        if (micReference!=null) {
-            this.setAttribute('micro',micReference);
-            this._ns.attachAudio(micReference);
-        }
-
-        this._ns.publish(streamName,"record");
+               prepare("record", streamName, camReference, micReference);
     </method>
     
        <!---

Modified: 
openmeetings/trunk/singlewebapp/WebContent/swf10/video/editRecordStreamSWF10.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/WebContent/swf10/video/editRecordStreamSWF10.lzx?rev=1451205&r1=1451204&r2=1451205&view=diff
==============================================================================
--- 
openmeetings/trunk/singlewebapp/WebContent/swf10/video/editRecordStreamSWF10.lzx
 (original)
+++ 
openmeetings/trunk/singlewebapp/WebContent/swf10/video/editRecordStreamSWF10.lzx
 Thu Feb 28 14:09:18 2013
@@ -221,222 +221,181 @@
         ]]>
     </method>
 
-    <method name="doStartConference">
-       <![CDATA[
-           if ($debug) Debug.write("doninitalize");
-               var valCam = this.chosenCam;
-                       var valMic = this.chosenMic;
-                       var settings = this.chosenSetting;
-                       if (!canvas.isInterview) {
-                           
this.myvideocontainer.setDefaultVideoSize(this.cam_default_width,this.cam_default_height);
-                       }
-            
-                       var videoview = 
this.myvideocontainer._chatvideoinner._videostream;
-               if ($debug) Debug.write("this.myvideocontainer: 
",this.myvideocontainer);
-               if ($debug) Debug.write(valCam,valMic,settings);
-                       this.myvideocontainer.setAttribute('isremote',false);
-                       var _micro = null;
-                       var _camera = null;
-                       if (valMic != null) {
-                            _micro = Microphone.getEnhancedMicrophone(valMic);
-                            
-                            if (canvas.echoPath == 256) {
-                                var options:MicrophoneEnhancedOptions = new 
MicrophoneEnhancedOptions(); 
-                                options.mode = 
MicrophoneEnhancedMode.FULL_DUPLEX; 
-                                options.echoPath = 256; 
-                                options.nonLinearProcessing = true;
-                                _micro.enhancedOptions = options;
-                                if ($debug) Debug.write("echoPath set to 256");
-                            }
-                            
-                            if ($debug) Debug.write(_micro.enhancedOptions);
-                            if (_micro != null) {
-                                    _micro.codec = SoundCodec.NELLYMOSER;
-                                    //_micro.framesPerPacket = 1;
-                                    _micro.setSilenceLevel(0, 2000);
-                                    if(canvas.microphoneRateBest == 
'undefined') {                               
-                                            _micro.rate = 22;
-                                    } else {
-                                            _micro.rate = 
canvas.microphoneRateBest;
-                                    }
-                                    _micro.gain = 50;
-                                    // this has no effect if enhanced 
microphone is obtained
-                       //Microphone setUseEchoSupression(bool)
-                       _micro.setUseEchoSuppression(true);
-                   }
-                       }
-                       if (valCam != null) {
-                               _camera = Camera.getCamera(valCam);
+       <method name="getMic" args="valMic">
+       <![CDATA[
+               if ($debug) Debug.write("Entering getMic ...", valMic);
+               var _micro = null;
+               if (valMic != null) {
+                       _micro = Microphone.getEnhancedMicrophone(valMic);
+                       
+                       if (_micro != null && canvas.echoPath == 256) {
+                               var options:MicrophoneEnhancedOptions = new 
MicrophoneEnhancedOptions();
+                               options.mode = 
MicrophoneEnhancedMode.FULL_DUPLEX;
+                               options.echoPath = 256;
+                               options.nonLinearProcessing = true;
+                               _micro.enhancedOptions = options;
+                               if ($debug) Debug.write("echoPath set to 256");
+                               if ($debug) Debug.write(_micro.enhancedOptions);
+                       } else {
+                               _micro = Microphone.getMicrophone(valMic);
                        }
                        
-                       if ($debug) Debug.write("_camera.setMode: 
",videoview.width,videoview.height,canvas.framesPerSecond,true);
-
-                       if ($debug) Debug.write("canvas.microphoneRateBest: 
",canvas.microphoneRateBest);
-                       if (_camera != null) {
-                               if ($debug) Debug.write("_camera.setQuality 
BEST: 
",canvas.isInterview,(canvas.bandwidthNeededBest*2),canvas.camQualityBest);
-                               if (canvas.isInterview) {
-                                       //we need a fixed frame rate for the 
videos to merge them later on
-                                       
_camera.setMode(videoview.width,videoview.height,24,true);
-                                       if ($debug) Debug.warn("IS INTERVIEW ");
-                                   _camera.setQuality(0,98);
-                               } else {
-                                       
_camera.setMode(videoview.width,videoview.height,canvas.framesPerSecond,true);
-                                       if ($debug) Debug.warn("IS NO INTERVIEW 
");
-                                       
_camera.setQuality(canvas.bandwidthNeededBest,canvas.camQualityBest);
-                               }
+                       if (_micro != null) {
+                               _micro.codec = SoundCodec.NELLYMOSER;
+                               _micro.framesPerPacket = 1;
+                               _micro.setSilenceLevel(0, 2000);
+                               if ($debug) 
Debug.write("canvas.microphoneRateBest: ",canvas.microphoneRateBest);
+                               _micro.rate = (canvas.microphoneRateBest == 
'undefined') ? 22 : canvas.microphoneRateBest;
+                               _micro.gain = 50;
+                               // this has no effect if enhanced microphone is 
obtained
+                               //Microphone setUseEchoSupression(bool)
+                               _micro.setUseEchoSuppression(true);
                        }
-
-            if ($debug) Debug.write("settings: ", settings);
-            if ($debug) Debug.write("BroadcastId: ", 
this.currentClient.broadCastID);
-               switch (settings){
-                case "s":
-                    this.myvideocontainer.setAttribute("visibility","hidden");
-                    break;
-                case "vs":
-                    
videoview.broadcast(this.currentClient.broadCastID,_camera,null);
-                    if(canvas.isInterview) {
-                        canvas.videoComp_lc.send(canvas.videoComp_lc_name, 
"onStartBroadcast", this.currentClient.broadCastID, settings);
-                    } else {
-                        
this.myvideocontainer.setAttribute("visibility","visible");
-                        if (this.myvideocontainer.minimized) {
-                            this.myvideocontainer.reminimize();
-                        }
-                    }
-                    break;
-                       case "av":
-                               
videoview.broadcast(this.currentClient.broadCastID,_camera,_micro);
-                    if(canvas.isInterview) {
-                        canvas.videoComp_lc.send(canvas.videoComp_lc_name, 
"onStartBroadcast", this.currentClient.broadCastID, settings);
-                    } else {
-                        
this.myvideocontainer.setAttribute("visibility","visible");
-                        if (this.myvideocontainer.minimized) {
-                            this.myvideocontainer.reminimize();
-                        }
-                    }
-
-                               break;
-                       case "a":
-                               
videoview.broadcast(this.currentClient.broadCastID,null,_micro);
-                    if(canvas.isInterview) {
-                        canvas.videoComp_lc.send(canvas.videoComp_lc_name, 
"onStartBroadcast", this.currentClient.broadCastID, settings);
-                    } else {
-                        if (this.myvideocontainer.hidebyAudioOnly) {
-                            
this.myvideocontainer.setAttribute("visibility","hidden");
-                        } else {
-                            
this.myvideocontainer.setAttribute("visibility","visible");
-                            if (!this.myvideocontainer.minimized) {
-                                this.myvideocontainer.minimize();
-                            }
-                        }
-                    }
-                               break;
-                       case "v":
-                               
videoview.broadcast(this.currentClient.broadCastID,_camera,null);
-                               if(canvas.isInterview) {
-                        canvas.videoComp_lc.send(canvas.videoComp_lc_name, 
"onStartBroadcast", this.currentClient.broadCastID, settings);
-                    } else {
-                        
this.myvideocontainer.setAttribute("visibility","visible");
-                        if (this.myvideocontainer.minimized) {
-                            this.myvideocontainer.reminimize();
-                        }
-                    }
-                               break;
-                       case "n":
-                               if ($debug) Debug.write("Do not Publish A/V");
-                    //Prevent from Hiding the Box in Event Modus
-                    if (canvas.thishib.modus == "conference") {
-                        
this.myvideocontainer.setAttribute("visibility","hidden");
-                    }
-                               break;
-                       default:
-                               if ($debug) Debug.warn("no valid device Setup 
chosen");
-                               break;
-               }
-
-               this.close();
-        ]]>
-    </method>
-    
-    <method name="doStartRecording">
-        <![CDATA[
-        
-            this._btnStartRecording.setAttribute("enabled",false);
-            this._play.setAttribute("enabled",false);
-            
-            this.recordingsCounter = 5;
-            
-            this._text.setAttribute("visibility","visible");
-            this._text._info.setAttribute("text","5 sec");
-        
-            this.isRunning = true;
-            
-            var valCam = this.availibleCams.getValue();
-            var valMic = this.availibleCams.getValue();
-            
-            var videoview = 
this._video.content._publisher._chatvideoinner._videostream;
+               }
+               if ($debug) Debug.write("... getMic DONE", _micro);
+               return _micro;
+       ]]>
+       </method>
+       
+       <method name="getCam" args="valCam,videoview">
+       <![CDATA[
+               if ($debug) Debug.write("Entering getCam ...", valCam);
+               var _camera = null;
+               if (valCam != null) {
+                       _camera = Camera.getCamera(valCam);
+               }
+               if (_camera != null) {
             if ($debug) Debug.write("videoview: ",videoview);
-            if ($debug) Debug.write(valCam,valMic);
-            
-            var _micro = null;
-            var _camera = null;
-            
-            if (valMic != null) {
-                 _micro = Microphone.getMicrophone(valMic);
-                 if (_micro != null) {
-                     _micro.codec = SoundCodec.NELLYMOSER;
-                     _micro.framesPerPacket = 1;
-                     _micro.setSilenceLevel(0, 2000);
-                     _micro.gain = 50;
-                     // this has no effect if enhanced microphone is obtained
-                    //Microphone setUseEchoSupression(bool)
-                    _micro.setUseEchoSuppression(true);
-                }
-            }
-            if (valCam != null) {
-                _camera = Camera.getCamera(valCam);
-            }
-            
-            if ($debug) Debug.write("_camera.setMode: 
",videoview.width,videoview.height,canvas.framesPerSecond,true);
-
-            if ($debug) Debug.write("canvas.microphoneRateBest: 
",canvas.microphoneRateBest);
-            if (_camera != null) {
-                if ($debug) Debug.write("_camera.setQuality BEST: 
",this.isInterview,(canvas.bandwidthNeededBest*2),canvas.camQualityBest);
-                if (this.isInterview) {
-                    _camera.setMode(videoview.width,videoview.height,24,true);
-                    if ($debug) Debug.warn("IS INTERVIEW ");
-                    _camera.setQuality(0,98);
-                } else {
-                    
_camera.setMode(videoview.width,videoview.height,canvas.framesPerSecond,true);
-                    if ($debug) Debug.warn("IS NO INTERVIEW ");
-                    
_camera.setQuality(canvas.bandwidthNeededBest,canvas.camQualityBest);
-                }
-            
-            
-                   //The First start-timer message will come from the Flash 
Object
-                   if ($debug) Debug.warn("_camera.muted ",_camera.muted);
-                   if ($debug) Debug.warn("_micro.muted ",_micro.muted);
-                   
-                   if (!_camera.muted) {
-                       this.startTimer();
-                   }
-            
-            } else {
-               if (_micro != null) {
-                       this.startTimer();
-               }
-            }
-            
-            
-            
-
-            //start recording of client stream
-            var t = new Date();
-            this.lastRecorded = "TEST_SETUP_"+t.getTime();
-            
this._video.content._publisher.setAttribute("visibility","visible");
-            this._video.content._viewer.setAttribute("visibility","hidden");
-            videoview.record(this.lastRecorded,_camera,_micro);
-        ]]>
-    </method>
+                       
+                       if ($debug) Debug.write("_camera.setQuality BEST: ", 
canvas.isInterview, (canvas.bandwidthNeededBest*2), canvas.camQualityBest);
+                       if (canvas.isInterview) {
+                               //we need a fixed frame rate for the videos to 
merge them later on
+                               _camera.setMode(videoview.width, 
videoview.height, 24, true);
+                               if ($debug) Debug.warn("IS INTERVIEW ");
+                               _camera.setQuality(0, 98);
+                       } else {
+                               if ($debug) Debug.write("_camera.setMode: 
",videoview.width,videoview.height,canvas.framesPerSecond,true);
+                               _camera.setMode(videoview.width, 
videoview.height, canvas.framesPerSecond, true);
+                               if ($debug) Debug.warn("IS NO INTERVIEW ");
+                               _camera.setQuality(canvas.bandwidthNeededBest, 
canvas.camQualityBest);
+                       }
+               }
+               if ($debug) Debug.write("... getCam DONE", _camera);
+               return _camera;
+       ]]>
+       </method>
+       
+       <method name="doStartConference">
+       <![CDATA[
+               if ($debug) Debug.write("doninitalize");
+               var settings = this.chosenSetting;
+               if (!canvas.isInterview) {
+                       
this.myvideocontainer.setDefaultVideoSize(this.cam_default_width, 
this.cam_default_height);
+               }
+               
+               var videoview = 
this.myvideocontainer._chatvideoinner._videostream;
+               if ($debug) Debug.write("this.myvideocontainer: ", 
this.myvideocontainer);
+               this.myvideocontainer.setAttribute('isremote',false);
+               var _micro = this.getMic(this.chosenMic);
+               var _camera = this.getCam(this.chosenCam, videoview);
+               if ($debug) Debug.write(_camera , _micro, settings);
+               
+               if ($debug) Debug.write("BroadcastId: ", 
this.currentClient.broadCastID);
+               switch (settings){
+                       case "s":
+                               
this.myvideocontainer.setAttribute("visibility","hidden");
+                               break;
+                       case "vs":
+                               
videoview.broadcast(this.currentClient.broadCastID,_camera,null);
+                               if(canvas.isInterview) {
+                                       
canvas.videoComp_lc.send(canvas.videoComp_lc_name, "onStartBroadcast", 
this.currentClient.broadCastID, settings);
+                               } else {
+                                       
this.myvideocontainer.setAttribute("visibility","visible");
+                                       if (this.myvideocontainer.minimized) {
+                                               
this.myvideocontainer.reminimize();
+                                       }
+                               }
+                               break;
+                       case "av":
+                               
videoview.broadcast(this.currentClient.broadCastID,_camera,_micro);
+                               if(canvas.isInterview) {
+                                       
canvas.videoComp_lc.send(canvas.videoComp_lc_name, "onStartBroadcast", 
this.currentClient.broadCastID, settings);
+                               } else {
+                                       
this.myvideocontainer.setAttribute("visibility","visible");
+                                       if (this.myvideocontainer.minimized) {
+                                               
this.myvideocontainer.reminimize();
+                                       }
+                               }
+                               break;
+                       case "a":
+                               
videoview.broadcast(this.currentClient.broadCastID,null,_micro);
+                               if(canvas.isInterview) {
+                                       
canvas.videoComp_lc.send(canvas.videoComp_lc_name, "onStartBroadcast", 
this.currentClient.broadCastID, settings);
+                               } else {
+                                       if 
(this.myvideocontainer.hidebyAudioOnly) {
+                                               
this.myvideocontainer.setAttribute("visibility","hidden");
+                                       } else {
+                                               
this.myvideocontainer.setAttribute("visibility","visible");
+                                               if 
(!this.myvideocontainer.minimized) {
+                                                       
this.myvideocontainer.minimize();
+                                               }
+                                       }
+                               }
+                               break;
+                       case "v":
+                               
videoview.broadcast(this.currentClient.broadCastID,_camera,null);
+                               if(canvas.isInterview) {
+                                       
canvas.videoComp_lc.send(canvas.videoComp_lc_name, "onStartBroadcast", 
this.currentClient.broadCastID, settings);
+                               } else {
+                                       
this.myvideocontainer.setAttribute("visibility","visible");
+                                       if (this.myvideocontainer.minimized) {
+                                               
this.myvideocontainer.reminimize();
+                                       }
+                               }
+                               break;
+                       case "n":
+                               if ($debug) Debug.write("Do not Publish A/V");
+                               //Prevent from Hiding the Box in Event Modus
+                               if (canvas.thishib.modus == "conference") {
+                                       
this.myvideocontainer.setAttribute("visibility","hidden");
+                               }
+                               break;
+                       default:
+                               if ($debug) Debug.warn("no valid device Setup 
chosen");
+                               break;
+               }
+               this.close();
+       ]]>
+       </method>
+    
+       <method name="doStartRecording">
+       <![CDATA[
+               this._btnStartRecording.setAttribute("enabled",false);
+               this._play.setAttribute("enabled",false);
+               this.recordingsCounter = 5;
+               this._text.setAttribute("visibility","visible");
+               this._text._info.setAttribute("text","5 sec");
+               this.isRunning = true;
+               
+               var videoview = 
this._video.content._publisher._chatvideoinner._videostream;
+               var _micro = this.getMic(this.availibleMics.getValue());
+               var _camera = this.getCam(this.availibleCams.getValue(), 
videoview);
+               if ($debug) Debug.write(_camera, _micro);
+               
+               if ($debug && _camera != null) Debug.warn("_camera.muted ", 
_camera.muted);
+               if ($debug && _micro != null) Debug.warn("_micro.muted ", 
_micro.muted);
+               if ((_camera != null && !_camera.muted) || (_camera == null && 
_micro != null)) {
+                       this.startTimer();
+               }
+               
+               //start recording of client stream
+               var t = new Date();
+               this.lastRecorded = "TEST_SETUP_"+t.getTime();
+               
this._video.content._publisher.setAttribute("visibility","visible");
+               this._video.content._viewer.setAttribute("visibility","hidden");
+               videoview.record(this.lastRecorded,_camera,_micro);
+       ]]>
+       </method>
     
     <method name="doPlay">
        <![CDATA[


Reply via email to