de.humatic.dsj.src
Class TSFileSource

java.lang.Object
  extended by de.humatic.dsj.src.Source
      extended by de.humatic.dsj.src.TSFileSource
All Implemented Interfaces:
MPEGSource

public class TSFileSource
extends Source
implements MPEGSource


Field Summary
 
Fields inherited from class de.humatic.dsj.src.Source
ASYNC, AUTO_GC, DIRECT, ES, FILTER_SETUP_ERROR, FLV, HTTP, HTTP_AUDIO, JAS, MJPG, MKV, MP4, PSNET, PULL, PUSH, RAW, RTMP, RTP, RTSP, SHOUTCAST, SS_CLOSED, SS_CONNECT, SS_CONNECTED, SS_DONE, SS_EOS, SS_FORMAT_READ, SS_RUNNING, SS_SEEKING, SS_SETUP, SS_STREAMS_READ, SS_TCP_ROLLOVER, TIMEOUT, TSFILE, TSNET, UNKNOWN
 
Fields inherited from interface de.humatic.dsj.util.MPEGSource
NO_AUDIO, RESOLVE
 
Constructor Summary
TSFileSource(java.lang.String path, MPEGProgram prg, int srcFlags, java.beans.PropertyChangeListener listener)
          Opens the transportstream file (m2t, ts) at path, playing the given program from a multiprogram stream..
TSFileSource(java.lang.String path, java.beans.PropertyChangeListener listener)
          Opens the transportstream file (m2t, ts, mts) at path, playing the first (or only) program found.
 
Method Summary
 void broadcast(java.lang.String baseIP, MPEGProgram[] prgs, int flags)
           
 void closeSource(boolean terminate)
          Closes down the source.
 DSGraph createGraph(DSGraph partialGraph)
           
 DSGraph createGraph(int graphFlags)
          Creates a DSGraph object with CompressedJavaSource filters that are fed from this source.
 DSGraph createGraph(int graphFlags, DSFilterInfo videoDecoder, DSFilterInfo audioDecoder)
          Creates a DSGraph object with CompressedJavaSource filters, fed from this source and the given video and audio decoders.
 DSMediaType[] getMediaTypes()
          Returns the media types created by this source.
 int getPMT_PID()
          Returns the PMT PID of the currently playing program.
 int[] getProgramPIDs()
          Returns the elementary stream PIDs of the currently playing program.
 MPEGProgram[] getPrograms()
          Returns an array of all programs seen in a stream.
 int getSourceTime()
           
 int[] getStreamTypes()
          Returns the elementary streamtypes of the currently playing program.
 byte[] read()
          When in PULL mode, the source filter calls this method to pull data from the source.
 void setSourceTime(int time)
          Repositions the source, application code should rather not use this method directly, but stick with DSFiltergraph methods.
 
Methods inherited from class de.humatic.dsj.src.Source
addSourceFilter, asyncRead, canSeek, createSourceFilter_async, createSourceFilter, getAvailable, getBuffered, getGraph, getID, getMaxTimeLoaded, getMinBufferTime, getNumChannels, getOffsetTime, getPath, getSourceDuration, getSourceFilter, getSourceFilters, getSourceFlags, getTransport, getType, isLive, notifyChannelFailure, queryParameter_int, sendEvent, setOffsetTime, setSourceRate, streamSeek, syncRead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TSFileSource

public TSFileSource(java.lang.String path,
                    java.beans.PropertyChangeListener listener)
             throws java.lang.Exception
Opens the transportstream file (m2t, ts, mts) at path, playing the first (or only) program found. Will also parse and play (Canon style) AVCHD playlists.

Throws:
java.lang.Exception

TSFileSource

public TSFileSource(java.lang.String path,
                    MPEGProgram prg,
                    int srcFlags,
                    java.beans.PropertyChangeListener listener)
             throws java.lang.Exception
Opens the transportstream file (m2t, ts) at path, playing the given program from a multiprogram stream..

Throws:
java.lang.Exception
Method Detail

createGraph

public DSGraph createGraph(int graphFlags)
Description copied from class: Source
Creates a DSGraph object with CompressedJavaSource filters that are fed from this source.

Overrides:
createGraph in class Source

createGraph

public DSGraph createGraph(int graphFlags,
                           DSFilterInfo videoDecoder,
                           DSFilterInfo audioDecoder)
Description copied from class: Source
Creates a DSGraph object with CompressedJavaSource filters, fed from this source and the given video and audio decoders. This is for special use cases where you know exactly what media formats to expect. Any decoder you do not want to specify may be null or DSFilterInfo.doNotRender(). Failure to put a given decoder into the graph will be announced via GRAPH_ERROR events and dsj will try to automatically pick an alternative (no exception will be thrown!).

Overrides:
createGraph in class Source

createGraph

public DSGraph createGraph(DSGraph partialGraph)

closeSource

public void closeSource(boolean terminate)
Description copied from class: Source
Closes down the source. When %terminate is true, all socket and stream resources etc. will also be freed. This method is called internally when disposing off the graph that was using this source and is not normally used by application code.

Overrides:
closeSource in class Source

getMediaTypes

public DSMediaType[] getMediaTypes()
Description copied from class: Source
Returns the media types created by this source. Depending on the time of calling, this method needs to be taken with care as during format negotiation mediatype information may not yet or only be partially available.

Overrides:
getMediaTypes in class Source

getPMT_PID

public int getPMT_PID()
Description copied from interface: MPEGSource
Returns the PMT PID of the currently playing program.

Specified by:
getPMT_PID in interface MPEGSource

getProgramPIDs

public int[] getProgramPIDs()
Description copied from interface: MPEGSource
Returns the elementary stream PIDs of the currently playing program.

Specified by:
getProgramPIDs in interface MPEGSource

getStreamTypes

public int[] getStreamTypes()
Description copied from interface: MPEGSource
Returns the elementary streamtypes of the currently playing program.

Specified by:
getStreamTypes in interface MPEGSource

getPrograms

public MPEGProgram[] getPrograms()
Description copied from interface: MPEGSource
Returns an array of all programs seen in a stream. This is primarily used with multi program broadcasts. Only the playing stream may have all fields set unless the source class has been instructed to uncover all stream PIDs and types.

Specified by:
getPrograms in interface MPEGSource

broadcast

public void broadcast(java.lang.String baseIP,
                      MPEGProgram[] prgs,
                      int flags)
               throws java.lang.Exception
Throws:
java.lang.Exception

read

public byte[] read()
Description copied from class: Source
When in PULL mode, the source filter calls this method to pull data from the source. This method is called by non-async sources, that read a fix number of bytes on every read. The byte[] is allocated by the source (usually allocated once and then reused).

Overrides:
read in class Source

setSourceTime

public void setSourceTime(int time)
Description copied from class: Source
Repositions the source, application code should rather not use this method directly, but stick with DSFiltergraph methods. The DSGraph created by a Source knows best when and how to interfere with the javaside data reading.

Overrides:
setSourceTime in class Source

getSourceTime

public int getSourceTime()
Overrides:
getSourceTime in class Source