Methods Summary |
---|
public void | addController(javax.media.Controller controller)
|
public void | addControllerListener(javax.media.ControllerListener controllerListener)
controllerListeners.add(controllerListener);
|
public void | close()
|
public void | configure()
try{
tracks = parser.getTracks();
for(int i=0;i<tracks.length; i++)
if(tracks[i].getFormat() instanceof VideoFormat)
videoTrack = tracks[i];
} catch(Exception e){}
|
public void | deallocate()
|
public javax.media.protocol.ContentDescriptor | getContentDescriptor()
return null;
|
public javax.media.Control | getControl(java.lang.String str)
return null;
|
public java.awt.Component | getControlPanelComponent()
return null;
|
public javax.media.Control[] | getControls()
return null;
|
public javax.media.protocol.DataSource | getDataOutput()
return null;
|
public javax.media.Time | getDuration()
return null;
|
public javax.media.GainControl | getGainControl()
return null;
|
public long | getMediaNanoseconds()
return 0;
|
public javax.media.Time | getMediaTime()
return null;
|
public float | getRate()
return 0f;
|
public javax.media.Time | getStartLatency()
return null;
|
public int | getState()
return currentState;
|
public javax.media.Time | getStopTime()
return null;
|
public javax.media.protocol.ContentDescriptor[] | getSupportedContentDescriptors()
return new ContentDescriptor[0];
|
public javax.media.Time | getSyncTime()
return null;
|
public int | getTargetState()
return targetState;
|
public javax.media.TimeBase | getTimeBase()
return timebase;
|
public javax.media.control.TrackControl[] | getTrackControls()
return null;
|
public java.awt.Component | getVisualComponent()
return visualComponent;
|
public static void | main(java.lang.String[] args)
String url = args[0];
MediaLocator ml = new MediaLocator(url);
com.omnividea.media.protocol.file.DataSource ds = new com.omnividea.media.protocol.file.DataSource(null);
ds.setLocator(ml);
System.out.println(ds.getUrlName());
Demultiplexer parser = new com.omnividea.media.parser.video.Parser();
parser.setSource(ds);
Track[] tracks = parser.getTracks();
Track video = null;
for(int i=0;i<tracks.length; i++)
if(tracks[i].getFormat() instanceof VideoFormat)
video = tracks[i];
Codec decoder = new com.omnividea.media.codec.video.NativeDecoder();
decoder.setInputFormat(video.getFormat());
decoder.open();
VideoRenderer renderer = new com.sun.media.renderer.video.LightWeightRenderer();
renderer.open();
Format outputFormat = decoder.setOutputFormat(renderer.getSupportedInputFormats()[0]);
if(outputFormat==null)
outputFormat=new RGBFormat(new Dimension(720, 576),
Format.NOT_SPECIFIED,
int[].class,
Format.NOT_SPECIFIED,
24,
3, 2, 1,
3, Format.NOT_SPECIFIED,
Format.TRUE,
Format.NOT_SPECIFIED);
renderer.open();
renderer.setInputFormat(outputFormat);
JFrame f = new JFrame();
f.add(renderer.getComponent());
f.pack();
f.setVisible(true);
Buffer in = new Buffer();
Buffer out = new Buffer();
while(true){
video.readFrame(in);
Thread.sleep(30);
decoder.process(in, out);
//renderer.process(out);
}
|
public javax.media.Time | mapToTimeBase(javax.media.Time time)
return time;
|
public void | prefetch()
realize();
|
public void | realize()
try{
decoder = new com.omnividea.media.codec.video.NativeDecoder();
decoder.setInputFormat(videoTrack.getFormat());
decoder.open();
renderer = new com.sun.media.renderer.video.LightWeightRenderer();
renderer.open();
Format outputFormat = decoder.setOutputFormat(renderer.getSupportedInputFormats()[0]);
if(outputFormat==null)
outputFormat=new RGBFormat(new Dimension(720, 576),
Format.NOT_SPECIFIED,
int[].class,
Format.NOT_SPECIFIED,
24,
3, 2, 1,
3, Format.NOT_SPECIFIED,
Format.TRUE,
Format.NOT_SPECIFIED);
renderer.open();
renderer.setInputFormat(outputFormat);
visualComponent = renderer.getComponent();
} catch(Exception e){}
|
public void | removeController(javax.media.Controller controller)
|
public void | removeControllerListener(javax.media.ControllerListener controllerListener)
controllerListeners.remove(controllerListener);
|
public javax.media.protocol.ContentDescriptor | setContentDescriptor(javax.media.protocol.ContentDescriptor contentDescriptor)
return null;
|
public void | setMediaTime(javax.media.Time time)
|
public float | setRate(float rate)
return desiredRate = rate;
|
public void | setSource(javax.media.protocol.DataSource dataSource)
this.dataSource = dataSource;
parser = new com.omnividea.media.parser.video.Parser();
parser.setSource(dataSource);
|
public void | setStopTime(javax.media.Time time)
|
public void | setTimeBase(javax.media.TimeBase timeBase)
throw new IncompatibleTimeBaseException();
|
public void | start()
syncStart(Manager.getSystemTimeBase().getTime());
|
public void | stop()
|
public void | syncStart(javax.media.Time time)
startTime = time;
//videoTrack.setStartTime(time);
Buffer in = new Buffer();
Buffer out = new Buffer();
while(true){
try{
videoTrack.readFrame(in);
Thread.sleep(30);
decoder.process(in, out);
renderer.process(out);
}catch(InterruptedException ie){}
}
|
public java.lang.String | toString()
String retValue;
retValue = "Media Player";
return retValue;
|