• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IStreamListener类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.red5.server.api.stream.IStreamListener的典型用法代码示例。如果您正苦于以下问题:Java IStreamListener类的具体用法?Java IStreamListener怎么用?Java IStreamListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IStreamListener类属于org.red5.server.api.stream包,在下文中一共展示了IStreamListener类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: pushMessage

点赞 3

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/**
 * Push message
 * 
 * @param message
 *            Message
 */
private void pushMessage(IMessage message) throws IOException {
    if (msgOut != null) {
        msgOut.pushMessage(message);
    }
    // Notify listeners about received packet
    if (message instanceof RTMPMessage) {
        final IRTMPEvent rtmpEvent = ((RTMPMessage) message).getBody();
        if (rtmpEvent instanceof IStreamPacket) {
            for (IStreamListener listener : getStreamListeners()) {
                try {
                    listener.packetReceived(this, (IStreamPacket) rtmpEvent);
                } catch (Exception e) {
                    log.error("Error while notifying listener " + listener, e);
                }
            }
        }
    }
}
 

开发者ID:Red5,
项目名称:red5-server,
代码行数:25,
代码来源:ServerStream.java

示例2: pushMessage

点赞 3

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/**
 * Push message
 * @param message     Message
 */
private void pushMessage(IMessage message) throws IOException {
	if (msgOut != null) {
		msgOut.pushMessage(message);
	}
	if (recordPipe != null) {
		recordPipe.pushMessage(message);
	}
	// Notify listeners about received packet
	if (message instanceof RTMPMessage) {
		final IRTMPEvent rtmpEvent = ((RTMPMessage) message).getBody();
		if (rtmpEvent instanceof IStreamPacket) {
			for (IStreamListener listener : getStreamListeners()) {
				try {
					listener.packetReceived(this, (IStreamPacket) rtmpEvent);
				} catch (Exception e) {
					log.error("Error while notifying listener " + listener, e);
				}
			}
		}
	}
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:26,
代码来源:ServerStream.java

示例3: pushMessage

点赞 3

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/**
 * Push message
 * 
 * @param message
 *                Message
 */
private void pushMessage(IMessage message) throws IOException {
	msgOut.pushMessage(message);
	recordPipe.pushMessage(message);

	// Notify listeners about received packet
	if (message instanceof RTMPMessage) {
		final IRTMPEvent rtmpEvent = ((RTMPMessage) message).getBody();
		if (rtmpEvent instanceof IStreamPacket) {
			for (IStreamListener listener : getStreamListeners()) {
				try {
					listener.packetReceived(this, (IStreamPacket) rtmpEvent);
				} catch (Exception e) {
					log.error("Error while notifying listener " + listener, e);
				}
			}
		}
	}
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:25,
代码来源:NoSyncServerStream.java

示例4: stopRecordingShow

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public void stopRecordingShow(String publishedName) {
	ClientBroadcastStream cbs = (ClientBroadcastStream) getBroadcastStream(getScope(), publishedName);
	Collection<IStreamListener> isls = cbs.getStreamListeners();
	cbs.stopRecording();
	for(IStreamListener sl : isls)
		cbs.removeStreamListener(sl);
	StreamStatusMessage statusMessage = createStreamStatusMessage(Status.STOPPED_RECORDING, getScope().getName(), publishedName, "127.0.0.1");
	streamStatusDispatcher.dispatch(statusMessage);
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:10,
代码来源:Application.java

示例5: removeListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/**
 * Stops recording the publishing stream for the specified IConnection.
 *
 * @param scope
 * @param broadcastId
 * @param metaId
 */
private void removeListener(IScope scope, String broadcastId, Long metaId) {
	try {
		log.debug("** removeListener: scope: {}, broadcastId: {} || {}", scope, broadcastId, scope.getContextPath());

		IBroadcastStream stream = scopeAdapter.getBroadcastStream(scope, broadcastId);

		// the stream can be null if the user just closes the browser
		// without canceling the recording before leaving
		// Iterate through all stream listeners and stop the appropriate
		if (stream != null && stream.getStreamListeners() != null) {
			for (IStreamListener iStreamListener : stream.getStreamListeners()) {
				stream.removeStreamListener(iStreamListener);
			}
		}

		if (metaId == null) {
			// this should be fixed, can be useful for debugging, after all this is an error
			// but we don't want the application to completely stop the process
			log.error("recordingMetaDataId is null");
			return;
		}

		StreamListener listenerAdapter = streamListeners.get(metaId);
		log.debug("Stream Closing :: " + metaId);

		RecordingMetaData metaData = metaDataDao.get(metaId);
		printMetaInfo(metaData, "Stopping the stream");
		// Manually call finish on the stream so that there is no endless loop waiting in the RecordingConverter waiting for the stream to finish
		// this would normally happen in the Listener
		Status s = metaData.getStreamStatus();
		switch (s) {
			case NONE:
				log.debug("Stream was not started, no need to stop :: stream with id {}", metaId);
				break;
			case STARTED:
				metaData.setStreamStatus(listenerAdapter == null ? Status.STOPPED : Status.STOPPING);
				metaDataDao.update(metaData);
				break;
			default:
				//no-op
				break;
		}
		if (listenerAdapter == null) {
			log.debug("Stream Not Found :: {}", metaId);
			log.debug("Available Streams :: {}", streamListeners.size());

			for (Long entryKey : streamListeners.keySet()) {
				log.debug("Stored recordingMetaDataId in Map: {}", entryKey);
			}
			throw new IllegalStateException("Could not find Listener to stop! metaId " + metaId);
		}

		listenerAdapter.closeStream();
		streamListeners.remove(metaId);

	} catch (Exception err) {
		log.error("[removeListener]", err);
	}
}
 

开发者ID:apache,
项目名称:openmeetings,
代码行数:67,
代码来源:RecordingService.java

示例6: addStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/** {@inheritDoc} */
public void addStreamListener(IStreamListener listener) {
    listeners.add(listener);
}
 

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

示例7: getStreamListeners

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/** {@inheritDoc} */
public Collection<IStreamListener> getStreamListeners() {
    return listeners;
}
 

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

示例8: removeStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/** {@inheritDoc} */
public void removeStreamListener(IStreamListener listener) {
    listeners.remove(listener);
}
 

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

示例9: addStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/**
 * Implement IStreamListener in an object to monitor the connection status events and auxiliary data.
 */
@Override
public void addStreamListener(IStreamListener listener) {
	log.debug("addStreamListener(listener: {})", listener);
	mListeners.add(listener);
}
 

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

示例10: getStreamListeners

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
@Override
public Collection<IStreamListener> getStreamListeners() {
	return mListeners;
}
 

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

示例11: removeStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
@Override
public void removeStreamListener(IStreamListener listener) {
	mListeners.remove(listener);
}
 

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

示例12: addStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public void addStreamListener(IStreamListener listener) {
    listeners.add(listener);
}
 

开发者ID:Red5,
项目名称:red5-server,
代码行数:4,
代码来源:ServerStream.java

示例13: getStreamListeners

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public Collection<IStreamListener> getStreamListeners() {
    return listeners;
}
 

开发者ID:Red5,
项目名称:red5-server,
代码行数:4,
代码来源:ServerStream.java

示例14: removeStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public void removeStreamListener(IStreamListener listener) {
    listeners.remove(listener);
}
 

开发者ID:Red5,
项目名称:red5-server,
代码行数:4,
代码来源:ServerStream.java

示例15: addStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/** {@inheritDoc} */
public void addStreamListener(IStreamListener listener) {
	listeners.add(listener);
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:5,
代码来源:ClientBroadcastStream.java

示例16: getStreamListeners

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/** {@inheritDoc} */
public Collection<IStreamListener> getStreamListeners() {
	return listeners;
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:5,
代码来源:ClientBroadcastStream.java

示例17: removeStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
/** {@inheritDoc} */
public void removeStreamListener(IStreamListener listener) {
	listeners.remove(listener);
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:5,
代码来源:ClientBroadcastStream.java

示例18: addStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public void addStreamListener(IStreamListener listener) {
	listeners.add(listener);
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:4,
代码来源:ServerStream.java

示例19: getStreamListeners

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public Collection<IStreamListener> getStreamListeners() {
	return listeners;
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:4,
代码来源:ServerStream.java

示例20: removeStreamListener

点赞 2

import org.red5.server.api.stream.IStreamListener; //导入依赖的package包/类
public void removeStreamListener(IStreamListener listener) {
	listeners.remove(listener);
}
 

开发者ID:cwpenhale,
项目名称:red5-mobileconsole,
代码行数:4,
代码来源:ServerStream.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)