- add more configurable options for webcam
This commit is contained in:
parent
19a571e944
commit
3d86d5d39c
@ -75,6 +75,12 @@
|
||||
publishWindowVisible="true"
|
||||
viewerWindowMaxed="true"
|
||||
viewerWindowLocation="middle"
|
||||
camKeyFrameInterval="5"
|
||||
camModeFps="15"
|
||||
camQualityBandwidth="0"
|
||||
camQualityPicture="50"
|
||||
h264Level="4.1"
|
||||
h264Profile="main"
|
||||
/>
|
||||
|
||||
<module name="WhiteboardModule" url="WhiteboardModule.swf?v=VERSION"
|
||||
|
@ -26,23 +26,23 @@ package org.bigbluebutton.modules.videoconf.business
|
||||
import flash.events.SecurityErrorEvent;
|
||||
import flash.net.NetConnection;
|
||||
import flash.net.NetStream;
|
||||
|
||||
/** Uncomment if you want to build support for H264. But you need at least FP 11. (ralam july 23, 2011)
|
||||
import flash.media.H264VideoStreamSettings;
|
||||
import flash.media.H264Profile;
|
||||
import flash.media.H264Level;
|
||||
**/
|
||||
import flash.system.Capabilities;
|
||||
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.common.UserManager;
|
||||
import org.bigbluebutton.core.BBB;
|
||||
import org.bigbluebutton.main.model.users.BBBUser;
|
||||
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
|
||||
import org.bigbluebutton.modules.videoconf.events.StartBroadcastEvent;
|
||||
import org.bigbluebutton.modules.videoconf.model.VideoConfOptions;
|
||||
import flash.system.Capabilities;
|
||||
|
||||
/** Uncomment if you want to build support for H264. But you need at least FP 11. (ralam july 23, 2011)
|
||||
|
||||
import flash.media.H264VideoStreamSettings;
|
||||
import flash.media.H264Profile;
|
||||
import flash.media.H264Level;
|
||||
**/
|
||||
|
||||
public class VideoProxy
|
||||
{
|
||||
@ -51,17 +51,14 @@ package org.bigbluebutton.modules.videoconf.business
|
||||
private var nc:NetConnection;
|
||||
private var ns:NetStream;
|
||||
|
||||
private function parseOptions():void {
|
||||
videoOptions = new VideoConfOptions();
|
||||
videoOptions.parseOptions();
|
||||
}
|
||||
|
||||
public function VideoProxy(url:String)
|
||||
{
|
||||
videoOptions = new VideoConfOptions();
|
||||
var vxml:XML = BBB.initConfigManager().config.getModuleConfig("VideoconfModule");
|
||||
if (vxml != null) {
|
||||
videoOptions.showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
videoOptions.autoStart = (vxml.@autoStart.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
videoOptions.publishWindowVisible = (vxml.@publishWindowVisible.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
videoOptions.viewerWindowMaxed = (vxml.@viewerWindowMaxed.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
videoOptions.viewerWindowLocation = vxml.@viewerWindowLocation.toString().toUpperCase();
|
||||
}
|
||||
parseOptions();
|
||||
|
||||
nc = new NetConnection();
|
||||
nc.client = this;
|
||||
@ -141,13 +138,54 @@ package org.bigbluebutton.modules.videoconf.business
|
||||
/* Uncomment if you want to build support for H264. But you need at least FP 11. (ralam july 23, 2011)
|
||||
if (Capabilities.version.search("11,0") != -1) {
|
||||
var h264:H264VideoStreamSettings = new H264VideoStreamSettings();
|
||||
h264.setProfileLevel(H264Profile.MAIN, H264Level.LEVEL_4_1);
|
||||
var h264profile:String = H264Profile.MAIN;
|
||||
if (videoOptions.h264Profile != "main") {
|
||||
h264profile = H264Profile.BASELINE;
|
||||
}
|
||||
var h264Level:String = H264Level.LEVEL_4_1;
|
||||
if (videoOptions.h264Level != "1") {
|
||||
h264Level = H264Level.LEVEL_1;
|
||||
} else if (videoOptions.h264Level != "1.1") {
|
||||
h264Level = H264Level.LEVEL_1_1;
|
||||
} else if (videoOptions.h264Level != "1.2") {
|
||||
h264Level = H264Level.LEVEL_1_2;
|
||||
} else if (videoOptions.h264Level != "1.3") {
|
||||
h264Level = H264Level.LEVEL_1_3;
|
||||
} else if (videoOptions.h264Level != "1b") {
|
||||
h264Level = H264Level.LEVEL_1B;
|
||||
} else if (videoOptions.h264Level != "2") {
|
||||
h264Level = H264Level.LEVEL_2;
|
||||
} else if (videoOptions.h264Level != "2.1") {
|
||||
h264Level = H264Level.LEVEL_2_1;
|
||||
} else if (videoOptions.h264Level != "2.2") {
|
||||
h264Level = H264Level.LEVEL_2_2;
|
||||
} else if (videoOptions.h264Level != "3") {
|
||||
h264Level = H264Level.LEVEL_3;
|
||||
} else if (videoOptions.h264Level != "3.1") {
|
||||
h264Level = H264Level.LEVEL_3_1;
|
||||
} else if (videoOptions.h264Level != "3.2") {
|
||||
h264Level = H264Level.LEVEL_3_2;
|
||||
} else if (videoOptions.h264Level != "4") {
|
||||
h264Level = H264Level.LEVEL_4;
|
||||
} else if (videoOptions.h264Level != "4.1") {
|
||||
h264Level = H264Level.LEVEL_4_1;
|
||||
} else if (videoOptions.h264Level != "4.2") {
|
||||
h264Level = H264Level.LEVEL_4_2;
|
||||
} else if (videoOptions.h264Level != "5") {
|
||||
h264Level = H264Level.LEVEL_5;
|
||||
} else if (videoOptions.h264Level != "5.1") {
|
||||
h264Level = H264Level.LEVEL_5_1;
|
||||
}
|
||||
|
||||
h264.setProfileLevel(h264profile, h264Level);
|
||||
ns.videoStreamSettings = h264;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
ns.publish(e.stream);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function stopBroadcasting():void{
|
||||
if (ns != null) {
|
||||
ns.attachCamera(null);
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.bigbluebutton.modules.videoconf.model
|
||||
{
|
||||
import org.bigbluebutton.core.BBB;
|
||||
|
||||
public class VideoConfOptions
|
||||
{
|
||||
[Bindable]
|
||||
@ -16,6 +18,62 @@ package org.bigbluebutton.modules.videoconf.model
|
||||
|
||||
[Bindable]
|
||||
public var viewerWindowLocation:String = "middle";
|
||||
|
||||
[Bindable]
|
||||
public var camKeyFrameInterval:Number = 5;
|
||||
|
||||
[Bindable]
|
||||
public var camModeFps:Number = 15;
|
||||
|
||||
[Bindable]
|
||||
public var camQualityBandwidth:Number = 0;
|
||||
|
||||
[Bindable]
|
||||
public var h264Level:String = "4.1";
|
||||
|
||||
[Bindable]
|
||||
public var h264Profile:String = "main";
|
||||
|
||||
[Bindable]
|
||||
public var camQualityPicture:Number = 50;
|
||||
|
||||
public function parseOptions():void {
|
||||
var vxml:XML = BBB.initConfigManager().config.getModuleConfig("VideoconfModule");
|
||||
if (vxml != null) {
|
||||
if (vxml.@showButton != undefined) {
|
||||
showButton = (vxml.@showButton.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
}
|
||||
if (vxml.@autoStart != undefined) {
|
||||
autoStart = (vxml.@autoStart.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
}
|
||||
if (vxml.@publishWindowVisible != undefined) {
|
||||
publishWindowVisible = (vxml.@publishWindowVisible.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
}
|
||||
if (vxml.@viewerWindowMaxed != undefined) {
|
||||
viewerWindowMaxed = (vxml.@viewerWindowMaxed.toString().toUpperCase() == "TRUE") ? true : false;
|
||||
}
|
||||
if (vxml.@viewerWindowLocation != undefined) {
|
||||
viewerWindowLocation = vxml.@viewerWindowLocation.toString().toUpperCase();
|
||||
}
|
||||
if (vxml.@viewerWindowLocation != undefined) {
|
||||
viewerWindowLocation = vxml.@viewerWindowLocation.toString().toUpperCase();
|
||||
}
|
||||
if (vxml.@camModeFps != undefined) {
|
||||
camModeFps = Number(vxml.@camModeFps.toString());
|
||||
}
|
||||
if (vxml.@camQualityBandwidth != undefined) {
|
||||
camQualityBandwidth = Number(vxml.@camQualityBandwidth.toString());
|
||||
}
|
||||
if (vxml.@camQualityPicture != undefined) {
|
||||
camQualityPicture = Number(vxml.@camQualityPicture.toString());
|
||||
}
|
||||
if (vxml.@h264Level != undefined) {
|
||||
h264Level = vxml.@h264Level.toString();
|
||||
}
|
||||
if (vxml.@h264Profile != undefined) {
|
||||
h264Profile = vxml.@h264Profile.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -132,9 +132,9 @@
|
||||
|
||||
setResolution();
|
||||
|
||||
camera.setKeyFrameInterval(5);
|
||||
camera.setMode(camWidth,camHeight,15);
|
||||
camera.setQuality(0,quality);
|
||||
camera.setKeyFrameInterval(videoOptions.camKeyFrameInterval);
|
||||
camera.setMode(camWidth, camHeight, videoOptions.camModeFps);
|
||||
camera.setQuality(videoOptions.camQualityBandwidth, videoOptions.camQualityPicture);
|
||||
|
||||
video = new Video(camWidth, camHeight);
|
||||
//Next two lines may seem redundant but they're not. Do not delete.
|
||||
|
Loading…
Reference in New Issue
Block a user