|
From: <si...@us...> - 2003-03-14 11:38:50
|
Update of /cvsroot/madsserv/madsserv/src/server/adaptability
In directory sc8-pr-cvs1:/tmp/cvs-serv21522
Modified Files:
GestionAdapta.java
Log Message:
Index: GestionAdapta.java
===================================================================
RCS file: /cvsroot/madsserv/madsserv/src/server/adaptability/GestionAdapta.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GestionAdapta.java 12 Mar 2003 23:09:31 -0000 1.2
--- GestionAdapta.java 14 Mar 2003 11:38:47 -0000 1.3
***************
*** 15,20 ****
! (*) les arguments sont dans l'ordre: encodage, frame rate, quality level (de 0 � 100)
! (**) les argmunents sont dans l'ordre: encodage, sample rate, nombre de bit, channel (=monon ou st�r�o)
*/
--- 15,20 ----
! (*) les arguments sont dans l'ordre: encodage, frame rate, quality level (de 0 a 100)
! (**) les argmunents sont dans l'ordre: encodage, sample rate, nombre de bit, channel (=mono ou stereo)
*/
***************
*** 26,30 ****
import javax.media.format.VideoFormat.*;
import javax.media.format.AudioFormat.*;
! import javax.media.format.JPEGFormat.*;
import java.lang.*;
import java.awt.*;
--- 26,30 ----
import javax.media.format.VideoFormat.*;
import javax.media.format.AudioFormat.*;
! import javax.media.format.JPEGFormat;
import java.lang.*;
import java.awt.*;
***************
*** 34,38 ****
/****************************************************/
! /******* D�finition de la classe GestionAdapt *******/
/****************************************************/
--- 34,38 ----
/****************************************************/
! /******* Definition de la classe GestionAdapt *******/
/****************************************************/
***************
*** 40,46 ****
/***************************************************************/
! /* S�lectionne le bon format Audio en fct du niveau de qualit� */
/***************************************************************/
!
public static AudioFormat getAudioStreamingFormat(int nivQualite, AudioFormat f) {
String formatOriginal;
--- 40,46 ----
/***************************************************************/
! /* Selectionne le bon format Audio en fct du niveau de qualite */
/***************************************************************/
!
public static AudioFormat getAudioStreamingFormat(int nivQualite, AudioFormat f) {
String formatOriginal;
***************
*** 59,85 ****
/***************************************************************/
! /* S�lectionne le bon format Vid�o en fct du niveau de qualit� */
/***************************************************************/
! public static VideoFormat getVideoStreamingFormat(int nivQualite, VideoFormat f) {
! String formatOriginal;
! VideoFormat newVideoFormat;
/*********************************************************/
! /* Cr�ation du nouveau format selon le nuveau de qualit� */
/*********************************************************/
!
switch(nivQualite) {
! case 1: newVideoFormat = new JPEGFormat(f.getSize(),f.getMaxDataLength(),f.getDataType(),25,100,getDecimation());
! case 2: newVideoFormat = new JPEGFormat(f.getSize(),f.getMaxDataLength(),f.getDataType(),12,100,getDecimation());
! case 3: newVideoFormat = new JPEGFormat(f.getSize(),f.getMaxDataLength(),f.getDataType(),12,50,getDecimation());
! case 4: newVideoFormat = new JPEGFormat(f.getSize(),f.getMaxDataLength(),f.getDataType(),12,0,getDecimation());
! case 5: newVideoFormat = NULL;
! case 6: newVideoFormat = NULL;
! }
! if (newVideoFormat != NULL)
! newVideoFormat.setEncoding = "JPG_RTP"; // pour permettre le transfert via RTP
/**************************************/
--- 59,88 ----
/***************************************************************/
! /* Selectionne le bon format Video en fct du niveau de qualite */
/***************************************************************/
! public static VideoFormat getVideoStreamingFormat(int nivQualite, JPEGFormat f) {
! float fFR = 0,nFR = 0;
! int fq = 0,nq = 0;
!
! JPEGFormat newVideoFormat;
/*********************************************************/
! /* Creation du nouveau format selon le nuveau de qualite */
/*********************************************************/
!
! // on recupere les donnees utiles du format.
! fFR = f.getFrameRate();
! fq = f.getQFactor();
switch(nivQualite) {
! case 1: nFR = 25; nq = 100;
! case 2: nFR = 12; nq = 100;
! case 3: nFR = 12; nq = 50;
! case 4: nFR = 12; nq = 0;
! case 5: nFR = 0; nq = 0;
! case 6: nFR = 0; nq = 0;
! }
/**************************************/
***************
*** 87,104 ****
/**************************************/
! if (newVideoFormat != NULL) {
! newVideoFormat = takeMin(newVideoFormat.getFrameRate(),f.getFrameRate());
! newVideoFormat = takeMin(newVideoFormat.getQFactor(),f.getQFactor());
! }
! }
- /****************************************************/
- /* impl�mentation de la fonction min(int a, int b); */
- /****************************************************/
! int takeMin(int a, int b) {
return(a>b?b:a);
}
! }
\ No newline at end of file
--- 90,118 ----
/**************************************/
! nFR = takeMin(nFR, fFR);
! nq = takeMin(nq, fq);
! if (nFR == 0 && nq == 0)
! newVideoFormat = null;
! else
! newVideoFormat = new JPEGFormat(f.getSize(),f.getMaxDataLength(),f.getDataType(),nFR,nq,f.getDecimation());
+ return newVideoFormat;
+ }
+
+
+
! /***************************************************************************/
! /* implementation de la fonction min(int a, int b); et min(float a,float b)*/
! /***************************************************************************/
!
! static int takeMin(int a, int b) {
return(a>b?b:a);
}
!
! static float takeMin(float a,float b) {
! return(a>b?b:a);
! }
! }
|