• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IStreamableFile类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * Initialization
 *
 * @throws IOException
 *             I/O exception
 */
private void init() throws IOException {
	file = new File(OmFileHelper.getStreamsSubDir(scope.getName()), OmFileHelper.getName(streamName, EXTENSION_FLV));

	IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class,
			StreamableFileFactory.class);

	if (!file.isFile()) {
		// Maybe the (previously existing) file has been deleted
		file.createNewFile();

	} else if (!file.canWrite()) {
		throw new IOException("The file is read-only");
	}

	IStreamableFileService service = factory.getService(file);
	IStreamableFile flv = service.getStreamableFile(file);
	writer = flv.getWriter();
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:25,代码来源:BaseStreamWriter.java


示例2: init

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * Initializes file provider. Creates streamable file factory and service, seeks to start position
 */
private void init() throws IOException {
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
    IStreamableFileService service = factory.getService(file);
    if (service == null) {
        log.error("No service found for {}", file.getAbsolutePath());
        return;
    }
    IStreamableFile streamFile = service.getStreamableFile(file);
    reader = streamFile.getReader();
    if (start > 0) {
        seek(start);
    }
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:17,代码来源:FileProvider.java


示例3: getStreamLength

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * Returns stream length. This is a hook so it may be removed.
 * 
 * @param name
 *            Stream name
 * @return Stream length in seconds (?)
 */
public double getStreamLength(String name) {
    double duration = 0;
    IProviderService provider = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
    File file = provider.getVODProviderFile(scope, name);
    if (file != null && file.canRead()) {
        IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
        IStreamableFileService service = factory.getService(file);
        if (service != null) {
            ITagReader reader = null;
            try {
                IStreamableFile streamFile = service.getStreamableFile(file);
                reader = streamFile.getReader();
                duration = (double) reader.getDuration() / 1000;
            } catch (IOException e) {
                log.error("Error read stream file {}. {}", file.getAbsolutePath(), e);
            } finally {
                if (reader != null) {
                    reader.close();
                }
            }
        } else {
            log.error("No service found for {}", file.getAbsolutePath());
        }
        file = null;
    }
    return duration;
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:35,代码来源:MultiThreadedApplicationAdapter.java


示例4: init

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * Initializes file provider. Creates streamable file factory and service, seeks to start position
 */
private void init() throws IOException {
	IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
	IStreamableFileService service = factory.getService(file);
	if (service == null) {
		log.error("No service found for {}", file.getAbsolutePath());
		return;
	}
	IStreamableFile streamFile = service.getStreamableFile(file);
	reader = streamFile.getReader();
	if (start > 0) {
		seek(start);
	}
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:17,代码来源:FileProvider.java


示例5: getStreamLength

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * Returns stream length. This is a hook so it may be removed.
 * 
 * @param name
 *            Stream name
 * @return Stream length in seconds (?)
 */
public double getStreamLength(String name) {
	double duration = 0;
	IProviderService provider = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
	File file = provider.getVODProviderFile(scope, name);
	if (file != null && file.canRead()) {
		IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
		IStreamableFileService service = factory.getService(file);
		if (service != null) {
			ITagReader reader = null;
			try {
				IStreamableFile streamFile = service.getStreamableFile(file);
				reader = streamFile.getReader();
				duration = (double) reader.getDuration() / 1000;
			} catch (IOException e) {
				log.error("Error read stream file {}. {}", file.getAbsolutePath(), e);
			} finally {
				if (reader != null) {
					reader.close();
				}
			}
		} else {
			log.error("No service found for {}", file.getAbsolutePath());
		}
		file = null;
	}
	return duration;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:35,代码来源:MultiThreadedApplicationAdapter.java


示例6: getFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc}
 */
public IStreamableFile getFile() {
	// TODO wondering if we need to have a reference
	return null;
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:7,代码来源:M4AReader.java


示例7: getFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc}
 */
public IStreamableFile getFile() {
	return flv;
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:6,代码来源:FLVWriter.java


示例8: getFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc} */
public IStreamableFile getFile() {
	return null;
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:5,代码来源:MP3Reader.java


示例9: getFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public IStreamableFile getFile() {
    // TODO wondering if we need to have a reference
    return null;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:9,代码来源:M4AReader.java


示例10: getFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public IStreamableFile getFile() {
    return flv;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:6,代码来源:FLVWriter.java


示例11: getFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public IStreamableFile getFile() {
    return null;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:6,代码来源:MP3Reader.java


示例12: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
    return new M4A(file);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:8,代码来源:M4AService.java


示例13: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
    return new MP4(file);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:8,代码来源:MP4Service.java


示例14: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
    return new FLV(file, generateMetadata);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:8,代码来源:FLVService.java


示例15: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc} */
public abstract IStreamableFile getStreamableFile(File file) throws IOException;
 
开发者ID:Red5,项目名称:red5-server,代码行数:3,代码来源:BaseStreamableFileService.java


示例16: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
    return new MP3(file);
}
 
开发者ID:Red5,项目名称:red5-server,代码行数:6,代码来源:MP3Service.java


示例17: init

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/**
 * Initialization
 *
 * @throws IOException          I/O exception
 */
private void init() throws IOException {
	log.debug("Init");
	// if we plan to use a queue, create one
	if (delayWrite) {
		queue = new PriorityQueue<QueuedData>(queueThreshold <= 0 ? 11 : queueThreshold);
		// add associated locks
		reentrantLock = new ReentrantReadWriteLock();
		writeLock = reentrantLock.writeLock();
		readLock = reentrantLock.readLock();
	}
	IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
	File folder = file.getParentFile();
	if (!folder.exists()) {
		if (!folder.mkdirs()) {
			throw new IOException("Could not create parent folder");
		}
	}
	if (!file.isFile()) {
		// Maybe the (previously existing) file has been deleted
		file.createNewFile();
	} else if (!file.canWrite()) {
		throw new IOException("The file is read-only");
	}
	IStreamableFileService service = factory.getService(file);
	IStreamableFile flv = service.getStreamableFile(file);
	if (mode == null || mode.equals(IClientStream.MODE_RECORD)) {
		writer = flv.getWriter();
		//write the decoder config tag if it exists
		if (videoConfigurationTag != null) {
			writer.writeTag(videoConfigurationTag);
			videoConfigurationTag = null;
		}
		if (audioConfigurationTag != null) {
			writer.writeTag(audioConfigurationTag);
			audioConfigurationTag = null;
		}
	} else if (mode.equals(IClientStream.MODE_APPEND)) {
		writer = flv.getAppendWriter();
	} else {
		throw new IllegalStateException("Illegal mode type: " + mode);
	}
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:48,代码来源:FileConsumer.java


示例18: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc}
 */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
	return new M4A(file);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:7,代码来源:M4AService.java


示例19: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc}
 */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
	return new MP4(file);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:7,代码来源:MP4Service.java


示例20: getStreamableFile

import org.red5.io.IStreamableFile; //导入依赖的package包/类
/** {@inheritDoc}
 */
@Override
public IStreamableFile getStreamableFile(File file) throws IOException {
	return new FLV(file, generateMetadata);
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:7,代码来源:FLVService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MutableGraph类代码示例发布时间:2022-05-22
下一篇:
Java TestRunnerUtil类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap