net.sf.fmj.media.multiplexer
Class StreamCopyPushDataSource

java.lang.Object
  extended by javax.media.protocol.DataSource
      extended by javax.media.protocol.PushDataSource
          extended by net.sf.fmj.media.multiplexer.StreamCopyPushDataSource
All Implemented Interfaces:
Controls, Duration

public class StreamCopyPushDataSource
extends PushDataSource

PushDataSource implemented by copying streams. By default, just copies the input streams to the output. Subclasses can override to modify the copy operation.

Author:
Ken Larson

Field Summary
 
Fields inherited from interface javax.media.Duration
DURATION_UNBOUNDED, DURATION_UNKNOWN
 
Constructor Summary
StreamCopyPushDataSource(ContentDescriptor outputContentDescriptor, int numTracks, java.io.InputStream[] inputStreams, Format[] inputFormats)
           
 
Method Summary
 void connect()
           
 void disconnect()
           
 java.lang.String getContentType()
           
 java.lang.Object getControl(java.lang.String controlType)
           
 java.lang.Object[] getControls()
           
 Time getDuration()
           
 PushSourceStream[] getStreams()
           
 void notifyDataAvailable(int track)
           
 void start()
           
 void stop()
           
 void waitUntilFinished()
           
protected  void write(java.io.InputStream in, java.io.OutputStream out, int track)
           
 
Methods inherited from class javax.media.protocol.DataSource
getLocator, initCheck, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamCopyPushDataSource

public StreamCopyPushDataSource(ContentDescriptor outputContentDescriptor,
                                int numTracks,
                                java.io.InputStream[] inputStreams,
                                Format[] inputFormats)
Method Detail

getStreams

public PushSourceStream[] getStreams()
Specified by:
getStreams in class PushDataSource

connect

public void connect()
             throws java.io.IOException
Specified by:
connect in class DataSource
Throws:
java.io.IOException

notifyDataAvailable

public void notifyDataAvailable(int track)

disconnect

public void disconnect()
Specified by:
disconnect in class DataSource

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in class DataSource

getControl

public java.lang.Object getControl(java.lang.String controlType)
Specified by:
getControl in interface Controls
Specified by:
getControl in class DataSource

getControls

public java.lang.Object[] getControls()
Specified by:
getControls in interface Controls
Specified by:
getControls in class DataSource

getDuration

public Time getDuration()
Specified by:
getDuration in interface Duration
Specified by:
getDuration in class DataSource

start

public void start()
           throws java.io.IOException
Specified by:
start in class DataSource
Throws:
java.io.IOException

stop

public void stop()
          throws java.io.IOException
Specified by:
stop in class DataSource
Throws:
java.io.IOException

waitUntilFinished

public void waitUntilFinished()
                       throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

write

protected void write(java.io.InputStream in,
                     java.io.OutputStream out,
                     int track)
              throws java.io.IOException
Throws:
java.io.IOException