本文整理汇总了Java中javax.media.protocol.ContentDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ContentDescriptor类的具体用法?Java ContentDescriptor怎么用?Java ContentDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentDescriptor类属于javax.media.protocol包,在下文中一共展示了ContentDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:openwarrior,项目名称:java-screen-recorder,代码行数:36,代码来源:RecordingConverter.java
示例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;
}
}
开发者ID:mloobo,项目名称:Dolphin-Streaming-Server,代码行数:39,代码来源:UnicastRtpWebcam.java
示例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;
}
开发者ID:davidrudder23,项目名称:OpenNotification,代码行数:8,代码来源:InputStreamDataSource.java
示例4: getSupportedInputContentDescriptors
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
@Override
public ContentDescriptor[] getSupportedInputContentDescriptors()
{
return supportedInputContentDescriptors;
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:6,代码来源:QTParser.java
示例5: getSupportedInputContentDescriptors
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor [] getSupportedInputContentDescriptors() {
return supportedFormat;
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:4,代码来源:GsmParser.java
示例6: FTPSourceStream
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public FTPSourceStream(InputStream in)
{
this.dataIn = in;
eofMarker = false;
cd = new ContentDescriptor("unknown");
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:7,代码来源:FTPSourceStream.java
示例7: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor()
{
return cd;
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:5,代码来源:FTPSourceStream.java
示例8: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return actual.getContentDescriptor();
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:4,代码来源:MonitorStream.java
示例9: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
/***************************************************************************
* SourceStream
***************************************************************************/
public ContentDescriptor getContentDescriptor() {
return cd;
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:8,代码来源:LiveStream.java
示例10: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return new ContentDescriptor(ContentDescriptor.RAW);
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:4,代码来源:JpegImagesToMovie.java
示例11: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return null;
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:4,代码来源:RTPSocketAdapter.java
示例12: getContentType
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public String getContentType() {
return ContentDescriptor.RAW;
}
开发者ID:champtar,项目名称:fmj-sourceforge-mirror,代码行数:4,代码来源:SuperGlueDataSource.java
示例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;
}
开发者ID:valsr,项目名称:SweetHome3D,代码行数:9,代码来源:VideoPanel.java
示例14: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor()
{
return new ContentDescriptor(ContentDescriptor.RAW);
}
开发者ID:valsr,项目名称:SweetHome3D,代码行数:5,代码来源:VideoPanel.java
示例15: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public ContentDescriptor getContentDescriptor() {
return new ContentDescriptor(ContentDescriptor.RAW);
}
开发者ID:openwarrior,项目名称:java-screen-recorder,代码行数:4,代码来源:PlayerSourceStream.java
示例16: getContentType
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public String getContentType() {
return ContentDescriptor.RAW;
}
开发者ID:openwarrior,项目名称:java-screen-recorder,代码行数:4,代码来源:PlayerDataSource.java
示例17: controllerUpdate
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
public void controllerUpdate(ControllerEvent p0) {
if (p0 instanceof ConfigureCompleteEvent) {
Format format;
boolean encodingOK = false;
TrackControl track[] = processor.getTrackControls();
ContentDescriptor cd = new ContentDescriptor(
ContentDescriptor.RAW_RTP);
processor.setContentDescriptor(cd);
format = track[prepare_track].getFormat();
if (format instanceof VideoFormat) {
VideoFormat v = (VideoFormat) track[prepare_track].getFormat();
encodingOK = setMyVideoFormat(v, track[prepare_track]);
if(HiloCliente.DEBUG){
System.out.println("Pista "+prepare_track+" es de Video");
}
}
if (format instanceof AudioFormat) {
AudioFormat a = (AudioFormat) track[prepare_track].getFormat();
encodingOK = setMyAudioFormat(a, track[prepare_track]);
if(HiloCliente.DEBUG){
System.out.println("Pista "+prepare_track+" es de Audio");
}
}
if (encodingOK) {
for (int i = 0; i < track.length; i++) {
if (i != prepare_track) {
track[i].setEnabled(false);
}
}
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;
}
}
开发者ID:mloobo,项目名称:Dolphin-Streaming-Server,代码行数:51,代码来源:UnicastRtp.java
示例18: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
/***************************************************************************
* SourceStream
***************************************************************************/
public ContentDescriptor getContentDescriptor() {
return cd;
}
开发者ID:mloobo,项目名称:Dolphin-Streaming-Server,代码行数:8,代码来源:StreamPantalla.java
示例19: test
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
private static void test(File file, AviVideoFormat format) throws IOException, NoProcessorException, NoDataSinkException {
System.out.println("* Writing " + file);
DataSource source = new ImageDataSource(format);
Processor p = Manager.createProcessor(source);
Handler h = new Handler();
p.addControllerListener(h);
p.configure();
if (!h.waitForState(p, Processor.Configured)) {
throw new IOException("Could not configure processor.");
}
p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.MSVIDEO));
TrackControl trackControls[] = p.getTrackControls();
javax.media.Format formats[] = trackControls[0].getSupportedFormats();
if (formats == null || formats.length <= 0) {
throw new UnsupportedOperationException("No output formats available.");
}
String encoding = format.getEncoding();
javax.media.Format selectedFormat = null;
for (javax.media.Format f : formats) {
if (f.getEncoding().equals(encoding)) {
selectedFormat = f;
break;
}
}
if (selectedFormat == null) {
throw new UnsupportedOperationException("No output format selected.");
}
trackControls[0].setFormat(selectedFormat);
p.realize();
if (!h.waitForState(p, Processor.Realized)) {
throw new IOException("Could not realize processor.");
}
MediaLocator ml = new MediaLocator(file.toURI().toURL());
DataSink sink = Manager.createDataSink(p.getDataOutput(), ml);
sink.addDataSinkListener(h);
sink.open();
try {
sink.start();
p.start();
if (!h.waitForEndOfMedia()) {
throw new IOException("Processor reported an error.");
}
p.stop();
sink.stop();
/*
if (!h.waitForFileDone()) {
throw new IOException("DataSink reported an error.");
}*/
} finally {
p.close();
sink.close();
}
}
开发者ID:sebkur,项目名称:montemedia,代码行数:54,代码来源:Main.java
示例20: getContentDescriptor
import javax.media.protocol.ContentDescriptor; //导入依赖的package包/类
@Override
public ContentDescriptor getContentDescriptor() {
return new ContentDescriptor(ContentDescriptor.RAW);
}
开发者ID:sebkur,项目名称:montemedia,代码行数:5,代码来源:Main.java
注:本文中的javax.media.protocol.ContentDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论