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