本文整理汇总了Java中org.red5.server.stream.StreamService类的典型用法代码示例。如果您正苦于以下问题:Java StreamService类的具体用法?Java StreamService怎么用?Java StreamService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StreamService类属于org.red5.server.stream包,在下文中一共展示了StreamService类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBroadcastStream
import org.red5.server.stream.StreamService; //导入依赖的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.stream.StreamService; //导入依赖的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.stream.StreamService; //导入依赖的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.stream.StreamService; //导入依赖的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);
}
示例5: getOnDemandStream
import org.red5.server.stream.StreamService; //导入依赖的package包/类
/**
* Returns VOD stream with given name from specified scope.
*
* @param scope
* Scope object
* @param name
* VOD stream name
*
* @return IOnDemandStream object that represents stream that can be played on demand, seekable and so forth. See
* {@link IOnDemandStream} for details.
*/
public IOnDemandStream getOnDemandStream(IScope scope, String name) {
log.warn("This won't work until the refactoring of the streaming code is complete.");
IOnDemandStreamService service = (IOnDemandStreamService) ScopeUtils.getScopeService(scope, IOnDemandStreamService.class, StreamService.class, false);
return service.getOnDemandStream(scope, name);
}
示例6: getSubscriberStream
import org.red5.server.stream.StreamService; //导入依赖的package包/类
/**
* Returns subscriber stream with given name from specified scope. Subscriber stream is a stream that clients can subscribe to.
*
* @param scope
* Scope
* @param name
* Stream name
*
* @return ISubscriberStream object
*/
public ISubscriberStream getSubscriberStream(IScope scope, String name) {
log.warn("This won't work until the refactoring of the streaming code is complete.");
ISubscriberStreamService service = (ISubscriberStreamService) ScopeUtils.getScopeService(scope, ISubscriberStreamService.class, StreamService.class, false);
return service.getSubscriberStream(scope, name);
}
示例7: getOnDemandStream
import org.red5.server.stream.StreamService; //导入依赖的package包/类
/**
* Returns VOD stream with given name from specified scope.
*
* @param scope
* Scope object
* @param name
* VOD stream name
*
* @return IOnDemandStream object that represents stream that can be played
* on demand, seekable and so forth. See {@link IOnDemandStream} for
* details.
*/
public IOnDemandStream getOnDemandStream(IScope scope, String name) {
log.warn("This won't work until the refactoring of the streaming code is complete.");
IOnDemandStreamService service = (IOnDemandStreamService) ScopeUtils.getScopeService(scope, IOnDemandStreamService.class, StreamService.class, false);
return service.getOnDemandStream(scope, name);
}
示例8: getSubscriberStream
import org.red5.server.stream.StreamService; //导入依赖的package包/类
/**
* Returns subscriber stream with given name from specified scope.
* Subscriber stream is a stream that clients can subscribe to.
*
* @param scope
* Scope
* @param name
* Stream name
*
* @return ISubscriberStream object
*/
public ISubscriberStream getSubscriberStream(IScope scope, String name) {
log.warn("This won't work until the refactoring of the streaming code is complete.");
ISubscriberStreamService service = (ISubscriberStreamService) ScopeUtils.getScopeService(scope, ISubscriberStreamService.class, StreamService.class, false);
return service.getSubscriberStream(scope, name);
}