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


Java RTMPMessage.build方法代码示例

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


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

示例1: sendReset

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/**
 * Send reset message
 */
private void sendReset() {
    if (pullMode) {
        Ping recorded = new Ping();
        recorded.setEventType(Ping.RECORDED_STREAM);
        recorded.setValue2(streamId);
        // recorded 
        RTMPMessage recordedMsg = RTMPMessage.build(recorded);
        doPushMessage(recordedMsg);
    }
    Ping begin = new Ping();
    begin.setEventType(Ping.STREAM_BEGIN);
    begin.setValue2(streamId);
    // begin 
    RTMPMessage beginMsg = RTMPMessage.build(begin);
    doPushMessage(beginMsg);
    // reset
    ResetMessage reset = new ResetMessage();
    doPushMessage(reset);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:23,代码来源:PlayEngine.java

示例2: packetReceived

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
@Override
public void packetReceived(IBroadcastStream stream, IStreamPacket packet) {

	RTMPMessage m = RTMPMessage.build((IRTMPEvent) packet, packet.getTimestamp());

	try {

		limiter--;
		if (limiter > 1) {
			streamer.pushMessage(null, m);
		} else {
			if (streamer != null) {
				stream.removeStreamListener(this);
				streamer.stop();
				streamer = null;
			}
		}

	} catch (IOException e) {

		e.printStackTrace();
	}

}
 
开发者ID:Red5,项目名称:red5-rtsp-restreamer,代码行数:25,代码来源:Application.java

示例3: sendReset

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/**
 * Send reset message
 */
private void sendReset() {
	if (pullMode) {
		Ping recorded = new Ping();
		recorded.setEventType(Ping.RECORDED_STREAM);
		recorded.setValue2(streamId);
		// recorded 
		RTMPMessage recordedMsg = RTMPMessage.build(recorded);
		doPushMessage(recordedMsg);
	}

	Ping begin = new Ping();
	begin.setEventType(Ping.STREAM_BEGIN);
	begin.setValue2(streamId);
	// begin 
	RTMPMessage beginMsg = RTMPMessage.build(begin);
	doPushMessage(beginMsg);
	// reset
	ResetMessage reset = new ResetMessage();
	doPushMessage(reset);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:24,代码来源:PlayEngine.java

示例4: pushVideo

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
public void pushVideo(VideoData data, int ts) {
	if (startPublish) {
		if (Red5.getConnectionLocal() == null) {
			Red5.setConnectionLocal(client.getConnection());
		}
		RTMPMessage rtmpMsg = RTMPMessage.build(data, ts);
		client.publishStreamData(streamId, rtmpMsg);
	}
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:10,代码来源:CaptureScreen.java

示例5: sendClearPing

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/**
 * Send clear ping. Lets client know that stream has no more data to send.
 */
private void sendClearPing() {
    Ping eof = new Ping();
    eof.setEventType(Ping.STREAM_PLAYBUFFER_CLEAR);
    eof.setValue2(streamId);
    // eos 
    RTMPMessage eofMsg = RTMPMessage.build(eof);
    doPushMessage(eofMsg);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:12,代码来源:PlayEngine.java

示例6: sendOnPlayStatus

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/**
 * Sends an onPlayStatus message.
 * 
 * http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetDataEvent.html
 * 
 * @param code
 * @param duration
 * @param bytes
 */
private void sendOnPlayStatus(String code, int duration, long bytes) {
    if (log.isDebugEnabled()) {
        log.debug("Sending onPlayStatus - code: {} duration: {} bytes: {}", code, duration, bytes);
    }
    // create the buffer
    IoBuffer buf = IoBuffer.allocate(102);
    buf.setAutoExpand(true);
    Output out = new Output(buf);
    out.writeString("onPlayStatus");
    ObjectMap<Object, Object> args = new ObjectMap<>();
    args.put("code", code);
    args.put("level", Status.STATUS);
    args.put("duration", duration);
    args.put("bytes", bytes);
    if (StatusCodes.NS_PLAY_TRANSITION_COMPLETE.equals(code)) {
        args.put("clientId", streamId);
        args.put("details", currentItem.getName());
        args.put("description", String.format("Transitioned to %s", currentItem.getName()));
        args.put("isFastPlay", false);
    }
    out.writeObject(args);
    buf.flip();
    Notify event = new Notify(buf, "onPlayStatus");
    if (lastMessageTs > 0) {
        event.setTimestamp(lastMessageTs);
    } else {
        event.setTimestamp(0);
    }
    RTMPMessage msg = RTMPMessage.build(event);
    doPushMessage(msg);
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:41,代码来源:PlayEngine.java

示例7: sendClearPing

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/**
 * Send clear ping. Lets client know that stream has no more data to
 * send.
 */
private void sendClearPing() {
	Ping eof = new Ping();
	eof.setEventType(Ping.STREAM_PLAYBUFFER_CLEAR);
	eof.setValue2(streamId);
	// eos 
	RTMPMessage eofMsg = RTMPMessage.build(eof);
	doPushMessage(eofMsg);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:13,代码来源:PlayEngine.java

示例8: sendOnPlayStatus

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/**
 * Sends an onPlayStatus message.
 * 
 * @param code
 * @param duration
 * @param bytes
 */
private void sendOnPlayStatus(String code, int duration, long bytes) {
	IoBuffer buf = IoBuffer.allocate(255);
	buf.setAutoExpand(true);
	Output out = new Output(buf);
	out.writeString("onPlayStatus");
	Map<Object, Object> props = new HashMap<Object, Object>();
	props.put("code", code);
	props.put("level", "status");
	props.put("duration", duration);
	props.put("bytes", bytes);
	if (StatusCodes.NS_PLAY_TRANSITION_COMPLETE.equals(code)) {
		props.put("details", currentItem.getName());
		props.put("description", String.format("Transitioned to %s", currentItem.getName()));
		props.put("clientId", streamId);
		props.put("isFastPlay", false);
	}
	out.writeMap(props, new Serializer());
	buf.flip();

	IRTMPEvent event = new Notify(buf);
	if (lastMessageTs > 0) {
		event.setTimestamp(lastMessageTs);
	} else {
		event.setTimestamp(0);
	}
	RTMPMessage msg = RTMPMessage.build(event);
	doPushMessage(msg);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:36,代码来源:PlayEngine.java

示例9: setUp

import org.red5.server.stream.message.RTMPMessage; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void setUp() throws Exception {
	super.setUp();
	VideoData message = new VideoData(IoBuffer.allocate(100));
	playBuffer = new PlayBuffer(1000);
	rtmpMessage = RTMPMessage.build(message);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:9,代码来源:PlayBufferTest.java


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