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


Java InMemoryPushPushPipe类代码示例

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


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

示例1: start

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/**
 * Start this server-side stream
 */
public void start() {
	if (state != State.UNINIT) {
		throw new IllegalStateException("State " + state + " not valid to start");
	}
	if (items.size() == 0) {
		throw new IllegalStateException("At least one item should be specified to start");
	}
	if (publishedName == null) {
		throw new IllegalStateException("A published name is needed to start");
	}
	// publish this server-side stream
	IProviderService providerService = (IProviderService) getScope().getContext().getBean(IProviderService.BEAN_NAME);
	providerService.registerBroadcastStream(getScope(), publishedName, this);
	Map<String, Object> recordParamMap = new HashMap<String, Object>();
	recordPipe = new InMemoryPushPushPipe();
	recordParamMap.put("record", null);
	recordPipe.subscribe((IProvider) this, recordParamMap);
	recordingFilename = null;
	scheduler = (ISchedulingService) getScope().getContext().getBean(ISchedulingService.BEAN_NAME);
	state = State.STOPPED;
	currentItemIndex = -1;
	nextItem();
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:27,代码来源:NoSyncServerStream.java

示例2: close

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/**
 * Close stream
 */
public void close() {
    if (log.isDebugEnabled()) {
        log.debug("close");
    }
    if (!subscriberStream.getState().equals(StreamState.CLOSED)) {
        IMessageInput in = msgInReference.get();
        if (in != null) {
            in.unsubscribe(this);
            msgInReference.set(null);
        }
        subscriberStream.setState(StreamState.CLOSED);
        clearWaitJobs();
        releasePendingMessage();
        lastMessageTs = 0;
        // XXX is clear ping required?
        //sendClearPing();
        InMemoryPushPushPipe out = (InMemoryPushPushPipe) msgOutReference.get();
        if (out != null) {
            List<IConsumer> consumers = out.getConsumers();
            // assume a list of 1 in most cases
            if (log.isDebugEnabled()) {
                log.debug("Message out consumers: {}", consumers.size());
            }
            if (!consumers.isEmpty()) {
                for (IConsumer consumer : consumers) {
                    out.unsubscribe(consumer);
                }
            }
            msgOutReference.set(null);
        }
    } else {
        log.debug("Stream is already in closed state");
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:38,代码来源:PlayEngine.java

示例3: getConsumerOutput

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/** {@inheritDoc} */
public IMessageOutput getConsumerOutput(IClientStream stream) {
    IStreamCapableConnection streamConn = stream.getConnection();
    if (streamConn != null && streamConn instanceof RTMPConnection) {
        RTMPConnection conn = (RTMPConnection) streamConn;
        // TODO Better manage channels.
        // now we use OutputStream as a channel wrapper.
        OutputStream o = conn.createOutputStream(stream.getStreamId());
        IPipe pipe = new InMemoryPushPushPipe();
        pipe.subscribe(new ConnectionConsumer(conn, o.getVideo(), o.getAudio(), o.getData()), null);
        return pipe;
    }
    return null;
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:15,代码来源:ConsumerService.java

示例4: getConsumerOutput

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/** {@inheritDoc} */
   public IMessageOutput getConsumerOutput(IClientStream stream) {
	IStreamCapableConnection streamConn = stream.getConnection();
	if (streamConn == null || !(streamConn instanceof RTMPConnection)) {
		return null;
	}
	RTMPConnection conn = (RTMPConnection) streamConn;
	// TODO Better manage channels.
	// now we use OutputStream as a channel wrapper.
	OutputStream o = conn.createOutputStream(stream.getStreamId());
	IPipe pipe = new InMemoryPushPushPipe();
	pipe.subscribe(new ConnectionConsumer(conn, o.getVideo().getId(), o.getAudio().getId(), o.getData().getId()), null);
	return pipe;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:15,代码来源:ConsumerService.java

示例5: start

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/**
 * Start this server-side stream
 */
public void start() {
	if (state != StreamState.UNINIT) {
		throw new IllegalStateException("State " + state + " not valid to start");
	}
	if (items.size() == 0) {
		throw new IllegalStateException("At least one item should be specified to start");
	}
	if (publishedName == null) {
		throw new IllegalStateException("A published name is needed to start");
	}
	try {
		providerService = (IProviderService) getScope().getContext().getBean(IProviderService.BEAN_NAME);
		// publish this server-side stream
		providerService.registerBroadcastStream(getScope(), publishedName, this);
		scheduler = (ISchedulingService) getScope().getContext().getBean(ISchedulingService.BEAN_NAME);
	} catch (NullPointerException npe) {
		log.warn("Context beans were not available; this is ok during unit testing", npe);
	}
	Map<String, Object> recordParamMap = new HashMap<String, Object>();
	recordPipe = new InMemoryPushPushPipe();
	recordParamMap.put("record", null);
	recordPipe.subscribe((IProvider) this, recordParamMap);
	recordingFilename = null;
	setState(StreamState.STOPPED);
	currentItemIndex = -1;
	nextItem();
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:31,代码来源:ServerStream.java

示例6: BroadcastScope

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/**
 * Creates broadcast scope
 * @param parent            Parent scope
 * @param name              Scope name
 */
public BroadcastScope(IScope parent, String name) {
	super(parent, ScopeType.BROADCAST, name, false);
	pipe = new InMemoryPushPushPipe();
	pipe.addPipeConnectionListener(this);
	keepOnDisconnect = true;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:12,代码来源:BroadcastScope.java

示例7: BroadcastScope

import org.red5.server.messaging.InMemoryPushPushPipe; //导入依赖的package包/类
/**
 * Creates broadcast scope
 * 
 * @param parent
 *            Parent scope
 * @param name
 *            Scope name
 */
public BroadcastScope(IScope parent, String name) {
    super(parent, ScopeType.BROADCAST, name, false);
    pipe = new InMemoryPushPushPipe(this);
    keepOnDisconnect = true;
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:14,代码来源:BroadcastScope.java


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