Bonjour,
Je suis entraint de faire mon projet de fin d'etude intitulé vidéo surveillance mobile sous android , j'ai reussi à faire la visualisation de flux d'une caméra ip, mais la multi visualisation pas encore
voisi la méthode qui retourne les coordonnés (selon android) des caméras ip à visualiser
public ArrayList<Rect> destRect(int bmw, int bmh) {
int tempx;
int tempy;
MjpegView.SIZE_BEST_FIT ***/
if (displayMode == MjpegView.SIZE_BEST_FIT) {
float bmasp = (float) bmw / (float) bmh;
bmw = dispWidth;
bmh = (int) (dispWidth / bmasp);
if (bmh > dispHeight) {
bmh = dispHeight;
bmw = (int) (dispHeight * bmasp);
}
tempx = (dispWidth / 2) - (bmw / 2);
tempy = (dispHeight / 2) - (bmh / 2);
if (nbCamVisualiser ==1) {
ListCoordView.add( new Rect(tempx, tempy, bmw + tempx, bmh + tempy));
return ListCoordView;}
if (nbCamVisualiser ==2) {
ListCoordView.add(new Rect(tempx, tempy, (bmw/2) + tempx, bmh+ tempy));
ListCoordView.add(new Rect((bmw/2) + tempx,tempy, bmw + tempx, bmh+ tempy));
return ListCoordView;}
if (nbCamVisualiser ==4)
{ ListCoordView.add(new Rect(tempx, tempy, (bmw/2) + tempx, (bmh/2)+ tempy));
ListCoordView.add(new Rect((bmw/2) + tempx,tempy, bmw + tempx, bmh/2+ tempy));
ListCoordView.add(new Rect(tempx, tempy+(bmh/2) , (bmw/2) + tempx, tempy));
ListCoordView.add(new Rect((bmw/2) + tempx, tempy+(bmh/2) , bmw + tempx, tempy));
return ListCoordView;}
}
return null;
}
la méthode qui fait la visualisation de la caméra
public void ConnectCam(String IP,String PORT,int nbcam) {
String URL = "http://root:root@"+IP+":"+PORT+"/axis-cgi/" +"mjpg/video.cgi?resolution=640x480";
mmv= new MjpegMultiView(getBaseContext());
//Permét d'afficher l'objet multivisualisation//
setContentView(mmv);
// nbcam= ListHostCam.size() en principe
mmv.setDisplayNbCam(nbcam);
mmv.setSource(Mjpegsample.read(URL.trim())); //LA SOURCE DE MJPEG
mmv.setDisplayMode(MjpegMultiView.SIZE_BEST_FIT);
mmv.showFps(false);
affiche = true;
}
et la méthode de clique sur le boutton de visualisation