# HG changeset patch # User nikita@nikita-laptop # Date 1264279738 -3600 # Node ID f5a5d9237d69f0b865899064cfa361547394a9bd # Parent e7fb2538ac5cf94be69b0880f808dcef20083ae4 remove some unused files diff -r e7fb2538ac5c -r f5a5d9237d69 .classpath --- a/.classpath Sat Jan 23 13:42:20 2010 +0100 +++ b/.classpath Sat Jan 23 21:48:58 2010 +0100 @@ -1,14 +1,13 @@ - + - - + diff -r e7fb2538ac5c -r f5a5d9237d69 src/com/beem/project/beem/jingle/JingleService.java --- a/src/com/beem/project/beem/jingle/JingleService.java Sat Jan 23 13:42:20 2010 +0100 +++ b/src/com/beem/project/beem/jingle/JingleService.java Sat Jan 23 21:48:58 2010 +0100 @@ -146,6 +146,7 @@ public void acceptCall() throws RemoteException { try { mRequest.accept(); + mIn.start(); } catch (XMPPException e) { e.printStackTrace(); } @@ -160,7 +161,7 @@ if (isCaller) { try { mOut.terminate("Cancelled"); - //mOut.close(); + mOut.close(); } catch (XMPPException e) { e.printStackTrace(); } diff -r e7fb2538ac5c -r f5a5d9237d69 src/com/beem/project/beem/jingle/MicrophoneRTPSession.java --- a/src/com/beem/project/beem/jingle/MicrophoneRTPSession.java Sat Jan 23 13:42:20 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* - BEEM is a videoconference application on the Android Platform. - - Copyright (C) 2009 by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - This file is part of BEEM. - - BEEM is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - BEEM is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with BEEM. If not, see . - - Please send bug reports with examples or suggestions to - contact@beem-project.com or http://dev.beem-project.com/ - - Epitech, hereby disclaims all copyright interest in the program "Beem" - written by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - Nicolas Sadirac, November 26, 2009 - President of Epitech. - - Flavien Astraud, November 26, 2009 - Head of the EIP Laboratory. - -*/ -package com.beem.project.beem.jingle; - -import org.jivesoftware.smackx.jingle.JingleSession; -import org.jivesoftware.smackx.jingle.media.JingleMediaSession; -import org.jivesoftware.smackx.jingle.media.PayloadType; -import org.jivesoftware.smackx.jingle.nat.TransportCandidate; - -// TODO: Auto-generated Javadoc -/** - * Manage microphone RTP session. - * @author nikita - */ -public class MicrophoneRTPSession extends JingleMediaSession { - - private RTPTransmitter mTransmitter; - private RTPReceiver mReceiver; - - /** - * constructor. - * @param payloadType the payload typ used - * @param remote the remote transport info - * @param local the local tranport info - * @param mediaLocator don't know - * @param jingleSession the current jingle session - */ - public MicrophoneRTPSession(final PayloadType payloadType, final TransportCandidate remote, - final TransportCandidate local, final String mediaLocator, final JingleSession jingleSession) { - super(payloadType, remote, local, mediaLocator, jingleSession); - - // TODO le transmitter ne devrait peut etre pas etre init ici, c'est - // peut etre encore un peu tot, a voir. - mTransmitter = new PCMTransmitter(remote.getIp(), getRemote().getPort()); - // mReceiver = new MicroRTPReceiver(getLocal().getPort()); - } - - /* (non-Javadoc) - * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#initialize() - */ - @Override - public void initialize() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#setTrasmit(boolean) - */ - @Override - public void setTrasmit(boolean active) { - } - - /* (non-Javadoc) - * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#startReceive() - */ - @Override - public void startReceive() { - - } - - /* (non-Javadoc) - * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#startTrasmit() - */ - @Override - public void startTrasmit() { - - } - - /* (non-Javadoc) - * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#stopReceive() - */ - @Override - public void stopReceive() { - if (mReceiver != null) { - mReceiver.stop(); - } - } - - /* (non-Javadoc) - * @see org.jivesoftware.smackx.jingle.media.JingleMediaSession#stopTrasmit() - */ - @Override - public void stopTrasmit() { - if (mTransmitter != null) { - mTransmitter.stop(); - } - } -} diff -r e7fb2538ac5c -r f5a5d9237d69 src/com/beem/project/beem/jingle/PCMTransmitter.java --- a/src/com/beem/project/beem/jingle/PCMTransmitter.java Sat Jan 23 13:42:20 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* - BEEM is a videoconference application on the Android Platform. - - Copyright (C) 2009 by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - This file is part of BEEM. - - BEEM is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - BEEM is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with BEEM. If not, see . - - Please send bug reports with examples or suggestions to - contact@beem-project.com or http://dev.beem-project.com/ - - Epitech, hereby disclaims all copyright interest in the program "Beem" - written by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - Nicolas Sadirac, November 26, 2009 - President of Epitech. - - Flavien Astraud, November 26, 2009 - Head of the EIP Laboratory. - -*/ -package com.beem.project.beem.jingle; - -import android.media.AudioFormat; -import android.media.AudioRecord; -import android.media.MediaRecorder; - -// TODO: Auto-generated Javadoc -/** - * Transmit Microphone data through RTP. - * @author nikita - */ -public class PCMTransmitter extends RTPTransmitter { - - private static final int BUFF_SIZE = 1024; - private static final int RATE_IN_HZ = 8000; - private static final int SLP_DURATION = 200; - - /** - * Constructor. - * @param remoteIP receiver IP. - * @param remotePort receiver port. - */ - public PCMTransmitter(final String remoteIP, final int remotePort) { - super(remoteIP, remotePort); - } - - /* (non-Javadoc) - * @see com.beem.project.beem.jingle.RTPTransmitter#start() - */ - @Override - void start() { - AudioRecord audRec = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, RATE_IN_HZ, - AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, AudioRecord.getMinBufferSize( - RATE_IN_HZ, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT) * 4); - byte[] audioData = new byte[BUFF_SIZE]; - int byteReaded = 0; - while (!isKillme()) { - byteReaded = audRec.read(audioData, byteReaded, BUFF_SIZE); - System.out.println("readed " + byteReaded); - getRtpSession().sendData(audioData); - } - try { - Thread.sleep(SLP_DURATION); - } catch (InterruptedException e) { - e.printStackTrace(); - } - this.getRtpSession().endSession(); - } -} diff -r e7fb2538ac5c -r f5a5d9237d69 src/com/beem/project/beem/jingle/RTPReceiver.java --- a/src/com/beem/project/beem/jingle/RTPReceiver.java Sat Jan 23 13:42:20 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* - BEEM is a videoconference application on the Android Platform. - - Copyright (C) 2009 by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - This file is part of BEEM. - - BEEM is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - BEEM is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with BEEM. If not, see . - - Please send bug reports with examples or suggestions to - contact@beem-project.com or http://dev.beem-project.com/ - - Epitech, hereby disclaims all copyright interest in the program "Beem" - written by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - Nicolas Sadirac, November 26, 2009 - President of Epitech. - - Flavien Astraud, November 26, 2009 - Head of the EIP Laboratory. - -*/ -package com.beem.project.beem.jingle; - -import java.net.DatagramSocket; -import java.net.SocketException; - -import jlibrtp.Participant; -import jlibrtp.RTPAppIntf; -import jlibrtp.RTPSession; - -// TODO: Auto-generated Javadoc -/** - * abstract RTP receiver class. - * @author nikita - */ -public abstract class RTPReceiver implements Runnable, RTPAppIntf { - - private boolean mKillme; - private RTPSession mRtpSession; - - /** - * constructor. - * @param rtpPort local or distant?. - */ - public RTPReceiver(final int rtpPort) { - DatagramSocket rtpSocket = null; - - try { - rtpSocket = new DatagramSocket(rtpPort); - } catch (SocketException e) { - e.printStackTrace(); - return; - } - mRtpSession = new RTPSession(rtpSocket, null); - mRtpSession.naivePktReception(true); - mRtpSession.RTPSessionRegister(this, null, null); - } - - /* (non-Javadoc) - * @see org.jlibrtp.jlibrtp.RTPAppIntf#frameSize(int) - */ - @Override - public int frameSize(int payloadType) { - return 1; - } - - /* (non-Javadoc) - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - start(); - this.mRtpSession.endSession(); - } - - /** - * main reception loop. - */ - protected abstract void start(); - - /** - * Stop the reception. - */ - public void stop() { - this.setKillme(true); - } - - /* (non-Javadoc) - * @see org.jlibrtp.jlibrtp.RTPAppIntf#userEvent(int, org.jlibrtp.jlibrtp.Participant[]) - */ - @Override - public void userEvent(int arg0, Participant[] arg1) { - // TODO Auto-generated method stub - } - - /** - * mKillme setter. - * @param killme the mKillme to set - */ - public void setKillme(final boolean killme) { - this.mKillme = killme; - } - - /** - * mKillme getter. - * @return the mKillme - */ - public boolean isKillme() { - return mKillme; - } -} diff -r e7fb2538ac5c -r f5a5d9237d69 src/com/beem/project/beem/jingle/RTPTransmitter.java --- a/src/com/beem/project/beem/jingle/RTPTransmitter.java Sat Jan 23 13:42:20 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* - BEEM is a videoconference application on the Android Platform. - - Copyright (C) 2009 by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - This file is part of BEEM. - - BEEM is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - BEEM is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with BEEM. If not, see . - - Please send bug reports with examples or suggestions to - contact@beem-project.com or http://dev.beem-project.com/ - - Epitech, hereby disclaims all copyright interest in the program "Beem" - written by Frederic-Charles Barthelery, - Jean-Manuel Da Silva, - Nikita Kozlov, - Philippe Lago, - Jean Baptiste Vergely, - Vincent Veronis. - - Nicolas Sadirac, November 26, 2009 - President of Epitech. - - Flavien Astraud, November 26, 2009 - Head of the EIP Laboratory. - -*/ -package com.beem.project.beem.jingle; - -import java.net.DatagramSocket; -import java.net.SocketException; - -import jlibrtp.DataFrame; -import jlibrtp.Participant; -import jlibrtp.RTPAppIntf; -import jlibrtp.RTPSession; - -import com.beem.project.beem.utils.FreePort; - -// TODO: Auto-generated Javadoc -/** - * abstract RTP transmitter class. - * @author nikita - */ -public abstract class RTPTransmitter implements Runnable, RTPAppIntf { - /** - * RTPSession instance. - */ - private RTPSession mRtpSession; - /** - * process status manipulation. - */ - private boolean mKillme; - - /** - * constructor. - * @param remoteIP receiver IP. - * @param remotePort receiver port. - */ - public RTPTransmitter(final String remoteIP, final int remotePort) { - DatagramSocket rtpSocket = null; - int rtpPort = 0; - - try { - rtpPort = FreePort.getFreePort(); - rtpSocket = new DatagramSocket(rtpPort); - } catch (SocketException e) { - e.printStackTrace(); - return; - } - setRtpSession(new RTPSession(rtpSocket, null)); - getRtpSession().naivePktReception(true); - getRtpSession().RTPSessionRegister(this, null, null); - getRtpSession().addParticipant(new Participant(remoteIP, remotePort, 0)); - } - - /* (non-Javadoc) - * @see org.jlibrtp.jlibrtp.RTPAppIntf#frameSize(int) - */ - @Override - public int frameSize(int payloadType) { - return 1; - } - - /* (non-Javadoc) - * @see org.jlibrtp.jlibrtp.RTPAppIntf#receiveData(org.jlibrtp.jlibrtp.DataFrame, org.jlibrtp.jlibrtp.Participant) - */ - @Override - public void receiveData(DataFrame frame, Participant participant) { - // On envoie uniquement - } - - /* (non-Javadoc) - * @see java.lang.Runnable#run() - */ - @Override - public void run() { - start(); - } - - /** - * A implementer pour chaque type d'envoi specifique. - */ - abstract void start(); - - /** - * Stop the transmission. - */ - public void stop() { - mKillme = true; - } - - /* (non-Javadoc) - * @see org.jlibrtp.jlibrtp.RTPAppIntf#userEvent(int, org.jlibrtp.jlibrtp.Participant[]) - */ - @Override - public void userEvent(int type, Participant[] participant) { - // je sais pas ce que c'est - - } - - /** - * mKillme setter. - * @param killme the mKillme to set - */ - public void setKillme(final boolean killme) { - this.mKillme = killme; - } - - /** - * mKillme getter. - * @return the mKillme. - */ - public boolean isKillme() { - return mKillme; - } - - /** - * mRtpSession setter. - * @param rtpSession the mRtpSession to set. - */ - public void setRtpSession(RTPSession rtpSession) { - this.mRtpSession = rtpSession; - } - - /** - * mRtpSession getter. - * @return the mRtpSession - */ - public RTPSession getRtpSession() { - return mRtpSession; - } - -} diff -r e7fb2538ac5c -r f5a5d9237d69 src/com/beem/project/beem/ui/Call.java --- a/src/com/beem/project/beem/ui/Call.java Sat Jan 23 13:42:20 2010 +0100 +++ b/src/com/beem/project/beem/ui/Call.java Sat Jan 23 21:48:58 2010 +0100 @@ -206,7 +206,6 @@ public void sessionClosed(final String reason) { android.util.Log.d("TEST", "TEST " + reason); mHandler.post(new RunnableChange(reason)); - Call.this.runOnUiThread(new RunnableChange(reason)); } @Override @@ -224,7 +223,7 @@ @Override public void sessionEstablished() { android.util.Log.d("TEST", "TEST2 "); - mCallInfo.setText("established"); + //mCallInfo.setText("established"); mHandler.post(new RunnableChange("ok")); }