09.02.2013 Views

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 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

96<br />

}<br />

}<br />

<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 />

<strong>lo</strong>ng prima = System.currentTimeMillis();<br />

mgr.addTarget(destAddr); // dati del proxy<br />

<strong>lo</strong>ng dopo = System.currentTimeMillis();<br />

Log.d("RPCclient *274*","Tempo impiegato <strong>per</strong><br />

addTarget(proxy) = " + (dopo - prima));<br />

} catch (Exception e) {<br />

Log.d("RPCClient *277*","generata eccezione "+e);<br />

System.exit(-1);<br />

}<br />

protected void onStart() {<br />

su<strong>per</strong>.onStart();<br />

}<br />

running = true;<br />

//Semaforo<br />

Object dataSync = new Object();<br />

Log.d("RPCclient *290*","bufferizerTax.RPCclient.run(): inizio<br />

ricezione dati");<br />

try {<br />

synchronized (dataSync) { // qui si ferma!<br />

while (go) {<br />

dataSync.wait(10000); // aspetta max 10 secon<strong>di</strong><br />

}// while<br />

}// synchronized<br />

} catch (InterruptedException e) {<br />

Log.d("RPCclient *300*","Generata eccezione " + e);<br />

}// catch<br />

Log.d("RPCclient *302*","receiveData(): termine ricezione dati");<br />

public void update(ReceiveStreamEvent evt) {<br />

Log.d("RPCclient *340*",".update(): ricevuto evento " +<br />

evt.getClass().getName());<br />

if (evt instanceof StreamMappedEvent) { // gestione dell'evento<br />

// StreamMappedEvent<br />

try {<br />

Log.d("RPCclient *345*",".update(): identificato uno<br />

stream dal mittente " + ((StreamMappedEvent)<br />

evt).getParticipant().getCNAME());<br />

Log.d("RPCclient *351*",".update(): il buffer e' gia'<br />

attivo? " + queueAlreadyActive);<br />

if (participant == null) {<br />

Log.d("RPCclient *354*","participant non ancora<br />

identificato ");

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!