org.dvb.dsmcc
Class DSMCCStream

java.lang.Object
  extended byorg.dvb.dsmcc.DSMCCStream
Direct Known Subclasses:
DSMCCStreamEvent

public class DSMCCStream
extends java.lang.Object

The DSMCCStream class is used to manage DSMCC Stream Objects. The BIOP::Stream message shall be read from the network once only, before the constructor of this class returns. Hence methods which return information from that message shall not be affected by any subsequent changes to that information.

NOTE: The NPT mechanism and scheduled stream events that depend on it are known to be vulnerable to disruption in many digital TV distribution networks. Existing deployed network equipment that re-generates the STC is unlikely to be aware of NPT and hence will not make the necessary corresponding modification to STC values inside NPT reference descriptors. Applications should only use NPT where they are confident that the network where they are to be used does not have this problem.

See Also:
DSMCCObject

Constructor Summary
DSMCCStream(DSMCCObject aDSMCCObject)
          Creates a Stream Object from a DSMCC Object.
DSMCCStream(java.lang.String path)
          Create a Stream Object from its pathname.
DSMCCStream(java.lang.String path, java.lang.String name)
          Create a DSMCCStream from its pathname.
 
Method Summary
 void addNPTListener(NPTListener l)
          Add a listener to NPT events on the DSMCCStream object.
 long getDuration()
          This function returns the duration in milliseconds of the DSMCC Stream.
 long getNPT()
          This function is used to get the current NPT in milliseconds.
 NPTRate getNPTRate()
          Get the NPT rate for the DSMCCStream object.
 Locator getStreamLocator()
          This function returned a Locator referencing the streams of this collection.
 boolean isAudio()
          This function returns a boolean indicating if the Stream Object refers to an audio stream.
 boolean isData()
          This function returns a boolean indicating if the Stream Object refers to a data stream.
 boolean isMPEGProgram()
          This method will return true if the Stream(Event) BIOP message contains a tap with use field BIOP_PROGRAM_USE, otherwise it will return false.
 boolean isVideo()
          This function returns a boolean indicating if the Stream Object refers to an video stream.
 void removeNPTListener(NPTListener l)
          Remove a listener to NPT events on the DSMCCStream object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSMCCStream

public DSMCCStream(DSMCCObject aDSMCCObject)
            throws NotLoadedException,
                   IllegalObjectTypeException
Creates a Stream Object from a DSMCC Object. The BIOP message referenced by the DSMCCObject has to be a Stream or StreamEvent BIOP message.

Parameters:
aDSMCCObject - the DSMCC object which describes the stream
Throws:
NotLoadedException - the DSMCCObject is not loaded.
IllegalObjectTypeException - the DSMCCObject is neither a DSMCC Stream nor a DSMCCStreamEvent

DSMCCStream

public DSMCCStream(java.lang.String path)
            throws java.io.IOException,
                   IllegalObjectTypeException
Create a Stream Object from its pathname. For an object Carousel, this method will block until the module which contains the object is loaded. The BIOP message referenced by the DSMCCObject pointed to by the parameter path has to be a Stream or StreamEvent BIOP message.

Parameters:
path - the pathname of the DSMCCStream Object.
Throws:
java.io.IOException - If an IO error occurred.
IllegalObjectTypeException - the DSMCCObject is neither a DSMCC Stream nor a DSMCCStreamEvent

DSMCCStream

public DSMCCStream(java.lang.String path,
                   java.lang.String name)
            throws java.io.IOException,
                   IllegalObjectTypeException
Create a DSMCCStream from its pathname. For an object Carousel, this method will block until the module which contains the object is loaded. The BIOP message referenced by the DSMCCObject pointed to be the parameters path and name has to be a Stream or StreamEvent BIOP message.

Parameters:
path - the directory path.
name - the name of the DSMCCStream Object.
Throws:
java.io.IOException - If an IO error occurred.
IllegalObjectTypeException - the DSMCCObject is neither a DSMCC Stream nor a DSMCCStreamEvent
Method Detail

getDuration

public long getDuration()
This function returns the duration in milliseconds of the DSMCC Stream. If the DSMCCStream BIOP message does not specify duration, zero will be returned.

Returns:
The duration in milliseconds of the DSMCC Stream.

getNPT

public long getNPT()
            throws MPEGDeliveryException
This function is used to get the current NPT in milliseconds. Implementations are not required to continuously monitor for NPT. In implementations which do not continuously monitor, this method will block while the current NPT is retrieved from the stream.

Returns:
the current NPT in milliseconds or zero if DSMCC Stream object BIOP message does not contain any taps pointing to NPT reference descriptors.
Throws:
MPEGDeliveryException - if there is an error in retrieving NPT reference descriptors

getStreamLocator

public Locator getStreamLocator()
This function returned a Locator referencing the streams of this collection. The interpretation of the return value is determined by the isMPEGProgram method.

Returns:
a locator.

isMPEGProgram

public boolean isMPEGProgram()
This method will return true if the Stream(Event) BIOP message contains a tap with use field BIOP_PROGRAM_USE, otherwise it will return false.

Returns:
true only if the Stream(Event) BIOP message is as described above

isAudio

public boolean isAudio()
This function returns a boolean indicating if the Stream Object refers to an audio stream. This is the case if the audio field in the Stream(Event) BIOP message has a value different from zero.

Returns:
true only if the Stream object refers to an audio stream

isVideo

public boolean isVideo()
This function returns a boolean indicating if the Stream Object refers to an video stream. This is the case if the `video' field in the Stream(Event) BIOP message has a value different from zero otherwise false is returned.

Returns:
true only if the Stream object refers to an video stream

isData

public boolean isData()
This function returns a boolean indicating if the Stream Object refers to a data stream. This is the case if the data field in the Stream(Event) BIOP message has a value different from zero.

Returns:
true only if the Stream object refers to a data stream

getNPTRate

public NPTRate getNPTRate()
                   throws MPEGDeliveryException
Get the NPT rate for the DSMCCStream object. Returns null if the DSMCC stream has no associated NPT rate (i.e. no STR_NPT_USE tap in the list of taps).

Returns:
the NPT rate or null
Throws:
throws - MPEGDeliveryException if there is an error in retrieving NPT reference descriptors
MPEGDeliveryException
Since:
MHP 1.0.1

addNPTListener

public void addNPTListener(NPTListener l)
Add a listener to NPT events on the DSMCCStream object. Adding the same listener a second time has no effect.

Parameters:
l - the listener
Since:
MHP 1.0.1

removeNPTListener

public void removeNPTListener(NPTListener l)
Remove a listener to NPT events on the DSMCCStream object. Removing a non-subscribed listener has no effect.

Parameters:
l - the listener to remove
Since:
MHP 1.0.1