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


Java Header.setChannelId方法代码示例

本文整理汇总了Java中org.red5.server.net.rtmp.message.Header.setChannelId方法的典型用法代码示例。如果您正苦于以下问题:Java Header.setChannelId方法的具体用法?Java Header.setChannelId怎么用?Java Header.setChannelId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.red5.server.net.rtmp.message.Header的用法示例。


在下文中一共展示了Header.setChannelId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.red5.server.net.rtmp.message.Header; //导入方法依赖的package包/类
/**
 * Writes packet from event data to RTMP connection and stream id.
 *
 * @param event
 *            Event data
 * @param streamId
 *            Stream id
 */
private void write(IRTMPEvent event, Number streamId) {
    log.trace("write to stream id: {} channel: {}", streamId, id);
    final Header header = new Header();
    final Packet packet = new Packet(header, event);
    // set the channel id
    header.setChannelId(id);
    int ts = event.getTimestamp();
    if (ts != 0) {
        header.setTimer(event.getTimestamp());
    }
    header.setStreamId(streamId);
    header.setDataType(event.getDataType());
    // should use RTMPConnection specific method.. 
    //log.trace("Connection type for write: {}", connection.getClass().getName());
    connection.write(packet);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:25,代码来源:Channel.java

示例2: write

import org.red5.server.net.rtmp.message.Header; //导入方法依赖的package包/类
/**
	 * Writes packet from event data to RTMP connection and stream id.
	 *
	 * @param event           Event data
	 * @param streamId        Stream id
	 */
	private void write(IRTMPEvent event, int streamId) {
		log.trace("write channel: {} stream id: {}", id, streamId);
		final Header header = new Header();
		final Packet packet = new Packet(header, event);
		header.setChannelId(id);
		int ts = event.getTimestamp();
		if (ts != 0) {
			header.setTimer(event.getTimestamp());			
		} else {
			// TODO may need to add generated timestamps at some point
//			int timestamp = connection.getTimer();
//			header.setTimerBase(timestamp);
//			event.setTimestamp(timestamp);
		}
		header.setStreamId(streamId);
		header.setDataType(event.getDataType());
		// should use RTMPConnection specific method.. 
		//log.trace("Connection type for write: {}", connection.getClass().getName());
		connection.write(packet);
	}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:27,代码来源:Channel.java

示例3: testHeaders

import org.red5.server.net.rtmp.message.Header; //导入方法依赖的package包/类
public void testHeaders() {
	RTMP rtmp = new RTMP();
	Header header = new Header();
	header.setChannelId((byte) 0x12);
	header.setDataType(TYPE_INVOKE);
	header.setStreamId(100);
	header.setTimer(2);
	header.setSize(320);
	IoBuffer buf = encoder.encodeHeader(rtmp, header, null);
	buf.flip();
	log.debug(buf.getHexDump());
	Assert.assertNotNull(buf);
	Header result = decoder.decodeHeader(buf, null);
	Assert.assertEquals(header, result);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:16,代码来源:RTMPTestCase.java


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