本文整理汇总了Java中org.red5.server.net.rtmp.event.ServerBW类的典型用法代码示例。如果您正苦于以下问题:Java ServerBW类的具体用法?Java ServerBW怎么用?Java ServerBW使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerBW类属于org.red5.server.net.rtmp.event包,在下文中一共展示了ServerBW类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
@SuppressWarnings("cast")
@Override
public boolean connect(IScope newScope, Object[] params) {
log.debug("Connect scope: {}", newScope);
boolean success = super.connect(newScope, params);
if (success) {
final Channel two = getChannel(2);
// tell the flash player how fast we want data and how fast we shall send it
two.write(new ServerBW(defaultServerBandwidth));
// second param is the limit type (0=hard,1=soft,2=dynamic)
two.write(new ClientBW(defaultClientBandwidth, (byte) limitType));
// if the client is null for some reason, skip the jmx registration
if (client != null) {
// perform bandwidth detection
if (bandwidthDetection && !client.isBandwidthChecked()) {
client.checkBandwidth();
}
} else {
log.warn("Client was null");
}
registerJMX();
} else {
log.debug("Connect failed");
}
return success;
}
示例2: connect
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
@SuppressWarnings("cast")
@Override
public boolean connect(IScope newScope, Object[] params) {
log.debug("Connect scope: {}", newScope);
boolean success = super.connect(newScope, params);
if (success) {
// tell the flash player how fast we want data and how fast we shall send it
getChannel(2).write(new ServerBW(defaultServerBandwidth));
// second param is the limit type (0=hard,1=soft,2=dynamic)
getChannel(2).write(new ClientBW(defaultClientBandwidth, (byte) limitType));
//if the client is null for some reason, skip the jmx registration
if (client != null) {
// perform bandwidth detection
if (bandwidthDetection && !client.isBandwidthChecked()) {
client.checkBandwidth();
}
} else {
log.warn("Client was null");
}
registerJMX();
}
return success;
}
示例3: setBandwidth
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/** {@inheritDoc} */
public void setBandwidth(int mbits) {
// tell the flash player how fast we want data and how fast we shall send it
getChannel(2).write(new ServerBW(mbits));
// second param is the limit type (0=hard,1=soft,2=dynamic)
getChannel(2).write(new ClientBW(mbits, (byte) limitType));
}
示例4: onServerBandwidth
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void onServerBandwidth(RTMPConnection conn, Channel channel, ServerBW message) {
log.trace("onServerBandwidth");
// if the size is not equal to our read size send a client bw control message
int bandwidth = message.getBandwidth();
if (bandwidth != bytesReadWindow) {
ClientBW clientBw = new ClientBW(bandwidth, (byte) 2);
channel.write(clientBw);
}
}
示例5: onClientBandwidth
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void onClientBandwidth(RTMPConnection conn, Channel channel, ClientBW message) {
log.trace("onClientBandwidth");
// if the size is not equal to our write size send a server bw control message
int bandwidth = message.getBandwidth();
if (bandwidth != bytesWrittenWindow) {
ServerBW serverBw = new ServerBW(bandwidth);
channel.write(serverBw);
}
}
示例6: setBandwidth
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/** {@inheritDoc} */
public void setBandwidth(int mbits) {
// tell the flash player how fast we want data and how fast we shall send it
getChannel(2).write(new ServerBW(mbits));
// second param is the limit type (0=hard,1=soft,2=dynamic)
getChannel(2).write(new ClientBW(mbits, (byte) limitType));
}
示例7: encodeServerBW
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/**
* Encode server-side bandwidth event.
*
* @param serverBW
* Server-side bandwidth event
* @return Encoded event data
*/
private IoBuffer encodeServerBW(ServerBW serverBW) {
final IoBuffer out = IoBuffer.allocate(4);
out.putInt(serverBW.getBandwidth());
return out;
}
示例8: decodeServerBW
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/**
* Decodes server bandwidth.
*
* @param in
* IoBuffer
* @return RTMP event
*/
private IRTMPEvent decodeServerBW(IoBuffer in) {
return new ServerBW(in.getInt());
}
示例9: encodeServerBW
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/**
* Encode server-side bandwidth event.
*
* @param serverBW Server-side bandwidth event
* @return Encoded event data
*/
private IoBuffer encodeServerBW(ServerBW serverBW) {
final IoBuffer out = IoBuffer.allocate(4);
out.putInt(serverBW.getBandwidth());
return out;
}
示例10: decodeServerBW
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/**
* Decodes server bandwidth.
*
* @param in IoBuffer
* @return RTMP event
*/
private IRTMPEvent decodeServerBW(IoBuffer in) {
return new ServerBW(in.getInt());
}
示例11: onServerBandwidth
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/**
* Server bandwidth / Window ACK size event handler.
*
* @param conn
* Connection
* @param channel
* Channel
* @param message
* ServerBW
*/
protected void onServerBandwidth(RTMPConnection conn, Channel channel, ServerBW message) {
}
示例12: onServerBandwidth
import org.red5.server.net.rtmp.event.ServerBW; //导入依赖的package包/类
/**
* Server bandwidth / Window ACK size event handler.
*
* @param conn Connection
* @param channel Channel
* @param message ServerBW
*/
protected void onServerBandwidth(RTMPConnection conn, Channel channel, ServerBW message) {
}