1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 12:02:05 +01:00

[SMACK-223] - More Fixes

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@8217 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-05-08 21:29:43 +00:00 committed by thiago
parent 904379fd52
commit ac958c9971
2 changed files with 38 additions and 25 deletions

View file

@ -142,14 +142,18 @@ public class ScreenShareSession extends JingleMediaSession {
* Stops transmission and for NAT Traversal reasons stop receiving also.
*/
public void stopTrasmit() {
if(transmitter!=null){
transmitter.stop();
}
}
/**
* For NAT Reasons this method does nothing. Use startTransmit() to start transmit and receive jmf
*/
public void stopReceive() {
// Do nothing
if(receiver!=null){
receiver.stop();
}
}
/**

View file

@ -100,28 +100,34 @@ public class ImageTransmitter implements Runnable {
if (baos != null) {
Thread.sleep(1);
baos.write(i);
baos.write(j);
byte[] bytesOut = baos.toByteArray();
if (bytesOut.length > 1000)
System.err.println(bytesOut.length);
p.setData(bytesOut);
p.setAddress(remoteHost);
p.setPort(remotePort);
try {
socket.send(p);
}
catch (IOException e) {
e.printStackTrace();
}
tiles[i][j] = pixels;
Thread.sleep(1);
baos.write(i);
baos.write(j);
byte[] bytesOut = baos.toByteArray();
if (bytesOut.length > 1000)
System.err.println(bytesOut.length);
p.setData(bytesOut);
p.setAddress(remoteHost);
p.setPort(remotePort);
try {
socket.send(p);
}
catch (IOException e) {
e.printStackTrace();
}
tiles[i][j] = pixels;
}
catch (Exception e) {
}
}
@ -156,6 +162,7 @@ public class ImageTransmitter implements Runnable {
/**
* Set Transmit Enabled/Disabled
*
* @param transmit boolean Enabled/Disabled
*/
public void setTransmit(boolean transmit) {
@ -164,6 +171,7 @@ public class ImageTransmitter implements Runnable {
/**
* Get the encoder used to encode Images Tiles
*
* @return encoder
*/
public ImageEncoder getEncoder() {
@ -172,6 +180,7 @@ public class ImageTransmitter implements Runnable {
/**
* Set the encoder used to encode Image Tiles
*
* @param encoder encoder
*/
public void setEncoder(ImageEncoder encoder) {
@ -181,9 +190,9 @@ public class ImageTransmitter implements Runnable {
/**
* Stops Transmitter
*/
public void stop(){
this.transmit=false;
this.on=false;
public void stop() {
this.transmit = false;
this.on = false;
socket.close();
}
}