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


Java PlaylistSubscriberStream类代码示例

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


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

示例1: newPlaylistSubscriberStream

import org.red5.server.stream.PlaylistSubscriberStream; //导入依赖的package包/类
/** {@inheritDoc} */
public IPlaylistSubscriberStream newPlaylistSubscriberStream(int streamId) {
	if (isValidStreamId(streamId)) {
		// get PlaylistSubscriberStream defined as a prototype in red5-common.xml
		PlaylistSubscriberStream pss = (PlaylistSubscriberStream) scope.getContext().getBean("playlistSubscriberStream");
		Integer buffer = streamBuffers.get(streamId - 1);
		if (buffer != null) {
			pss.setClientBufferDuration(buffer);
		}
		pss.setName(createStreamName());
		pss.setConnection(this);
		pss.setScope(this.getScope());
		pss.setStreamId(streamId);
		registerStream(pss);
		usedStreams.incrementAndGet();
		return pss;
	}
	return null;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:20,代码来源:RTMPConnection.java

示例2: newPlaylistSubscriberStream

import org.red5.server.stream.PlaylistSubscriberStream; //导入依赖的package包/类
/** {@inheritDoc} */
public IPlaylistSubscriberStream newPlaylistSubscriberStream(Number streamId) {
    if (isValidStreamId(streamId)) {
        // get PlaylistSubscriberStream defined as a prototype in red5-common.xml
        PlaylistSubscriberStream pss = (PlaylistSubscriberStream) scope.getContext().getBean("playlistSubscriberStream");
        customizeStream(streamId, pss);
        if (!registerStream(pss)) {
            log.trace("Stream: {} for stream id: {} failed to register", streamId);
            pss = null;
        }
        return pss;
    }
    return null;
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:15,代码来源:RTMPConnection.java

示例3: streamPlayItemStop

import org.red5.server.stream.PlaylistSubscriberStream; //导入依赖的package包/类
public void streamPlayItemStop(ISubscriberStream stream, IPlayItem item) {
    // since there is a fair amount of processing below we will check log
    // level prior to proceeding
    if (log.isInfoEnabled()) {
        // log w3c connect event
        String remoteAddress = "";
        long readBytes = -1;
        long writtenBytes = -1;
        IConnection conn = Red5.getConnectionLocal();
        if (conn != null) {
            remoteAddress = conn.getRemoteAddress();
            readBytes = conn.getReadBytes();
            writtenBytes = conn.getWrittenBytes();
        }
        long playDuration = -1;
        if (stream instanceof PlaylistSubscriberStream) {
            // converted to seconds
            playDuration = (System.currentTimeMillis() - ((PlaylistSubscriberStream) stream).getCreationTime()) / 1000;
        }
        long playItemSize = -1;
        String playItemName = "";
        if (item != null) {
            playItemName = item.getName();
            //get file size in bytes if available
            IProviderService providerService = (IProviderService) scope.getContext().getBean(IProviderService.BEAN_NAME);
            if (providerService != null) {
                File file = providerService.getVODProviderFile(scope, playItemName);
                if (file != null) {
                    playItemSize = file.length();
                } else {
                    log.debug("File was null, this is ok for live streams");
                }
            } else {
                log.debug("ProviderService was null");
            }
        }
        log.info("W3C x-category:stream x-event:stop c-ip:{} cs-bytes:{} sc-bytes:{} x-sname:{} x-file-length:{} x-file-size:{} x-name:{}", new Object[] { remoteAddress, readBytes, writtenBytes, stream.getName(), playDuration, playItemSize, playItemName });
    }
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:40,代码来源:MultiThreadedApplicationAdapter.java

示例4: streamPlayItemStop

import org.red5.server.stream.PlaylistSubscriberStream; //导入依赖的package包/类
public void streamPlayItemStop(ISubscriberStream stream, IPlayItem item) {
	// since there is a fair amount of processing below we will check log
	// level prior to proceeding
	if (log.isInfoEnabled()) {
		// log w3c connect event
		String remoteAddress = "";
		long readBytes = -1;
		long writtenBytes = -1;
		IConnection conn = Red5.getConnectionLocal();
		if (conn != null) {
			remoteAddress = conn.getRemoteAddress();
			readBytes = conn.getReadBytes();
			writtenBytes = conn.getWrittenBytes();
		}
		long playDuration = -1;
		if (stream instanceof PlaylistSubscriberStream) {
			// converted to seconds
			playDuration = (System.currentTimeMillis() - ((PlaylistSubscriberStream) stream).getCreationTime()) / 1000;
		}
		long playItemSize = -1;
		String playItemName = "";
		if (item != null) {
			playItemName = item.getName();
			//get file size in bytes if available
			IProviderService providerService = (IProviderService) scope.getContext().getBean(IProviderService.BEAN_NAME);
			if (providerService != null) {
				File file = providerService.getVODProviderFile(scope, playItemName);
				if (file != null) {
					playItemSize = file.length();
				} else {
					log.debug("File was null, this is ok for live streams");
				}
			} else {
				log.debug("ProviderService was null");
			}
		}
		log.info("W3C x-category:stream x-event:stop c-ip:{} cs-bytes:{} sc-bytes:{} x-sname:{} x-file-length:{} x-file-size:{} x-name:{}", new Object[] { remoteAddress,
				readBytes, writtenBytes, stream.getName(), playDuration, playItemSize, playItemName });
	}
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:41,代码来源:MultiThreadedApplicationAdapter.java


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