hello, all, i have wrote a DATASource for RTSP stream, but it doesn't work well on video and audio. Anybody can help me? here is my code:
package com.omnividea.media.protocol.rtsp;
import javax.media.MediaLocator; import javax.media.protocol.Positionable;
public class DataSource extends com.omnividea.media.protocol.DataSource implements Positionable { private String urlString = "";
public DataSource() { super(); }
public DataSource(MediaLocator ml) { super(ml); setLocator(ml); }
public void setLocator(MediaLocator ml) { super.setLocator(ml); try { urlString = ml.toString(); // Old version System.out.println("RTSP source: " + urlString); } catch (Exception e) { System.out.println("Bad URL: " + ml); } }
public String getUrlName() { return urlString; }
}
Thanks, all
the video and audio are very jerky? I tried to change buffer length, but no effect.
BufferControl bc = (BufferControl) proc .getControl("javax.media.control.BufferControl"); if (bc != null) { bc.setBufferLength(BufferControl.MAX_VALUE); bc.setMinimumThreshold(10000);
} Regards, lefish
Log in to post a comment.
hello, all, i have wrote a DATASource for RTSP stream, but it doesn't work well on video and audio.
Anybody can help me? here is my code:
package com.omnividea.media.protocol.rtsp;
import javax.media.MediaLocator;
import javax.media.protocol.Positionable;
public class DataSource extends com.omnividea.media.protocol.DataSource
implements Positionable {
private String urlString = "";
public DataSource() {
super();
}
public DataSource(MediaLocator ml) {
super(ml);
setLocator(ml);
}
public void setLocator(MediaLocator ml) {
super.setLocator(ml);
try {
urlString = ml.toString(); // Old version
System.out.println("RTSP source: " + urlString);
} catch (Exception e) {
System.out.println("Bad URL: " + ml);
}
}
public String getUrlName() {
return urlString;
}
}
Thanks, all
the video and audio are very jerky?
I tried to change buffer length, but no effect.
BufferControl bc = (BufferControl) proc
.getControl("javax.media.control.BufferControl");
if (bc != null) {
bc.setBufferLength(BufferControl.MAX_VALUE);
bc.setMinimumThreshold(10000);
}
Regards,
lefish