org.dvb.dsmcc
Class StreamEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.dvb.dsmcc.StreamEvent
All Implemented Interfaces:
java.io.Serializable

public class StreamEvent
extends java.util.EventObject

This class describes a Stream event which is used to synchronize an application with an MPEG Stream.

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. This may cause stream events scheduled against NPT to fire at the wrong time or to never fire at all. Applications should only use scheduled stream events with NPT where they are confident that the network where they are to be used does not have this problem. DVB Timeline, DSM-CC "do it now" events and events carried within DVB synchronised auxiliary data offer more reliable alternatives to NPT.

NOTE [GEM P.2.9]: Throughout this class, references to the DSMCC stream event descriptor are to be read as referring to the trigger event, as described in clause B.4.2. References to the event data refer to the payload defined in that clause. References to "NPT" and "eventNPT" refer to "timebase values" and "timebase_value", respectively.

See Also:
Serialized Form

Constructor Summary
StreamEvent(DSMCCStreamEvent source, long npt, java.lang.String name, int eventId, byte[] eventData)
          Creates a StreamEvent object.
 
Method Summary
 byte[] getEventData()
          This method is used to retrieve the private data associated with the event.
 int getEventId()
          This method is used to get the identifier of the StreamEvent.
 java.lang.String getEventName()
          This method is used to get the name of the StreamEvent
 long getEventNPT()
          This method is used to get the value of the timeline when the event was triggered
 java.lang.Object getSource()
          This method returns the DSMCCStreamEvent that generated the event.
 
Methods inherited from class java.util.EventObject
toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamEvent

public StreamEvent(DSMCCStreamEvent source,
                   long npt,
                   java.lang.String name,
                   int eventId,
                   byte[] eventData)
Creates a StreamEvent object.

Parameters:
source - The DSMCCStreamEvent that has generated the event.
npt - The value of the timeline when the event is triggered. For NPT based timelines, this value is equal to the field eventNPT in the DSMCC StreamEventDescriptor except where the event is a "do it now" event in which case the value -1 is returned (as the value of NPT may not be meaningful). For DVB timelines, this value is the to-be-completed
name - The name of this event. The list of event names is located in the DSMCC StreamEvent object. This list is returned by the method DSMCCStreamEvent.getEventList.
eventId - The eventId of this event. The list of event IDs is located in the DSMCC StreamEvent object.
eventData - The application specific data found in the DSMCC StreamEventDescriptor.
Method Detail

getSource

public java.lang.Object getSource()
This method returns the DSMCCStreamEvent that generated the event.

Overrides:
getSource in class java.util.EventObject
Returns:
the DSMCCStreamEvent that generated the event.

getEventName

public java.lang.String getEventName()
This method is used to get the name of the StreamEvent

Returns:
the name of the StreamEvent

getEventId

public int getEventId()
This method is used to get the identifier of the StreamEvent.

Returns:
The identifier of the StreamEvent. NOTE [GEM P.2.3.1.2]: For the lightweight binding of the trigger API, this method may always return -1 to indicate that there is no event ID.

getEventNPT

public long getEventNPT()
This method is used to get the value of the timeline when the event was triggered

Returns:
The value of the timeline in milliseconds.

getEventData

public byte[] getEventData()
This method is used to retrieve the private data associated with the event. For events signalled by a DVB synchronised event descriptor, these are the bytes carried in the synchronised_event_data_byte field. For events signalled by a DSMCC stream event descriptor, these are the contents of the privateDataByte field.

Returns:
The private data associated with the event.