本文整理汇总了Java中org.red5.server.api.service.IServiceCapableConnection类的典型用法代码示例。如果您正苦于以下问题:Java IServiceCapableConnection类的具体用法?Java IServiceCapableConnection怎么用?Java IServiceCapableConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IServiceCapableConnection类属于org.red5.server.api.service包,在下文中一共展示了IServiceCapableConnection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: callBWCheck
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void callBWCheck(Object payload) {
if (log.isTraceEnabled()) {
log.trace("callBWCheck: {}", payload);
} else {
log.debug("callBWCheck");
}
IConnection conn = Red5.getConnectionLocal();
Map<String, Object> statsValues = new HashMap<String, Object>();
statsValues.put("count", packetsReceived.get());
statsValues.put("sent", packetsSent.get());
statsValues.put("timePassed", timePassed);
statsValues.put("latency", latency);
statsValues.put("cumLatency", cumLatency);
statsValues.put("payload", payload);
if (conn instanceof IServiceCapableConnection) {
log.debug("Invoking onBWCheck on the client");
// increment sent counter
packetsSent.incrementAndGet();
// invoke on the client
((IServiceCapableConnection) conn).invoke("onBWCheck", new Object[] { statsValues }, this);
}
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:23,代码来源:ServerClientDetection.java
示例2: callBWDone
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void callBWDone() {
log.debug("callBWDone");
IConnection conn = Red5.getConnectionLocal();
Map<String, Object> statsValues = new HashMap<String, Object>();
statsValues.put("kbitDown", kbitDown);
statsValues.put("deltaDown", deltaDown);
statsValues.put("deltaTime", deltaTime);
statsValues.put("latency", latency);
if (conn instanceof IServiceCapableConnection) {
log.debug("Invoking onBWDone on the client");
// invoke on the client
((IServiceCapableConnection) conn).invoke("onBWDone", new Object[] { statsValues });
// adjust bandwidth to mbit/s
int mbits = (int) ((kbitDown / 1000d) * 1000000);
log.debug("Setting bandwidth to {} mbit/s", mbits);
// tell the flash player how fast we want data and how fast we shall send it
conn.setBandwidth(mbits);
}
}
开发者ID:Red5,项目名称:red5-server-common,代码行数:20,代码来源:ServerClientDetection.java
示例3: callBWCheck
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void callBWCheck(Object payload)
{
IConnection conn = Red5.getConnectionLocal();
Map<String, Object> statsValues = new HashMap<String, Object>();
statsValues.put("count", this.count);
statsValues.put("sent", this.sent);
statsValues.put("timePassed", this.timePassed);
statsValues.put("latency", this.latency);
statsValues.put("cumLatency", this.cumLatency);
statsValues.put("payload", payload);
if (conn instanceof IServiceCapableConnection) {
((IServiceCapableConnection) conn).invoke("onBWCheck", new Object[]{statsValues}, this);
}
}
开发者ID:Red5,项目名称:red5-examples,代码行数:18,代码来源:ServerClientDetection.java
示例4: setRelayClient
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
public void setRelayClient() {
IConnection c = Red5.getConnectionLocal();
if (c instanceof IServiceCapableConnection) {
relayclient = c;
state.set(values.relayclient, c.getRemoteAddress());
Util.log("relayclient connected from: " + state.get(values.relayclient), this);
if (authtoken != null) {
IServiceCapableConnection sc = (IServiceCapableConnection) relayclient;
sc.invoke("relayCallClient", new Object[] { "writesetting",
GUISettings.relayserverauth.toString()+" "+authtoken });
}
if (state.exists(values.driver)) {
player.close();
player = null;
loginRecords.signoutDriver();
driverCallServer(PlayerCommands.publish, streamstate.stop.toString());
}
}
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:22,代码来源:Application.java
示例5: setGrabberVideoSoundMode
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void setGrabberVideoSoundMode(String str) {
if (!settings.getBoolean(ManualSettings.useflash)) return;
if (state.getBoolean(State.values.autodocking.name())) {
messageplayer("command dropped, autodocking", null, null);
return;
}
if (state.get(State.values.stream) == null) {
messageplayer("stream control unavailable, server may be in setup mode", null, null);
return;
}
long timeout = System.currentTimeMillis() + GRABBERRELOADTIMEOUT;
while (!(grabber instanceof IServiceCapableConnection) && System.currentTimeMillis() < timeout ) { Util.delay(10); }
if (!(grabber instanceof IServiceCapableConnection))
Util.log("setGrabberVideoSoundMode() error grabber reload timeout", this);
IServiceCapableConnection sc = (IServiceCapableConnection) grabber;
sc.invoke("videoSoundMode", new Object[]{str});
state.set(State.values.videosoundmode, str);
Util.log("grabber video sound mode = " + str, this);
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:25,代码来源:Application.java
示例6: frameGrab
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
/** */
public boolean frameGrab(String res) {
if(state.getBoolean(State.values.framegrabbusy.name()) ||
!(state.get(State.values.stream).equals(Application.streamstate.camera.toString()) ||
state.get(State.values.stream).equals(Application.streamstate.camandmic.toString()))) {
messageplayer("stream unavailable or framegrab busy", null, null);
return false;
}
if (settings.getBoolean(ManualSettings.useflash)) {
if (grabber instanceof IServiceCapableConnection) {
IServiceCapableConnection sc = (IServiceCapableConnection) grabber;
if (res.equals(AutoDock.LOWRES)) sc.invoke("framegrabMedium", new Object[]{});
else sc.invoke("framegrab", new Object[]{});
state.set(State.values.framegrabbusy.name(), true);
}
}
else video.framegrab(res);
// Util.debug("framegrab start at: "+System.currentTimeMillis(), this);
return true;
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:24,代码来源:Application.java
示例7: messageplayer
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
public void messageplayer(String str, String status, String value) {
if (state.exists(values.relayserver)) {
red5client.sendToRelay("messageplayer", new Object[] {str, status, value});
}
if (player instanceof IServiceCapableConnection) {
IServiceCapableConnection sc = (IServiceCapableConnection) player;
sc.invoke("message", new Object[] { str, "green", status, value });
}
if(commandServer!=null) {
if(str!=null){
if(! str.equals("status check received")) // basic ping from client, ignore
commandServer.sendToGroup(TelnetServer.MSGPLAYERTAG + " " + str);
}
if (status !=null) {
commandServer.sendToGroup(TelnetServer.MSGPLAYERTAG + " <status> " + status + " " + value);
}
}
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:23,代码来源:Application.java
示例8: beAPassenger
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
/** */
private void beAPassenger(String user) {
String stream = state.get(State.values.stream);
pendingplayerisnull = true;
String str = user + " added as passenger";
messageplayer(str, null, null);
Util.log(str,this);
messageGrabber(str, null);
if (!stream.equals("stop")) {
Collection<Set<IConnection>> concollection = getConnections();
for (Set<IConnection> cc : concollection) {
for (IConnection con : cc) {
if (con instanceof IServiceCapableConnection
&& con != grabber && con != player) {
IServiceCapableConnection sc = (IServiceCapableConnection) con;
sc.invoke("message", new Object[] { "streaming " + stream, "green", "stream", stream }); }
}
}
}
loginRecords.bePassenger(user);
if (settings.getBoolean(GUISettings.loginnotify)) {
saySpeech("passenger lawg inn f" + user);
}
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:26,代码来源:Application.java
示例9: disconnectOtherConnections
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void disconnectOtherConnections() {
if (loginRecords.isAdmin()) {
int i = 0;
Collection<Set<IConnection>> concollection = getConnections();
for (Set<IConnection> cc : concollection) {
for (IConnection con : cc) {
if (con instanceof IServiceCapableConnection
&& con != grabber && con != player) {
con.close();
i++;
}
}
}
messageplayer(i + " passengers eliminated", null, null);
}
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:17,代码来源:Application.java
示例10: chat
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void chat(String str) {
Collection<Set<IConnection>> concollection = getConnections();
for (Set<IConnection> cc : concollection) {
for (IConnection con : cc) {
if (con instanceof IServiceCapableConnection && con != grabber
&& !(con == pendingplayer && !pendingplayerisnull)) {
IServiceCapableConnection n = (IServiceCapableConnection) con;
n.invoke("message", new Object[] { str, "yellow", null, null });
}
}
}
Util.log("chat: " + str,this);
messageGrabber("<CHAT>" + str, null);
if(str!=null) if (commandServer != null) {
str = str.replaceAll("</?i>", "");
commandServer.sendToGroup(TelnetServer.TELNETTAG+" chat from "+ str);
}
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:19,代码来源:Application.java
示例11: playerSignIn
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
public void playerSignIn(Object[] params) {
// disonnect any drivers/passengers/pending
boolean delay = false;
Collection<Set<IConnection>> concollection = app.getConnections();
for (Set<IConnection> cc : concollection) {
for (IConnection con : cc) {
if (con instanceof IServiceCapableConnection && con != app.grabber) {
con.close();
delay = true;
}
}
}
if (delay) Util.delay(500); // allow player to logout TODO: blocking!
state.set(State.values.driver, params[0].toString());
app.initialstatuscalled = false;
Util.log("relay playersignin(): " + params[0].toString(), this);
app.loginRecords.beDriver();
if (settings.getBoolean(GUISettings.loginnotify))
app.driverCallServer(PlayerCommands.speech, state.get(State.values.driver));
app.watchdog.lastpowererrornotify = null;
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:25,代码来源:Red5Client.java
示例12: callBWCheck
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void callBWCheck(Object payload) {
if (log.isTraceEnabled()) {
log.trace("callBWCheck: {}", payload);
} else {
log.debug("callBWCheck");
}
IConnection conn = Red5.getConnectionLocal();
Map<String, Object> statsValues = new HashMap<String, Object>();
statsValues.put("count", packetsReceived.get());
statsValues.put("sent", packetsSent.get());
statsValues.put("timePassed", timePassed);
statsValues.put("latency", latency);
statsValues.put("cumLatency", cumLatency);
statsValues.put("payload", payload);
if (conn instanceof IServiceCapableConnection) {
log.debug("Invoking onBWCheck on the client");
// increment sent counter
packetsSent.incrementAndGet();
// invoke on the client
((IServiceCapableConnection) conn).invoke("onBWCheck", new Object[] { statsValues }, this);
}
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:23,代码来源:ServerClientDetection.java
示例13: callBWDone
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void callBWDone() {
log.debug("callBWDone");
IConnection conn = Red5.getConnectionLocal();
Map<String, Object> statsValues = new HashMap<String, Object>();
statsValues.put("kbitDown", kbitDown);
statsValues.put("deltaDown", deltaDown);
statsValues.put("deltaTime", deltaTime);
statsValues.put("latency", latency);
if (conn instanceof IServiceCapableConnection) {
log.debug("Invoking onBWDone on the client");
// invoke on the client
((IServiceCapableConnection) conn).invoke("onBWDone", new Object[] { statsValues });
// adjust bandwidth to mbit/s
int mbits = (int) ((kbitDown / 1000d) * 1000000);
log.debug("Setting bandwidth to {} mbit/s", mbits);
// tell the flash player how fast we want data and how fast we shall send it
conn.setBandwidth(mbits);
}
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:20,代码来源:ServerClientDetection.java
示例14: run
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
@Override
public void run() {
try {
if (scope == null) {
_log.debug("[MessageSender] -> 'Unable to send message to NULL scope' {}, {}", method, msg);
} else {
if (_log.isTraceEnabled()) {
_log.trace("[MessageSender] -> 'sending message' {}, {}", method, msg);
}
// Send to all Clients of that Scope(Room)
int count = 0;
for (IConnection conn : scope.getClientConnections()) {
if (conn != null && conn instanceof IServiceCapableConnection) {
if (filter(conn)) {
continue;
}
((IServiceCapableConnection) conn).invoke(method, new Object[] { msg }, callback);
count++;
}
}
if (_log.isTraceEnabled()) {
_log.trace("[MessageSender] -> 'sending message to {} clients, DONE' {}", count, method);
}
}
} catch (Exception err) {
_log.error(String.format("[MessageSender -> %s, %s]", method, msg), err);
}
}
开发者ID:apache,项目名称:openmeetings,代码行数:29,代码来源:ScopeApplicationAdapter.java
示例15: getVideoStreams
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
public List<Map<String, Object>> getVideoStreams() {
List<Map<String, Object>> result = new ArrayList<>();
// Notify all clients of the same scope (room)
IConnection current = Red5.getConnectionLocal();
for (IConnection conn : current.getScope().getClientConnections()) {
if (conn != null && conn instanceof IServiceCapableConnection) {
StreamClient c = sessionManager.get(IClientUtil.getId(conn.getClient()));
if (!Strings.isEmpty(c.getAvsettings()) && Client.Type.sharing != c.getType()) {
Map<String, Object> map = new HashMap<>();
add(map, "streamId", c.getId());
add(map, "broadCastId", c.getBroadcastId());
add(map, PARAM_USER_ID, c.getUserId());
add(map, "firstname", c.getFirstname());
add(map, "lastname", c.getLastname());
add(map, "publicSid", c.getUid());
add(map, "login", c.getLogin());
add(map, "email", c.getEmail());
add(map, "avsettings", c.getAvsettings());
add(map, "interviewPodId", c.getInterviewPodId());
add(map, "vWidth", c.getWidth());
add(map, "vHeight", c.getHeight());
result.add(map);
}
}
}
return result;
}
开发者ID:apache,项目名称:openmeetings,代码行数:28,代码来源:MobileService.java
示例16: FCPublish
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
@Override
public void FCPublish(String streamName) {
// TODO Auto-generated method stub
log.debug("Inside FCPublish - stream name: " + streamName);
IConnection conn = Red5.getConnectionLocal();
((IServiceCapableConnection) conn).invoke("onFCPublish", new Object[]{new StatusCode("NetStream.Publish.Start", streamName)});
super.FCPublish(streamName);
}
开发者ID:rajdeeprath,项目名称:red5-server-apps,代码行数:12,代码来源:Application.java
示例17: DVRSubscribe
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
@Override
public void DVRSubscribe(String name) {
// TODO Auto-generated method stub
log.debug("Inside DVRSubscribe - stream name: " + name);
String streamFullName = DVRUtils.getStreamFullName(name);
IDVRStream stream = this.getStream(streamFullName, true);
IConnection conn = Red5.getConnectionLocal();
((IServiceCapableConnection) conn).invoke("onDVRSubscribe", new Object[]{new StatusCode("NetStream.Play.Start", name)});
}
开发者ID:rajdeeprath,项目名称:red5-server-apps,代码行数:13,代码来源:Application.java
示例18: DVRUnSubscribe
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
@Override
public void DVRUnSubscribe(String name) {
// TODO Auto-generated method stub
log.debug("Inside DVRUnSubscribe - stream name: " + name);
String streamFullName = DVRUtils.getStreamFullName(name);
IDVRStream stream = this.getStream(streamFullName, true);
IConnection conn = Red5.getConnectionLocal();
((IServiceCapableConnection) conn).invoke("onDVRUnSubscribe", new Object[]{new StatusCode("NetStream.Play.Stop", name)});
}
开发者ID:rajdeeprath,项目名称:red5-server-apps,代码行数:13,代码来源:Application.java
示例19: callBWDone
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
private void callBWDone()
{
IConnection conn = Red5.getConnectionLocal();
Map<String, Object> statsValues = new HashMap<String, Object>();
statsValues.put("kbitDown", this.kbitDown);
statsValues.put("deltaDown", this.deltaDown);
statsValues.put("deltaTime", this.deltaTime);
statsValues.put("latency", this.latency);
if (conn instanceof IServiceCapableConnection) {
((IServiceCapableConnection) conn).invoke("onBWDone", new Object[]{statsValues});
}
}
开发者ID:Red5,项目名称:red5-examples,代码行数:15,代码来源:ServerClientDetection.java
示例20: grabbersignin
import org.red5.server.api.service.IServiceCapableConnection; //导入依赖的package包/类
public void grabbersignin(String mode) {
if (mode.equals("init")) {
state.delete(State.values.stream);
} else {
// state.set(State.values.stream, Application.streamstate.stop.toString());
driverCallServer(PlayerCommands.state, State.values.stream.toString() + " " +
Application.streamstate.stop.toString());
}
grabber = Red5.getConnectionLocal();
String str = "awaiting connection";
if (state.get(State.values.driver) != null) {
str = state.get(State.values.driver) + " connected";
}
str += " stream " + state.get(State.values.stream);
messageGrabber("connected to subsystem", "connection " + str);
Util.log("grabber signed in from " + grabber.getRemoteAddress(), this);
if (state.get(State.values.driverstream).equals(driverstreamstate.mic.toString())) {
grabberPlayPlayer(1);
messageGrabber("playerbroadcast", "1");
}
// eliminate any other grabbers
Collection<Set<IConnection>> concollection = getConnections();
for (Set<IConnection> cc : concollection) {
for (IConnection con : cc) {
if (con instanceof IServiceCapableConnection && con != grabber && con != player
&& (con.getRemoteAddress()).equals("127.0.0.1")) {
con.close();
}
}
}
// set video, audio quality mode in grabber flash, depending on server/client OS
String videosoundmode=state.get(State.values.videosoundmode);
if (videosoundmode == null) videosoundmode=VIDEOSOUNDMODEHIGH;
setGrabberVideoSoundMode(videosoundmode);
Util.systemCall(System.getenv("RED5_HOME")+"/flashsymlink.sh");
}
开发者ID:xaxxontech,项目名称:oculusPrime,代码行数:41,代码来源:Application.java
注:本文中的org.red5.server.api.service.IServiceCapableConnection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论