local.media
Class RtpStreamReceiver

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

public class RtpStreamReceiver
extends java.lang.Thread

RtpStreamReceiver is a generic stream receiver. It receives packets from RTP and writes them into an OutputStream.


Field Summary
static int BUFFER_SIZE
          Size of the read buffer
static boolean DEBUG
          Whether working in debug mode.
static int SO_TIMEOUT
          Maximum blocking time, spent waiting for reading new bytes [milliseconds]
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
RtpStreamReceiver(java.io.OutputStream output_stream, java.net.DatagramSocket socket)
          Constructs a RtpStreamReceiver.
RtpStreamReceiver(java.io.OutputStream output_stream, int local_port)
          Constructs a RtpStreamReceiver.
 
Method Summary
static int byte2int(byte b)
           
static int byte2int(byte b1, byte b2)
           
 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
 

Field Detail

DEBUG

public static boolean DEBUG
Whether working in debug mode.

BUFFER_SIZE

public static final int BUFFER_SIZE
Size of the read buffer

SO_TIMEOUT

public static final int SO_TIMEOUT
Maximum blocking time, spent waiting for reading new bytes [milliseconds]
Constructor Detail

RtpStreamReceiver

public RtpStreamReceiver(java.io.OutputStream output_stream,
                         int local_port)
Constructs a RtpStreamReceiver.
Parameters:
output_stream - the stream sink
local_port - the local receiver port

RtpStreamReceiver

public RtpStreamReceiver(java.io.OutputStream output_stream,
                         java.net.DatagramSocket socket)
Constructs a RtpStreamReceiver.
Parameters:
output_stream - the stream sink
socket - the local receiver DatagramSocket
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

byte2int

public static int byte2int(byte b)

byte2int

public static int byte2int(byte b1,
                           byte b2)