|
From: <car...@us...> - 2003-03-24 02:54:30
|
Update of /cvsroot/madsserv/madsserv/src/server/transition In directory sc8-pr-cvs1:/tmp/cvs-serv21811/server/transition Modified Files: Transition.java Log Message: Version stable et fonctionnelle Index: Transition.java =================================================================== RCS file: /cvsroot/madsserv/madsserv/src/server/transition/Transition.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Transition.java 19 Mar 2003 01:47:11 -0000 1.8 --- Transition.java 24 Mar 2003 02:54:25 -0000 1.9 *************** *** 2,5 **** --- 2,6 ---- import java.io.*; import java.lang.Object.*; + import java.lang.String.*; import javax.media.Time.*; import javax.media.*; *************** *** 31,34 **** --- 32,36 ---- protected GestionAdapta gestionAdaptaRef; protected Streaming streamingRef; + private String temp; /** *************** *** 58,65 **** double _mediaLength) { ! double newAuxVMediaTime = oldMediaTime + 2; ! double newAuxAMediaTime = oldMediaTime + 2; ! ! System.out.println("FUCK :" + _reencodingVideoFor.getEncoding()); // on regarde ici le format de reencodage et on decide alors du temps de transition --- 60,65 ---- double _mediaLength) { ! double newAuxVMediaTime = oldMediaTime + 1.5; ! double newAuxAMediaTime = oldMediaTime + 1.5; // on regarde ici le format de reencodage et on decide alors du temps de transition *************** *** 67,144 **** if (_reencodingVideoFor.getEncoding().compareTo("celB/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 1; } if (_reencodingVideoFor.getEncoding().compareTo("celB/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 1; } ! if ((_reencodingVideoFor.getEncoding()).compareTo("JPEG/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 2; } if (_reencodingVideoFor.getEncoding().compareTo("nv/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 1; } if (_reencodingVideoFor.getEncoding().compareTo("H261/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1; } if (_reencodingVideoFor.getEncoding().compareTo("MPV/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1; } if (_reencodingVideoFor.getEncoding().compareTo("MP2T/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1; } ! if ((_reencodingVideoFor.getEncoding()).compareTo("h263/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 3; } } ! if (_reencodingAudioFor.getEncoding().compareTo("PCMU/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } if (_reencodingAudioFor.getEncoding().compareTo("1016/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1; } if (_reencodingAudioFor.getEncoding().compareTo("G726-32/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("G723/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("DVI4/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("LPG/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("PCMA/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("G722/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("L16/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } if (_reencodingAudioFor.getEncoding().compareTo("QCELP/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("CN/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("MPA/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("G728/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if (_reencodingAudioFor.getEncoding().compareTo("G729/RTP") == 0){ ! newAuxAMediaTime = oldMediaTime + 1; } ! if ((_reencodingAudioFor.getEncoding()).compareTo("mpegaudio/rtp") == 0) { newAuxAMediaTime = oldMediaTime + 1.5; } ! if ((_reencodingAudioFor.getEncoding()).compareTo("dvi/rtp") == 0) { newAuxAMediaTime = oldMediaTime + 1.5; } ! if ((_reencodingAudioFor.getEncoding()).compareTo("gsm/rtp") == 0) { newAuxAMediaTime = oldMediaTime + 1.5; } --- 67,144 ---- if (_reencodingVideoFor.getEncoding().compareTo("celB/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } if (_reencodingVideoFor.getEncoding().compareTo("celB/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } ! if ( (_reencodingVideoFor.getEncoding()).compareTo("JPEG/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } if (_reencodingVideoFor.getEncoding().compareTo("nv/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } if (_reencodingVideoFor.getEncoding().compareTo("H261/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } if (_reencodingVideoFor.getEncoding().compareTo("MPV/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } if (_reencodingVideoFor.getEncoding().compareTo("MP2T/RTP") == 0) { ! newAuxVMediaTime = oldMediaTime + 1.5; } ! if ( (_reencodingVideoFor.getEncoding()).compareTo("h263/rtp") == 0) { ! newAuxVMediaTime = oldMediaTime + 3.5; } } ! if (_reencodingAudioFor.getEncoding().compareTo("PCMU/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } if (_reencodingAudioFor.getEncoding().compareTo("1016/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } if (_reencodingAudioFor.getEncoding().compareTo("G726-32/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("G723/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("DVI4/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("LPG/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("PCMA/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("G722/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("L16/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } if (_reencodingAudioFor.getEncoding().compareTo("QCELP/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("CN/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("MPA/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("G728/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if (_reencodingAudioFor.getEncoding().compareTo("G729/RTP") == 0) { ! newAuxAMediaTime = oldMediaTime + 1.5; } ! if ( (_reencodingAudioFor.getEncoding()).compareTo("mpegaudio/rtp") == 0) { newAuxAMediaTime = oldMediaTime + 1.5; } ! if ( (_reencodingAudioFor.getEncoding()).compareTo("dvi/rtp") == 0) { newAuxAMediaTime = oldMediaTime + 1.5; } ! if ( (_reencodingAudioFor.getEncoding()).compareTo("gsm/rtp") == 0) { newAuxAMediaTime = oldMediaTime + 1.5; } *************** *** 160,164 **** */ ! public void setQualityLevel(int _qualityLevel, boolean _newFile) { --- 160,165 ---- */ ! public void setQualityLevel(int _qualityLevel, boolean _newFile) throws ! Exception { *************** *** 166,202 **** double mediaLength = 0; double auxTime = 0; Time startTime; Time auxMediaTime; VideoFormat reencodingVideoFor = null; AudioFormat reencodingAudioFor = null; //variables qui stockes le format original Video et Audio ! Format[][] lesFormats; ! /*Format[][] origVideoFor; ! Format[][] origAudioFor;*/ ! System.out.println("avant quality_level"); qualityLevel = _qualityLevel; //On obtient ici les formats Video et Audio Supportes. ! lesFormats = reencodeRef.getSupportedFormats(); ! System.out.println("On a recu les formats supportes"); ! //On obtient ici les formats Video et Audio de reencodage. if (reencodeRef.multiMedia) { ! System.out.println("debut settage des formats"); ! reencodingVideoFor = (VideoFormat) lesFormats[0][random.nextInt( ! lesFormats[0].length)]; /*gestionAdaptaRef.getVideoStreamingFormat( ! lesFormats, qualityLevel);*/ ! System.out.println("settage format video termine"); ! reencodingAudioFor = (AudioFormat) lesFormats[1][random.nextInt( ! lesFormats[1].length)]; ! /*gestionAdaptaRef.getAudioStreamingFormat(lesFormats, qualityLevel);*/ ! System.out.println("settage des formats termine"); } else { ! reencodingAudioFor = (AudioFormat) lesFormats[0][random.nextInt( ! lesFormats[0].length)]; ! /*gestionAdaptaRef.getAudioStreamingFormat(lesFormats, qualityLevel);*/ ! System.out.println("!multi settage du format audio"); } --- 167,198 ---- double mediaLength = 0; double auxTime = 0; + float jpegQuality=0; Time startTime; Time auxMediaTime; + Format[] reencodingFormats=null; VideoFormat reencodingVideoFor = null; AudioFormat reencodingAudioFor = null; //variables qui stockes le format original Video et Audio ! Format[][] supportedFormats; qualityLevel = _qualityLevel; + addLog("nouvelle qualite " + String.valueOf(qualityLevel)); //On obtient ici les formats Video et Audio Supportes. ! try { ! supportedFormats = reencodeRef.getSupportedFormats(); ! reencodingFormats= gestionAdaptaRef.getStreamingFormat(supportedFormats,qualityLevel); ! } ! catch (Exception e) { ! throw e; ! } //On obtient ici les formats Video et Audio de reencodage. if (reencodeRef.multiMedia) { ! reencodingVideoFor = (VideoFormat) reencodingFormats[1]; ! jpegQuality = gestionAdaptaRef.getJPEGQuality(qualityLevel); ! reencodingAudioFor = (AudioFormat) reencodingFormats[0]; } else { ! reencodingAudioFor = (AudioFormat) reencodingFormats[0]; } *************** *** 217,235 **** } //on Transmet ici les formats Audio et Video de reencodage - System.err.println("Transition : j'ai mis a jour les nouveaux formats"); if (reencodeRef.multiMedia) { reencodeRef.setReencodingVideoFormat(reencodingVideoFor); } reencodeRef.setReencodingAudioFormat(reencodingAudioFor); ! System.err.println("Transition : j'ai mis a jour les nouveaux formats"); ! //On Transmet ici l'endroit dans le media a partir de laquelle il faut reencoder le fichier. reencodeRef.setReencodingTime(startTime); - System.err.println("Transition : startime - " + startTime.getSeconds()); - reencodeRef.start(); - System.err.println("Transition : j'ai lance le reencodage"); - } --- 213,233 ---- } //on Transmet ici les formats Audio et Video de reencodage if (reencodeRef.multiMedia) { reencodeRef.setReencodingVideoFormat(reencodingVideoFor); + temp.valueOf(totalTime); + if (serverInit.log.LOG_ENABLED) { + addLog( (reencodingVideoFor.getEncoding() + ";") + temp); + } } reencodeRef.setReencodingAudioFormat(reencodingAudioFor); ! reencodeRef.setJPEGQuality(jpegQuality); ! temp.valueOf(totalTime); ! if (serverInit.log.LOG_ENABLED) { ! addLog( (reencodingAudioFor.getEncoding() + ";") + temp); ! } //On Transmet ici l'endroit dans le media a partir de laquelle il faut reencoder le fichier. reencodeRef.setReencodingTime(startTime); reencodeRef.start(); } *************** *** 241,245 **** currentMediaTime = _currentMediaTime; mediaTimeReceived = true; - } --- 239,242 ---- *************** *** 247,250 **** --- 244,248 ---- * setStreaming cree une referrence sur un objet Streaming * @param streamingRef un objet de type Streaming + * {@link Streaming} */ public void setStreaming(Streaming streamingRef) { *************** *** 255,258 **** --- 253,257 ---- * setStreaming cree une referrence sur un objet gestionAdapta * @param gestionAdptaRef un objet de type gestionAdapta + * {@link setStreaming} */ public void setGestionAdapta(GestionAdapta gestionAdaptaRef) { *************** *** 263,269 **** --- 262,278 ---- * setStreaming cree une referrence sur un objet Reencode * @param reencodeRef un objet de type Reencode + * {@link Reencode} */ public void setReencode(Reencode reencodeRef) { this.reencodeRef = reencodeRef; + } + + /** + * addLog envoie un message de log au module de log. + * @param message le message a ecrire dans le fichier log + */ + private void addLog(String message) { + String logToSend = new String( "Transition;" + this.numClient + ";" + message); + serverInit.log.writeLog(logToSend); } |