We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
.net applet ? (Read 519 times)
.net applet ?
Mar 17th, 2009, 5:42pm
 
Hi, i want to put my webcam on a website, but applet client doesn't work.
Serveur work on my local machine, client work when i export application but client doesn't work on website with applet export ( i have a white square ), so why ?

code serveur :

import processing.net.*;
import processing.video.*;
Server myServer;
Capture cam;

int H=200;
int numpix;
int[] Prvblist = new int[H*H*3];
byte[] pixelS = new byte[40000];

void setup(){
frameRate(5);
size(H,H);
cam = new Capture(this,width,height,24);
myServer = new Server(this,5204);
numpix = cam.width * cam.height;
loadPixels();
}

void draw(){
cam.read();
cam.loadPixels();
for(int i=0;i<numpix;i++){ // i separe r/v/b, for byte send.
pixels[i] = cam.pixels[i];
Prvblist[i*3] = int(red(cam.pixels[i]));
Prvblist[i*3+1] = int(green(cam.pixels[i]));
Prvblist[i*3+2] = int(blue(cam.pixels[i]));
}
pixelS = byte(Prvblist);
myServer.write(pixelS);
updatePixels();
}


code client:

import processing.net.*;
Client myClient;

byte[] byteBuffer = new byte[40000*3];
int[] IbyteBuffer = new int[40000*3];

void setup(){
frameRate(5);
size(200,200);
loadPixels();
myClient = new Client(this,"192.168.1.20",5204);//local address for test
}

void draw(){

if(myClient.available() > 40000*3){
int byteCount = myClient.readBytes(byteBuffer);
if(byteCount >= 40000*3){
IbyteBuffer = int(byteBuffer);
for(int i=0;i<40000;i++){
pixels[i] = color(IbyteBuffer[i*3],IbyteBuffer[i*3+1],IbyteBuffer[i*3+2]);
byteBuffer[i] = 0;
}
updatePixels();
}

}
}

+ : - i have opened port 5204 on my routeur.
    - i have windows xp, i test on I.E. and Firefox.
    - i use processing 1.0.3

maybe sorry for my english, and pls help me lol.
Re: .net applet ?
Reply #1 - Mar 17th, 2009, 9:34pm
 
Usual answer: you must sign your applet.
Re: .net applet ?
Reply #2 - Mar 17th, 2009, 10:23pm
 
thx
Page Index Toggle Pages: 1