本文整理汇总了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;
}
示例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;
}
示例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..");
}
}
示例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);
}