local.media
Class RtpStreamSender

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

public class RtpStreamSender
extends java.lang.Thread

RtpStreamSender is a generic stream sender. It takes an InputStream and sends it through RTP.


Field Summary
static boolean DEBUG
          Whether working in debug mode.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RtpStreamSender(java.io.InputStream input_stream, boolean do_sync, int payload_type, long frame_rate, int frame_size, java.net.DatagramSocket src_socket, java.lang.String dest_addr, int dest_port)
          Constructs a RtpStreamSender.
RtpStreamSender(java.io.InputStream input_stream, boolean do_sync, int payload_type, long frame_rate, int frame_size, java.lang.String dest_addr, int dest_port)
          Constructs a RtpStreamSender.
 
Method Summary
 void halt()
          Stops running
 boolean isRunning()
          Whether is running
 void run()
          Runs it in a new Thread.
 void setSyncAdj(int millisecs)
          Sets the synchronization adjustment time (in milliseconds).
 
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
 

Field Detail

DEBUG

public static boolean DEBUG
Whether working in debug mode.
Constructor Detail

RtpStreamSender

public RtpStreamSender(java.io.InputStream input_stream,
                       boolean do_sync,
                       int payload_type,
                       long frame_rate,
                       int frame_size,
                       java.lang.String dest_addr,
                       int dest_port)
Constructs a RtpStreamSender.
Parameters:
input_stream - the stream source
do_sync - whether time synchronization must be performed by the RtpStreamSender, or it is performed by the InputStream (e.g. the system audio input)
payload_type - the payload type
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

RtpStreamSender

public RtpStreamSender(java.io.InputStream input_stream,
                       boolean do_sync,
                       int payload_type,
                       long frame_rate,
                       int frame_size,
                       java.net.DatagramSocket src_socket,
                       java.lang.String dest_addr,
                       int dest_port)
Constructs a RtpStreamSender.
Parameters:
input_stream - the stream to be sent
do_sync - whether time synchronization must be performed by the RtpStreamSender, or it is performed by the InputStream (e.g. the system audio input)
payload_type - the payload type
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 RTP packet
dest_addr - the destination address
dest_port - the thestination port
Method Detail

setSyncAdj

public void setSyncAdj(int millisecs)
Sets the synchronization adjustment time (in milliseconds).

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