Java media framework et rtp

Fermé
Jajane - 27 juil. 2006 à 16:28
 Jajane - 27 juil. 2006 à 16:33
Bonjour,
j'aimerais avoir des pistes pour m'aider à sortir d'un point de blocage; je d1▲veloppe une application cleint-serveur en Java. Le serveur met à la disposition du client un flux video au format mpeg. le client, après s'être authentifié reçoit les paramètres de création d'une session RTP (IP du serveur, numéro de port négocié pour le streaming) et crée un MediaPlayer pour afficher le flux.
Je suis bloquée à ce niveau; quand j'assigne la DataSource crée à partir du flux, au player, je retrouve une IncomapibleSourceExcpetion. Ci-joint le code source et le code d'erreur:
A voir également:

1 réponse

code fragment:

/*beginning*/

else if (evt instanceof NewReceiveStreamEvent) {
try {
stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
DataSource ds = stream.getDataSource();
// Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
if (ctl != null){
System.err.println(" - Received new RTP stream: " + ctl.getFormat());

} else{
System.err.println(" - Recevied new RTP stream");
}

if (participant == null){
System.err.println(" The sender of this stream had yet to be identified.");
}
else {
System.err.println(" The stream comes from: " + participant.getCNAME());

}
// create a player by passing datasource to the Media Manager

try{
MediaPlayer p = new MediaPlayer();

System.out.println("player created");
p.setDataSource(ds);//generates an IncompatibleSourceException
System.out.println("...ds set!!");
p.addControllerListener(this);
p.realize();
System.out.println("player state : "+p.getState());
System.out.println("Realized= "+Controller.Realized);

synchronized(dataSync){

p.waitForState(Controller.Realized);//never get past this point

}
System.out.println("Player realized!");
...

}catch(Exception ex){
System.out.println(ex.getClass().getName());
}



/*end of code fragment*/

output:
------

Fobs4JMF -Native shared library found
javx.media.InompatibleSourceExcpetion : Invalid Datasource
at com.omnividea.media.parser.video.Parser.setSource(Parser.java:142)
at com.omniidea.media.content.unknown.Handler.setSource(Handler.java:94)
...
at AVReceive2.update(AVReceive2.java: 292)
at com.sun.media.rtp.RTPEventHandler.processEvent(...)
at com.sun.media.rtp.RTPEventHandler.dispatchEvents(...)
at com.sun.media.rtp.RTPEventHandler.run(...)


Merci d'avance de votre support!!
1