Sviluppo di una piattaforma per lo streaming multimediale - MobiLab ...
Sviluppo di una piattaforma per lo streaming multimediale - MobiLab ...
Sviluppo di una piattaforma per lo streaming multimediale - MobiLab ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Sviluppo</strong> <strong>di</strong> <strong>una</strong> <strong>piattaforma</strong> <strong>per</strong> <strong>lo</strong> <strong>streaming</strong> multime<strong>di</strong>ale in ambiente Android<br />
* Se vero in<strong>di</strong>ca che la coda e' gia' stata attivata. Serve <strong>per</strong> evitare la<br />
* re-inizializzazione della coda in caso <strong>di</strong> handoff con piu' ricevitori<br />
* <strong>lo</strong>cali<br />
private boolean queueAlreadyActive = false;<br />
private Observer observer;<br />
private QueableCircularBuffer singleBuffer;<br />
private String[] sessions = null;<br />
private String data = new String();<br />
* Porta del client, utile so<strong>lo</strong> <strong>per</strong> la simulazione, se si è in reale bisogna far<br />
* riconoscere gli endpoint intervenendo sulla socket (getRemoteAddress etc etc)<br />
private static int Client_PORT = 10001;<br />
public void onCreate(Bundle savedInstanceState) {<br />
su<strong>per</strong>.onCreate(savedInstanceState);<br />
/*RECUPERO DEI DATI PASSATI DALLA MAINACTIVITY*/<br />
Bundle extras = getIntent().getExtras();<br />
sessions = extras.getStringArray(mainActivity.VALORE_1);<br />
data = extras.getString(mainActivity.VALORE_2);<br />
for (int i = 0; i < sessions.length; i++) {<br />
if (i%2==0) {<br />
Log.d("RCPclient *228*", "L'ip associato :" + sessions[i] +<br />
", il file richiesto è " + data + ", la porta su cui è<br />
in ascolto il client è "+ Client_PORT);<br />
}<br />
running = false;<br />
// this.queue = queue;<br />
this.timeToWait = 10;<br />
this.<strong>lo</strong>gger = new Logger("testLog.txt");<br />
// this.queueAlreadyActive = queableBufferAlreadyActive;<br />
this.queueAlreadyActive = false;<br />
this.observer = new Stampante("test.txt");<br />
this.singleBuffer = new QueableCircularBuffer(this.observer,<br />
100, this.timeToWait);<br />
interfaceType = WirelessInterface.LOOPBACK_NETWORK_INTERFACE;<br />
go = true;<br />
try {<br />
//Sincronizzazione con il trasmettitore<br />
sincronize("192.168.1.10", 10000, data);<br />
// inizializzazione dati <strong>di</strong> sessione<br />
SessionAddress <strong>lo</strong>calAddr = new SessionAddress(<br />
InetAddress.getByName("10.0.2.15"),<br />
10001); // dati <strong>lo</strong>cali client<br />
SessionAddress destAddr = new SessionAddress(<br />
InetAddress.getByName("192.168.1.10"),<br />
10001); // dati mittente<br />
mgr = RTPManager.newInstance();<br />
mgr.addReceiveStreamListener(this);<br />
mgr.initialize(<strong>lo</strong>calAddr);<br />
95