当前位置: 首页>>代码示例>>Java>>正文


Java ClientBW类代码示例

本文整理汇总了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;
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:27,代码来源:RTMPMinaConnection.java

示例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;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:24,代码来源:RTMPMinaConnection.java

示例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));
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:8,代码来源:RTMPConnection.java

示例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);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:12,代码来源:BaseRTMPClientHandler.java

示例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);
    }
}
 
开发者ID:Red5,项目名称:red5-client,代码行数:12,代码来源:BaseRTMPClientHandler.java

示例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));
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:8,代码来源:RTMPConnection.java

示例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;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:13,代码来源:RTMPProtocolEncoder.java

示例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;
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:14,代码来源:RTMPProtocolEncoder.java

示例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());
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:11,代码来源:RTMPProtocolDecoder.java

示例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());
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:11,代码来源:RTMPProtocolDecoder.java

示例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) {

}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:14,代码来源:BaseRTMPHandler.java

示例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) {
	
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:11,代码来源:BaseRTMPHandler.java


注:本文中的org.red5.server.net.rtmp.event.ClientBW类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。