當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。