本文整理汇总了Java中org.red5.io.ITagWriter类的典型用法代码示例。如果您正苦于以下问题:Java ITagWriter类的具体用法?Java ITagWriter怎么用?Java ITagWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITagWriter类属于org.red5.io包,在下文中一共展示了ITagWriter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public ITagWriter getWriter() throws IOException {
if (file.exists()) {
file.delete();
}
file.createNewFile();
ITagWriter writer = new FLVWriter(file, false);
return writer;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:12,代码来源:FLV.java
示例2: getAppendWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/** {@inheritDoc} */
public ITagWriter getAppendWriter() throws IOException {
// If the file doesn't exist, we can't append to it, so return a writer
if (!file.exists()) {
log.info("File does not exist, calling writer. This will create a new file.");
return getWriter();
}
//Fix by Mhodgson: FLVWriter constructor allows for passing of file object
ITagWriter writer = new FLVWriter(file, true);
return writer;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:12,代码来源:FLV.java
示例3: testCuePointInjection
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* Test MetaData injection
*
* @throws IOException
* for fun
*/
public void testCuePointInjection() throws IOException {
String path = "target/test-classes/fixtures/test_cue1.flv";
File f = new File(path);
System.out.println("Path: " + f.getAbsolutePath());
if (f.exists()) {
f.delete();
}
// Create new file
f.createNewFile();
// Use service to grab FLV file
IFLV flv = (IFLV) service.getStreamableFile(f);
// Grab a writer for writing a new FLV
ITagWriter writer = flv.getWriter();
// Create a reader for testing
File readfile = new File(path);
//assertTrue(readfile.exists());
IFLV readflv = (IFLV) service.getStreamableFile(readfile);
readflv.setCache(NoCacheImpl.getInstance());
// Grab a reader for reading a FLV in
ITagReader reader = readflv.getReader();
// Inject MetaData
writeTagsWithInjection(reader, writer);
}
开发者ID:Red5,项目名称:red5-server,代码行数:37,代码来源:CuePointInjectionTest.java
示例4: testMetaDataInjection
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* Test MetaData injection
*
* @throws IOException
* if io exception
*/
public void testMetaDataInjection() throws IOException {
String path = "target/test-classes/fixtures/test_cue1.flv";
File f = new File(path);
System.out.println("Path: " + f.getAbsolutePath());
if (f.exists()) {
f.delete();
}
// Create new file
f.createNewFile();
// Use service to grab FLV file
IFLV flv = (IFLV) service.getStreamableFile(f);
// Grab a writer for writing a new FLV
ITagWriter writer = flv.getWriter();
// Create a reader for testing
File readfile = new File(path);
IFLV readflv = (IFLV) service.getStreamableFile(readfile);
readflv.setCache(NoCacheImpl.getInstance());
// Grab a reader for reading a FLV in
ITagReader reader = readflv.getReader();
// Inject MetaData
writeTagsWithInjection(reader, writer);
}
开发者ID:Red5,项目名称:red5-server,代码行数:35,代码来源:MetaDataInjectionTest.java
示例5: testCuePointInjection
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* Test MetaData injection
*
* @throws IOException for fun
*/
public void testCuePointInjection() throws IOException {
String path = "fixtures/test_cue1.flv";
File f = new File(path);
System.out.println("Path: " + f.getAbsolutePath());
if (f.exists()) {
f.delete();
} else {
// try test subdirectory
path = "test/fixtures/test_cue1.flv";
f = new File(path);
System.out.println("Path: " + f.getAbsolutePath());
if (f.exists()) {
f.delete();
}
}
// Create new file
f.createNewFile();
// Use service to grab FLV file
IFLV flv = (IFLV) service.getStreamableFile(f);
// Grab a writer for writing a new FLV
ITagWriter writer = flv.getWriter();
// Create a reader for testing
File readfile = new File(path);
//assertTrue(readfile.exists());
IFLV readflv = (IFLV) service.getStreamableFile(readfile);
readflv.setCache(NoCacheImpl.getInstance());
// Grab a reader for reading a FLV in
ITagReader reader = readflv.getReader();
// Inject MetaData
writeTagsWithInjection(reader, writer);
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:44,代码来源:CuePointInjectionTest.java
示例6: testMetaDataInjection
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* Test MetaData injection
* @throws IOException if io exception
*/
public void testMetaDataInjection() throws IOException {
String path = "fixtures/test_cue1.flv";
File f = new File(path);
System.out.println("Path: " + f.getAbsolutePath());
if (f.exists()) {
f.delete();
} else {
// try test subdirectory
path = "test/fixtures/test_cue1.flv";
f = new File(path);
System.out.println("Path: " + f.getAbsolutePath());
if (f.exists()) {
f.delete();
}
}
// Create new file
f.createNewFile();
// Use service to grab FLV file
IFLV flv = (IFLV) service.getStreamableFile(f);
// Grab a writer for writing a new FLV
ITagWriter writer = flv.getWriter();
// Create a reader for testing
File readfile = new File(path);
IFLV readflv = (IFLV) service.getStreamableFile(readfile);
readflv.setCache(NoCacheImpl.getInstance());
// Grab a reader for reading a FLV in
ITagReader reader = readflv.getReader();
// Inject MetaData
writeTagsWithInjection(reader, writer);
}
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:41,代码来源:MetaDataInjectionTest.java
示例7: getWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public ITagWriter getWriter() throws IOException {
return null;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:7,代码来源:M4A.java
示例8: getAppendWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
public ITagWriter getAppendWriter() throws IOException {
return null;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:4,代码来源:M4A.java
示例9: writerFromNearestKeyFrame
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public ITagWriter writerFromNearestKeyFrame(int seekPoint) {
return null;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:7,代码来源:MP4.java
示例10: getWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/** {@inheritDoc} */
public ITagWriter getWriter() throws IOException {
return null;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:5,代码来源:MP3.java
示例11: getAppendWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/** {@inheritDoc} */
public ITagWriter getAppendWriter() throws IOException {
return null;
}
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:5,代码来源:MP3.java
示例12: getWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ITagWriter getWriter() throws IOException {
return null;
}
开发者ID:Red5,项目名称:red5-io,代码行数:8,代码来源:M4A.java
示例13: getAppendWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
@Override
public ITagWriter getAppendWriter() throws IOException {
return null;
}
开发者ID:Red5,项目名称:red5-io,代码行数:5,代码来源:M4A.java
示例14: writerFromNearestKeyFrame
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ITagWriter writerFromNearestKeyFrame(int seekPoint) {
return null;
}
开发者ID:Red5,项目名称:red5-io,代码行数:8,代码来源:MP4.java
示例15: getWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ITagWriter getWriter() throws IOException {
log.info("getWriter: {}", file);
return new FLVWriter(file.toPath(), false);
}
开发者ID:Red5,项目名称:red5-io,代码行数:9,代码来源:FLV.java
示例16: getAppendWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public ITagWriter getAppendWriter() throws IOException {
log.info("getAppendWriter: {}", file);
return new FLVWriter(file.toPath(), true);
}
开发者ID:Red5,项目名称:red5-io,代码行数:7,代码来源:FLV.java
示例17: getWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public ITagWriter getWriter() throws IOException {
return null;
}
开发者ID:Red5,项目名称:red5-io,代码行数:6,代码来源:MP3.java
示例18: getAppendWriter
import org.red5.io.ITagWriter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public ITagWriter getAppendWriter() throws IOException {
return null;
}
开发者ID:Red5,项目名称:red5-io,代码行数:6,代码来源:MP3.java
示例19: writeTagsWithInjection
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* Write FLV tags and inject Cue Points
*
* @param reader
* @param writer
* @throws IOException
*/
private void writeTagsWithInjection(ITagReader reader, ITagWriter writer) throws IOException {
IMetaCue cp = new MetaCue<Object, Object>();
cp.setName("cue_1");
cp.setTime(0.01);
cp.setType(ICueType.EVENT);
IMetaCue cp1 = new MetaCue<Object, Object>();
cp1.setName("cue_2");
cp1.setTime(2.01);
cp1.setType(ICueType.EVENT);
// Place in TreeSet for sorting
TreeSet<IMetaCue> ts = new TreeSet<IMetaCue>();
ts.add(cp);
ts.add(cp1);
// int cuePointTimeStamp = getTimeInMilliseconds(ts.first());
ITag tag = null;
ITag injectedTag = null;
// read any existing tags and insert cue points
// while (reader.hasMoreTags()) {
// tag = reader.readTag();
// // if there are cuePoints in the TreeSet
// if (!ts.isEmpty()) {
// // If the tag has a greater timestamp than the
// // cuePointTimeStamp, then inject the tag
// while (tag.getTimestamp() > cuePointTimeStamp) {
// injectedTag = injectCuePoint(ts.first(), tag);
// writer.writeTag(injectedTag);
// tag.setPreviousTagSize((injectedTag.getBodySize() + 11));
// // Advance to the next CuePoint
// ts.remove(ts.first());
// if (ts.isEmpty()) {
// break;
// }
// cuePointTimeStamp = getTimeInMilliseconds(ts.first());
// }
// }
// writer.writeTag(tag);
// }
while (!ts.isEmpty()) {
injectedTag = injectCuePoint(ts.first(), tag);
writer.writeTag(injectedTag);
// Advance to the next CuePoint
ts.remove(ts.first());
}
writer.close();
}
开发者ID:Red5,项目名称:red5-server,代码行数:57,代码来源:CuePointInjectionTest.java
示例20: writeTagsWithInjection
import org.red5.io.ITagWriter; //导入依赖的package包/类
/**
* Write FLV tags and inject Cue Points
*
* @param reader
* @param writer
* @throws IOException
*/
private void writeTagsWithInjection(ITagReader reader, ITagWriter writer) throws IOException {
IMetaCue cp = new MetaCue<Object, Object>();
cp.setName("cue_1");
cp.setTime(0.01);
cp.setType(ICueType.EVENT);
IMetaCue cp1 = new MetaCue<Object, Object>();
cp1.setName("cue_1");
cp1.setTime(2.01);
cp1.setType(ICueType.EVENT);
// Place in TreeSet for sorting
TreeSet<IMetaCue> ts = new TreeSet<IMetaCue>();
ts.add(cp);
ts.add(cp1);
int cuePointTimeStamp = getTimeInMilliseconds(ts.first());
ITag tag = null;
ITag injectedTag = null;
while (reader.hasMoreTags()) {
tag = reader.readTag();
if (tag.getDataType() != IoConstants.TYPE_METADATA) {
//injectNewMetaData();
} else {
//in
}
// if there are cuePoints in the TreeSet
if (!ts.isEmpty()) {
// If the tag has a greater timestamp than the
// cuePointTimeStamp, then inject the tag
while (tag.getTimestamp() > cuePointTimeStamp) {
injectedTag = injectMetaData(ts.first(), tag);
writer.writeTag(injectedTag);
tag.setPreviousTagSize((injectedTag.getBodySize() + 11));
// Advance to the next CuePoint
ts.remove(ts.first());
if (ts.isEmpty()) {
break;
}
cuePointTimeStamp = getTimeInMilliseconds(ts.first());
}
}
writer.writeTag(tag);
}
}
开发者ID:Red5,项目名称:red5-server,代码行数:65,代码来源:MetaDataInjectionTest.java
注:本文中的org.red5.io.ITagWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论