本文整理汇总了Java中org.red5.server.net.rtmp.event.ClientBW类的典型用法代码示例。如果您正苦于以下问题:Java ClientBW类的具体用法?Java ClientBW怎么用?Java ClientBW使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientBW类属于org.red5.server.net.rtmp.event包,在下文中一共展示了ClientBW类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connect
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的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.ClientBW; //导入依赖的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.ClientBW; //导入依赖的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.ClientBW; //导入依赖的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.ClientBW; //导入依赖的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.ClientBW; //导入依赖的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: encodeClientBW
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的package包/类
/**
* Encode client-side bandwidth event.
*
* @param clientBW Client-side bandwidth event
* @return Encoded event data
*/
private IoBuffer encodeClientBW(ClientBW clientBW) {
final IoBuffer out = IoBuffer.allocate(5);
out.putInt(clientBW.getBandwidth());
out.put(clientBW.getLimitType());
return out;
}
示例8: encodeClientBW
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的package包/类
/**
* Encode client-side bandwidth event.
*
* @param clientBW
* Client-side bandwidth event
* @return Encoded event data
*/
private IoBuffer encodeClientBW(ClientBW clientBW) {
final IoBuffer out = IoBuffer.allocate(5);
out.putInt(clientBW.getBandwidth());
out.put(clientBW.getLimitType());
return out;
}
示例9: decodeClientBW
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的package包/类
/**
* Decodes client bandwidth.
*
* @param in
* Byte buffer
* @return RTMP event
*/
private IRTMPEvent decodeClientBW(IoBuffer in) {
return new ClientBW(in.getInt(), in.get());
}
示例10: decodeClientBW
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的package包/类
/**
* Decodes client bandwidth.
*
* @param in
* Byte buffer
* @return RTMP event
*/
private IRTMPEvent decodeClientBW(IoBuffer in) {
return new ClientBW(in.getInt(), in.get());
}
示例11: onClientBandwidth
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的package包/类
/**
* Client bandwidth / Peer bandwidth set event handler.
*
* @param conn
* Connection
* @param channel
* Channel
* @param message
* ClientBW
*/
protected void onClientBandwidth(RTMPConnection conn, Channel channel, ClientBW message) {
}
示例12: onClientBandwidth
import org.red5.server.net.rtmp.event.ClientBW; //导入依赖的package包/类
/**
* Client bandwidth / Peer bandwidth set event handler.
*
* @param conn Connection
* @param channel Channel
* @param message ClientBW
*/
protected void onClientBandwidth(RTMPConnection conn, Channel channel, ClientBW message) {
}