local.media
Class UdpStreamSender

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--local.media.UdpStreamSender
All Implemented Interfaces:
java.lang.Runnable

public class UdpStreamSender
extends java.lang.Thread

UdpStreamSender is a generic stream sender. It takes an InputStream and sends it through UDP.


Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UdpStreamSender(java.io.InputStream input_stream, boolean do_sync, long frame_rate, int frame_size, java.lang.String dest_addr, int dest_port)
          Constructs a UdpStreamSender.
UdpStreamSender(java.io.InputStream input_stream, boolean do_sync, long frame_rate, int frame_size, org.zoolu.net.UdpSocket src_socket, java.lang.String dest_addr, int dest_port)
          Constructs a UdpStreamSender.
 
Method Summary
 void halt()
          Stops running
 boolean isRunning()
          Whether is running
 void run()
          Runs it in a new Thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UdpStreamSender

public UdpStreamSender(java.io.InputStream input_stream,
                       boolean do_sync,
                       long frame_rate,
                       int frame_size,
                       java.lang.String dest_addr,
                       int dest_port)
Constructs a UdpStreamSender.
Parameters:
input_stream - the stream source
do_sync - whether time synchronization must be performed by the UdpStreamSender, or it is performed by the InputStream (e.g. the system audio input)
frame_rate - the frame rate, i.e. the number of frames that should be sent per second; it is used to calculate the nominal packet time and,in case of do_sync==true, the next departure time
frame_size - the size of the payload
dest_addr - the destination address
dest_port - the destination port

UdpStreamSender

public UdpStreamSender(java.io.InputStream input_stream,
                       boolean do_sync,
                       long frame_rate,
                       int frame_size,
                       org.zoolu.net.UdpSocket src_socket,
                       java.lang.String dest_addr,
                       int dest_port)
Constructs a UdpStreamSender.
Parameters:
input_stream - the stream to be sent
do_sync - whether time synchronization must be performed by the UdpStreamSender, or it is performed by the InputStream (e.g. the system audio input)
frame_rate - the frame rate, i.e. the number of frames that should be sent per second; it is used to calculate the nominal packet time and,in case of do_sync==true, the next departure time
frame_size - the size of the payload
src_socket - the socket used to send the UDP packet
dest_addr - the destination address
dest_port - the thestination port
Method Detail

isRunning

public boolean isRunning()
Whether is running

halt

public void halt()
Stops running

run

public void run()
Runs it in a new Thread.
Overrides:
run in class java.lang.Thread