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


Java IStreamService类代码示例

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


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

示例1: getBroadcastStream

import org.red5.server.api.stream.IStreamService; //导入依赖的package包/类
/** {@inheritDoc} */
public IBroadcastStream getBroadcastStream(IScope scope, String name) {
    IStreamService service = (IStreamService) ScopeUtils.getScopeService(scope, IStreamService.class, StreamService.class);
    if (service instanceof StreamService) {
        IBroadcastScope bs = ((StreamService) service).getBroadcastScope(scope, name);
        if (bs != null) {
            return bs.getClientBroadcastStream();
        }
    }
    return null;
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:12,代码来源:MultiThreadedApplicationAdapter.java

示例2: getBroadcastStream

import org.red5.server.api.stream.IStreamService; //导入依赖的package包/类
/** {@inheritDoc} */
public IBroadcastStream getBroadcastStream(IScope scope, String name) {
	IStreamService service = (IStreamService) ScopeUtils.getScopeService(scope, IStreamService.class, StreamService.class);
	if (service instanceof StreamService) {
		IBroadcastScope bs = ((StreamService) service).getBroadcastScope(scope, name);
		if (bs != null) {
			return bs.getClientBroadcastStream();
		}
	}
	return null;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:12,代码来源:MultiThreadedApplicationAdapter.java

示例3: close

import org.red5.server.api.stream.IStreamService; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void close() {
    if (closing.compareAndSet(false, true)) {
        if (log.isDebugEnabled()) {
            log.debug("close: {}", sessionId);
        }
        stopWaitForHandshake();
        stopRoundTripMeasurement();
        // update our state
        if (state != null) {
            final byte s = getStateCode();
            switch (s) {
                case RTMP.STATE_DISCONNECTED:
                    if (log.isDebugEnabled()) {
                        log.debug("Already disconnected");
                    }
                    return;
                default:
                    if (log.isDebugEnabled()) {
                        log.debug("State: {}", RTMP.states[s]);
                    }
                    setStateCode(RTMP.STATE_DISCONNECTING);
            }
        }
        Red5.setConnectionLocal(this);
        IStreamService streamService = (IStreamService) ScopeUtils.getScopeService(scope, IStreamService.class, StreamService.class);
        if (streamService != null) {
            //in the end of call streamService.deleteStream we do streams.remove
            for (Iterator<IClientStream> it = streams.values().iterator(); it.hasNext();) {
                IClientStream stream = it.next();
                if (log.isDebugEnabled()) {
                    log.debug("Closing stream: {}", stream.getStreamId());
                }
                streamService.deleteStream(this, stream.getStreamId());
            }
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Stream service was not found for scope: {}", (scope != null ? scope.getName() : "null or non-existant"));
            }
        }
        // close the base connection - disconnect scopes and unregister client
        super.close();
        // kill all the collections etc
        channels.clear();
        streams.clear();
        pendingCalls.clear();
        deferredResults.clear();
        pendingVideos.clear();
        streamBuffers.clear();
        if (log.isTraceEnabled()) {
            // dump memory stats
            log.trace("Memory at close - free: {}K total: {}K", Runtime.getRuntime().freeMemory() / 1024, Runtime.getRuntime().totalMemory() / 1024);
        }
    } else if (log.isDebugEnabled()) {
        log.debug("Already closing..");
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:59,代码来源:RTMPConnection.java

示例4: close

import org.red5.server.api.stream.IStreamService; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void close() {
	if (keepAliveJobName != null) {
		schedulingService.removeScheduledJob(keepAliveJobName);
		keepAliveJobName = null;
	}
	Red5.setConnectionLocal(this);
	IStreamService streamService = (IStreamService) ScopeUtils.getScopeService(scope, IStreamService.class, StreamService.class);
	if (streamService != null) {
		for (Map.Entry<Integer, IClientStream> entry : streams.entrySet()) {
			IClientStream stream = entry.getValue();
			if (stream != null) {
				log.debug("Closing stream: {}", stream.getStreamId());
				streamService.deleteStream(this, stream.getStreamId());
				usedStreams.decrementAndGet();
			}
		}
	}
	// close the base connection - disconnect scopes and unregister client
	super.close();
	// kill all the collections etc
	if (channels != null) {
		channels.clear();
	} else {
		log.trace("Channels collection was null");
	}
	if (streams != null) {
		streams.clear();
	} else {
		log.trace("Streams collection was null");
	}
	if (pendingCalls != null) {
		pendingCalls.clear();
	} else {
		log.trace("PendingCalls collection was null");
	}
	if (deferredResults != null) {
		deferredResults.clear();
	} else {
		log.trace("DeferredResults collection was null");
	}
	if (pendingVideos != null) {
		pendingVideos.clear();
	} else {
		log.trace("PendingVideos collection was null");
	}
	if (streamBuffers != null) {
		streamBuffers.clear();
	} else {
		log.trace("StreamBuffers collection was null");
	}
	// clear thread local reference
	Red5.setConnectionLocal(null);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:56,代码来源:RTMPConnection.java


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