本文整理汇总了Java中javax.media.protocol.ContentDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ContentDescriptor类的具体用法?Java ContentDescriptor怎么用?Java ContentDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentDescriptor类属于javax.media.protocol包,在下文中一共展示了ContentDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public void process(String recordingFile, String movieFile) throws Exception {
MediaLocator mediaLocator = new MediaLocator(new File(movieFile).toURI()
.toURL());
PlayerDataSource playerDataSource = new PlayerDataSource(recordingFile);
Processor processor = Manager.createProcessor(playerDataSource);
processor.addControllerListener(this);
processor.configure();
if (!waitForState(processor, Processor.Configured)) {
System.err.println("Failed to configure the processor.");
return;
}
processor.setContentDescriptor(new ContentDescriptor(
FileTypeDescriptor.QUICKTIME));
TrackControl trackControl[] = processor.getTrackControls();
Format format[] = trackControl[0].getSupportedFormats();
trackControl[0].setFormat(format[0]);
processor.realize();
if (!waitForState(processor, Processor.Realized)) {
System.err.println("Failed to realize the processor.");
return;
}
DataSource dataSource = processor.getDataOutput();
DataSink dataSink = Manager.createDataSink(dataSource, mediaLocator);
dataSink.open();
processor.start();
dataSink.start();
waitForFileDone();
dataSink.close();
processor.removeControllerListener(this);
}
示例2: controllerUpdate
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
@Override
public void controllerUpdate(ControllerEvent p0) {
if (p0 instanceof ConfigureCompleteEvent) {
ContentDescriptor cd = new ContentDescriptor(
ContentDescriptor.RAW_RTP);
processor.setContentDescriptor(cd);
Format format;
TrackControl track[] = processor.getTrackControls();
int numPistas=track.length;
for(int i=0;i<numPistas;i++){
format = track[i].getFormat();
if (format instanceof VideoFormat) {
VideoFormat v = (VideoFormat) track[i].getFormat();
setMyVideoFormat(v, track[i]);
}
if (format instanceof AudioFormat) {
AudioFormat a = (AudioFormat) track[i].getFormat();
setMyAudioFormat(a, track[i]);
}
}
processor.realize();
}
if (p0 instanceof RealizeCompleteEvent) {
try {
ds = processor.getDataOutput();
createMyRTPManager();
} catch (NotRealizedError ex) {
myEx(null, ex.getMessage());
}
}
if (p0 instanceof EndOfMediaEvent) {
closeMyStream();
endofMedia = true;
}
}
示例3: getStreams
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public PullSourceStream[] getStreams() {
PullSourceStream [] streams = new PullSourceStream [1];
InputSourceStream iss = new InputSourceStream(in,
new FileTypeDescriptor(ContentDescriptor.RAW));
streams[0] = iss;
return streams;
}
示例4: getSupportedInputContentDescriptors
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
@Override
public ContentDescriptor[] getSupportedInputContentDescriptors()
{
return supportedInputContentDescriptors;
}
示例5: getSupportedInputContentDescriptors
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor [] getSupportedInputContentDescriptors() {
return supportedFormat;
}
示例6: FTPSourceStream
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public FTPSourceStream(InputStream in)
{
this.dataIn = in;
eofMarker = false;
cd = new ContentDescriptor("unknown");
}
示例7: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor()
{
return cd;
}
示例8: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return actual.getContentDescriptor();
}
示例9: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
/***************************************************************************
* SourceStream
***************************************************************************/
public ContentDescriptor getContentDescriptor() {
return cd;
}
示例10: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return new ContentDescriptor(ContentDescriptor.RAW);
}
示例11: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return null;
}
示例12: getContentType
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public String getContentType() {
return ContentDescriptor.RAW;
}
示例13: getContentType
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
/**
* Returns RAW since buffers of video frames are sent without a container format.
*/
@Override
public String getContentType()
{
return ContentDescriptor.RAW;
}
示例14: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor()
{
return new ContentDescriptor(ContentDescriptor.RAW);
}
示例15: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return new ContentDescriptor(ContentDescriptor.RAW);
}